/* API reference pages. Colors come from the theme variant. */

#R-body .api-entry {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid color-mix(in srgb, var(--INTERNAL-MAIN-TEXT-color) 14%, transparent);
    scroll-margin-top: 4rem;
}
#R-body .api-entry pre.api-sig {
    margin: 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--INTERNAL-CODE-BLOCK-BORDER-color);
    border-left: 3px solid var(--INTERNAL-PRIMARY-color);
    border-radius: 4px;
    background: var(--INTERNAL-CODE-BLOCK-BG-color);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
#R-body .api-entry pre.api-sig code {
    background: none;
    border: 0;
    padding: 0;
    font-size: 0.95rem;
    color: var(--INTERNAL-MAIN-TEXT-color);
}
#R-body .api-entry pre.api-sig b { color: var(--INTERNAL-MAIN-TITLES-TEXT-color); }

.api-facts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
#R-body .api-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.05rem 0.5rem;
    border: 1px solid color-mix(in srgb, var(--INTERNAL-MAIN-TEXT-color) 20%, transparent);
    border-radius: 999px;
    background: none;
    font-size: 0.8rem;
    color: color-mix(in srgb, var(--INTERNAL-MAIN-TEXT-color) 80%, transparent);
    white-space: nowrap;
    cursor: default;
}
#R-body .api-stage { border-color: var(--INTERNAL-ACCENT-color); }
#R-body .api-no { border-style: dashed; }

/* Parameters: name on the left, description on the right. */
.api-param {
    display: grid;
    grid-template-columns: minmax(6rem, max-content) minmax(0, 1fr);
    gap: 1.25rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--INTERNAL-MAIN-TEXT-color) 8%, transparent);
}
#R-body .api-pname { align-self: start; background: none; border: 0; padding: 0; font-weight: 600; }
.api-pdesc > :first-child { margin-top: 0; }
.api-pdesc > :last-child { margin-bottom: 0; }

/* Error codes and call summaries. */
#R-body .api-errors table, #R-body table.api-summary { width: 100%; margin: 0.75rem 0 1rem; }
#R-body .api-errors td:first-child, #R-body table.api-summary td:first-child { white-space: nowrap; }
#R-body table.api-summary td { vertical-align: top; }

@media (max-width: 40rem) {
    .api-param { grid-template-columns: 1fr; gap: 0.25rem; }
}

#R-body table.api-index { width: 100%; }
#R-body table.api-index td { vertical-align: middle; }
#R-body table.api-index td:nth-child(n+2) { text-align: center; }

/* POSIX interface: link to the reference, departure flag. */
#R-body a.api-badge { text-decoration: none; cursor: pointer; }
#R-body a.api-ref { border-color: var(--INTERNAL-PRIMARY-color); color: var(--INTERNAL-PRIMARY-color); }
#R-body a.api-departs { border-color: var(--INTERNAL-ACCENT-color); background: color-mix(in srgb, var(--INTERNAL-ACCENT-color) 14%, transparent); color: var(--INTERNAL-MAIN-TEXT-color); }
#R-body .api-departures-label { font-weight: 600; }
