/* =============================================================
   SIDRA API docs - structural overrides on top of Material + SIDRA's extra.css.
   Goal: each top-level section reads as its own block and each member
   has a clear visual start, instead of one continuous flow.
   ============================================================= */

/* Top-level sections (## Declaration, ## Get an instance, ## Properties, ...) */
.md-typeset h2 {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--md-default-fg-color--lightest);
    font-weight: 700;
    font-size: 1.45rem;
    letter-spacing: -0.01em;
}
.md-typeset > h2:first-of-type {
    border-top: 0;
    margin-top: 1.5rem;
    padding-top: 0;
}

/* Individual members (### Project, ### OpenProject, ...) - left rail + tint.
   Tightened spacing: pages with 30+ members read more like a list. */
.md-typeset h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
    padding: 0.3rem 0 0.3rem 0.75rem;
    border-left: 3px solid var(--md-primary-fg-color);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--md-default-fg-color);
    background: linear-gradient(
        to right,
        var(--md-default-fg-color--lightest) 0,
        transparent 50%
    );
    border-radius: 0 4px 4px 0;
}
.md-typeset h2 + h3 {
    margin-top: 1rem;
}

/* Tighter spacing between member content (signature, type, samples) */
.md-typeset h3 + p { margin-top: 0.35rem; margin-bottom: 0.35rem; }
.md-typeset h3 + .highlight { margin-top: 0.4rem; }

/* Collapsed "Code samples" details block - quieter than expanded tabs */
.md-typeset details.example {
    margin-top: 0.5rem;
    margin-bottom: 0.6rem;
    border-color: var(--md-default-fg-color--lightest);
    box-shadow: none;
    font-size: 0.85rem;
}
.md-typeset details.example > summary {
    padding: 0.3rem 0.7rem 0.3rem 2rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--md-default-fg-color--light);
    background: transparent;
    border-bottom: 0;
}
.md-typeset details.example[open] > summary {
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
}
.md-typeset details.example > summary::before {
    background-color: var(--md-default-fg-color--lighter);
    width: 0.9rem;
    height: 0.9rem;
}

/* Inline metadata labels (**Type**, **Returns**, **Parameters**, **Usage**) */
.md-typeset p > strong:first-child {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--md-default-fg-color--light);
    margin-right: 0.5rem;
}
.md-typeset table strong,
.md-typeset li strong,
.md-typeset h1 strong,
.md-typeset h2 strong,
.md-typeset h3 strong {
    text-transform: none;
    letter-spacing: normal;
    font-size: inherit;
    color: inherit;
    margin-right: 0;
}

/* Top-of-page metadata block (Namespace/Assembly/COM CLSID) */
.md-typeset h1 + p {
    margin-top: 0.5rem;
    padding: 0.6rem 0.9rem;
    background: var(--md-code-bg-color);
    border-left: 3px solid var(--md-default-fg-color--lighter);
    border-radius: 4px;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--md-default-fg-color--light);
}
.md-typeset h1 + p code {
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

/* Spacing inside member blocks */
.md-typeset h3 + p,
.md-typeset h3 + .highlight {
    margin-top: 0.5rem;
}
.md-typeset .tabbed-set {
    margin-top: 0.8rem;
}

/* =============================================================
   Member overview tables (## Members -> Properties / Methods).
   Scoped to .api-member-index (emitted by the extractor) so these
   rules can't disturb parameter tables or Documentation-page tables.
   A scannable index: fixed full-width layout, tight rows, monospace
   member names, muted types, summaries that wrap inside the page.
   ============================================================= */
.md-typeset .api-member-index > p {
    margin-bottom: 0.2rem;
}
/* Fixed layout + full width keeps long summaries inside the page
   instead of overflowing into a horizontal scroll. */
.md-typeset .api-member-index table {
    display: table;
    width: 100%;
    table-layout: fixed;
    font-size: 0.8rem;
}
.md-typeset .api-member-index th,
.md-typeset .api-member-index td {
    padding: 0.35rem 0.7rem;
    vertical-align: top;
    overflow-wrap: anywhere;
}
/* Column widths: member name | type/returns | summary */
.md-typeset .api-member-index col:first-child,
.md-typeset .api-member-index th:first-child,
.md-typeset .api-member-index td:first-child {
    width: 30%;
}
.md-typeset .api-member-index th:nth-child(2),
.md-typeset .api-member-index td:nth-child(2) {
    width: 20%;
}
.md-typeset .api-member-index th:nth-child(3),
.md-typeset .api-member-index td:nth-child(3) {
    width: 50%;
}
/* First column = member name: monospace, links unobtrusive */
.md-typeset .api-member-index td:first-child {
    font-family: var(--md-code-font-family, monospace);
    font-size: 0.78rem;
    font-weight: 600;
}
.md-typeset .api-member-index td:first-child a {
    color: var(--md-default-fg-color);
}
.md-typeset .api-member-index td:first-child a:hover {
    color: var(--md-accent-fg-color);
}
/* Type / Returns column: muted */
.md-typeset .api-member-index td:nth-child(2) {
    color: var(--md-default-fg-color--light);
}
.md-typeset .api-member-index td code {
    background: transparent;
    padding: 0;
    font-size: 0.78rem;
}
/* The **Properties** / **Methods** sub-labels above each table */
.md-typeset .api-member-index > p > strong:first-child {
    display: block;
    margin-top: 0.4rem;
}
