/* The API reference in the Commonplace house style: the design system's
   tokens and font (vendor/design-system, copied beside this file as
   assets/house/ by scripts/api-site-assets.mjs) laid over the generator's
   theme. Every color is a house token: ink, hairlines, square corners, no
   shadows, one typeface. Color appears in one place only, code: a small
   fixed palette of house tokens by role (keyword, string, number, call,
   type, comment). The generator's own light / dark / system setting drives
   the house theme through data-theme, and the reference's custom script
   adds theme-auto so "system" follows the OS.

   Guide pages (a document whose title is its own heading) are set for
   reading: a measured column, a larger opening paragraph, no settings
   panel and a two-level contents list. Reference pages keep the panel and
   the full contents. */
@import url("house/tokens/commonplace.css");
/* Which of the generator's code colors means which role: written by
   scripts/api-site-assets.mjs from the generated highlight.css. */
@import url("house/highlight-roles.css");

:root {
    --tint: color-mix(in srgb, var(--text-color) 7%, transparent);

    --light-color-background: var(--bg-color);
    --light-color-background-secondary: var(--bg-color);
    --light-color-background-active: var(--tint);
    --light-color-background-warning: var(--bg-color);
    --light-color-warning-text: var(--text-color);
    --light-color-accent: var(--border-color);
    --light-color-active-menu-item: var(--tint);
    --light-color-text: var(--gray-90);
    --light-color-contrast-text: var(--text-color);
    --light-color-text-aside: var(--text-light);
    --light-color-icon-background: var(--bg-color);
    --light-color-icon-text: var(--text-color);
    --light-color-comment-tag-text: var(--text-color);
    --light-color-comment-tag: var(--bg-color);
    --light-color-link: var(--text-color);
    --light-color-focus-outline: var(--ring);
    --light-color-document: var(--text-light);
    --light-color-alert-note: var(--text-color);
    --light-color-alert-tip: var(--text-color);
    --light-color-alert-important: var(--text-color);
    --light-color-alert-warning: var(--text-color);
    --light-color-alert-caution: var(--text-color);
    --light-code-background: var(--bg-color);

    --dark-color-background: var(--bg-color);
    --dark-color-background-secondary: var(--bg-color);
    --dark-color-background-active: var(--tint);
    --dark-color-background-warning: var(--bg-color);
    --dark-color-warning-text: var(--text-color);
    --dark-color-accent: var(--border-color);
    --dark-color-active-menu-item: var(--tint);
    --dark-color-text: var(--gray-90);
    --dark-color-contrast-text: var(--text-color);
    --dark-color-text-aside: var(--text-light);
    --dark-color-icon-background: var(--bg-color);
    --dark-color-icon-text: var(--text-color);
    --dark-color-comment-tag-text: var(--text-color);
    --dark-color-comment-tag: var(--bg-color);
    --dark-color-link: var(--text-color);
    --dark-color-focus-outline: var(--ring);
    --dark-color-document: var(--text-light);
    --dark-color-alert-note: var(--text-color);
    --dark-color-alert-tip: var(--text-color);
    --dark-color-alert-important: var(--text-color);
    --dark-color-alert-warning: var(--text-color);
    --dark-color-alert-caution: var(--text-color);
    --dark-code-background: var(--bg-color);
}

/* Kind colors: the word says the kind; the icon is ink. */
:root {
    --light-color-ts-project: var(--text-light); --dark-color-ts-project: var(--text-light);
    --light-color-ts-module: var(--text-light); --dark-color-ts-module: var(--text-light);
    --light-color-ts-namespace: var(--text-light); --dark-color-ts-namespace: var(--text-light);
    --light-color-ts-enum: var(--text-light); --dark-color-ts-enum: var(--text-light);
    --light-color-ts-enum-member: var(--text-light); --dark-color-ts-enum-member: var(--text-light);
    --light-color-ts-variable: var(--text-light); --dark-color-ts-variable: var(--text-light);
    --light-color-ts-function: var(--text-light); --dark-color-ts-function: var(--text-light);
    --light-color-ts-class: var(--text-light); --dark-color-ts-class: var(--text-light);
    --light-color-ts-interface: var(--text-light); --dark-color-ts-interface: var(--text-light);
    --light-color-ts-constructor: var(--text-light); --dark-color-ts-constructor: var(--text-light);
    --light-color-ts-property: var(--text-light); --dark-color-ts-property: var(--text-light);
    --light-color-ts-method: var(--text-light); --dark-color-ts-method: var(--text-light);
    --light-color-ts-reference: var(--text-light); --dark-color-ts-reference: var(--text-light);
    --light-color-ts-call-signature: var(--text-light); --dark-color-ts-call-signature: var(--text-light);
    --light-color-ts-index-signature: var(--text-light); --dark-color-ts-index-signature: var(--text-light);
    --light-color-ts-constructor-signature: var(--text-light); --dark-color-ts-constructor-signature: var(--text-light);
    --light-color-ts-parameter: var(--text-light); --dark-color-ts-parameter: var(--text-light);
    --light-color-ts-type-parameter: var(--text-light); --dark-color-ts-type-parameter: var(--text-light);
    --light-color-ts-accessor: var(--text-light); --dark-color-ts-accessor: var(--text-light);
    --light-color-ts-get-signature: var(--text-light); --dark-color-ts-get-signature: var(--text-light);
    --light-color-ts-set-signature: var(--text-light); --dark-color-ts-set-signature: var(--text-light);
    --light-color-ts-type-alias: var(--text-light); --dark-color-ts-type-alias: var(--text-light);
    --light-color-ts-keyword: var(--text-light); --dark-color-ts-keyword: var(--text-light);
}

/* Code colors by role. Each is a house token; keyword and type are mixed
   toward the text color so they keep their contrast in both themes. The
   generator's numbered code colors are pointed at these roles in
   house/highlight-roles.css. */
:root {
    --syn-keyword: color-mix(in srgb, var(--axis-z) 72%, var(--text-color));
    --syn-string: var(--cat-green);
    --syn-number: var(--axis-x);
    --syn-call: var(--construction);
    --syn-type: color-mix(in srgb, var(--cat-4) 68%, var(--text-color));
    --syn-comment: var(--text-light);
    --code-plate: color-mix(in srgb, var(--construction) 5%, var(--bg-color));
}

/* One typeface for prose, chrome and code. */
body, code, pre, kbd, .tsd-signature, .tsd-kind-icon, input, select, button {
    font-family: var(--font-sans);
}
body { font-size: 16px; line-height: 1.7; color: var(--gray-90); }
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: var(--tracking-tight); color: var(--text-color); text-wrap: balance; }

/* Flat and square: hairlines, never shadows or rounded corners. */
*,*::before,*::after {
    /* house-style-lint-disable-next-line radius — zero, forced over the generator's rounded corners */
    border-radius: 0 !important;
    /* house-style-lint-disable-next-line shadow — none, forced over the generator's shadows */
    box-shadow: none !important;
}
*:focus-visible { box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--ring) !important; outline: none; }
.tsd-signature, .tsd-panel, blockquote {
    background: var(--bg-color);
    border-color: var(--border-color);
}
code { border: 0; padding: 0; background: transparent; }

/* Three columns: the page in the middle, narrow navigation on either side.
   The side columns are smaller and gray, so the middle one reads as the
   page. */
.container { max-width: 1280px; }
@media (min-width: 1200px) {
    .container-main {
        grid-template-columns: 14rem minmax(0, 1fr) 14rem;
        column-gap: 3rem;
    }
    .page-menu { padding-left: 0; }
}
.site-menu, .page-menu { font-size: 13.5px; line-height: 1.4; color: var(--text-light); }
.tsd-navigation a, .tsd-page-navigation a, .tsd-navigation summary > span { color: var(--text-light); }
.tsd-navigation a:hover, .tsd-page-navigation a:hover { color: var(--text-color); opacity: 1; text-decoration: none; }
.tsd-navigation .tsd-kind-icon { display: none; }
.tsd-navigation a { padding: 0.3rem 0.5rem; border-left: 2px solid transparent; }
.tsd-navigation a.current { background: transparent; color: var(--text-color); font-weight: 700; border-left-color: var(--text-color); text-decoration: none; }
.tsd-page-navigation a { padding: 0.25rem 0 0.25rem 0.75rem; border-left: 2px solid var(--border-color); }
.tsd-page-navigation a.current, .tsd-page-navigation a.house-in-view { background: transparent; color: var(--text-color); border-left-color: var(--text-color); }

/* Guide pages: the page is for reading. */
.col-content:has(> .tsd-typography > h1) { max-width: 64ch; }
body:has(.col-content > .tsd-typography > h1) .tsd-navigation.settings { display: none; }
body:has(.col-content > .tsd-typography > h1) .tsd-page-navigation .tsd-accordion-details > a,
body:has(.col-content > .tsd-typography > h1) .tsd-page-navigation ul ul { display: none; }
body:has(.col-content > .tsd-typography > h1) .tsd-page-navigation ul { padding-left: 0; }

/* Type: a clear scale, more space above a heading than below it. */
.col-content h1 { font-size: 2.1rem; line-height: 1.2; margin: 0 0 0.6em; }
/* A page whose text opens with its own title (the front page, from the
   guides' README) shows that title once: the generator's project name
   above it would say the same thing twice. */
.tsd-page-title:has(+ .tsd-typography > h1:first-child) > h1 { display: none; }
.tsd-typography h2 { font-size: 1.35rem; line-height: 1.3; margin: 2.4em 0 0.6em; }
.tsd-typography h3 { font-size: 1.1rem; line-height: 1.35; margin: 1.8em 0 0.4em; }
.tsd-typography > h1, .tsd-typography > h2, .tsd-typography > h3 { padding: 0; }
.tsd-typography { line-height: 1.7; }
.tsd-typography p { margin: 0 0 1.1em; }
.tsd-typography li { margin-bottom: 0.5em; }
.tsd-typography > h1 + p { font-size: 1.15rem; line-height: 1.6; color: var(--text-color); }
.tsd-typography th { font-size: 0.75rem; font-weight: 700; letter-spacing: var(--tracking-chrome); text-transform: uppercase; color: var(--text-light); text-align: left; }
.tsd-typography table { border-collapse: collapse; }
.tsd-typography th, .tsd-typography td { border: 0; border-bottom: var(--hairline) solid var(--border-color); padding: 0.5rem 1rem 0.5rem 0; vertical-align: top; }
.tsd-typography tr:nth-child(even) { background: transparent; }

/* Links are ink with a gray underline that darkens on hover, so they are
   told apart from text by more than hue. */
a, .tsd-index-link { color: var(--text-color); transition: var(--transition); }
a:hover { opacity: 0.6; }
.col-content a, .tsd-typography a {
    text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: var(--hairline);
    text-decoration-color: var(--text-light);
}
.col-content a:hover, .tsd-typography a:hover { opacity: 1; text-decoration-color: var(--text-color); }

/* Notes: a hairline box. */
blockquote, .tsd-alert {
    margin: 1.6em 0; padding: 0.9rem 1rem; border: var(--hairline) solid var(--border-color);
    background: var(--bg-color); color: var(--gray-90);
}
blockquote > :last-child, .tsd-alert > :last-child { margin-bottom: 0; }
.tsd-alert-title { font-size: 0.75rem; font-weight: 700; letter-spacing: var(--tracking-chrome); text-transform: uppercase; color: var(--text-light); }

/* Figures sit between hairlines. */
.tsd-typography p:has(> img:only-child) { border-top: var(--hairline) solid var(--border-color); border-bottom: var(--hairline) solid var(--border-color); padding: 1rem 0; margin: 1.6em 0; }

/* Code: a tinted plate under an ink rule, the language named at its top
   left and Copy at its top right. */
pre {
    position: relative; background: var(--code-plate); border: 0; border-top: 2px solid var(--text-color);
    padding: 2.25rem 1.25rem 1.1rem; margin: 1.6em 0; font-size: 14px; line-height: 1.6; color: var(--text-color);
}
pre::before {
    position: absolute; top: 0.6rem; left: 1.25rem;
    font-size: 0.68rem; font-weight: 700; letter-spacing: var(--tracking-chrome); text-transform: uppercase; color: var(--text-light);
}
pre:has(> code[class~="ts"])::before, pre:has(> code[class~="typescript"])::before { content: "TypeScript"; }
pre:has(> code[class~="js"])::before, pre:has(> code[class~="javascript"])::before { content: "JavaScript"; }
pre:has(> code[class~="sh"])::before, pre:has(> code[class~="bash"])::before { content: "Shell"; }
pre:has(> code[class~="json"])::before { content: "JSON"; }
pre > button {
    position: absolute; top: 0.35rem; right: 0.5rem; opacity: 1; visibility: visible;
    background: transparent; border: 0; color: var(--text-light); font-size: 0.75rem; padding: 0.2rem 0.4rem; cursor: pointer;
}
pre > button:hover { color: var(--text-color); }
.tsd-typography :not(pre) > code, .col-content p code, .col-content li code, .col-content td code { background: var(--tint); padding: 0.05em 0.3em; }

/* Signatures take the code colors by role. */
.tsd-signature { background: var(--code-plate); border: 0; border-top: 2px solid var(--text-color); padding: 0.9rem 1.25rem; font-size: 14px; line-height: 1.6; color: var(--text-color); }
.tsd-signature-keyword { color: var(--syn-keyword); }
.tsd-signature-type, .tsd-signature .tsd-kind-type-parameter, .tsd-signature .tsd-signature-type { color: var(--syn-type); font-style: normal; }
.tsd-signature .tsd-kind-call-signature, .tsd-signature .tsd-kind-constructor-signature, .tsd-signature .tsd-kind-method, .tsd-signature .tsd-kind-property { color: var(--syn-call); }
.tsd-signature-symbol, .tsd-signature .tsd-kind-parameter { color: var(--text-color); }
.tsd-signature a { text-decoration: none; }
.tsd-signature a:hover { text-decoration: underline; }

/* Chrome is uppercase and tracked; content is never uppercased. */
.tsd-page-toolbar .title,
.tsd-accordion-summary > h3,
.tsd-accordion-summary > h4,
.tsd-navigation.settings summary,
.tsd-page-navigation summary h3,
#tsd-toolbar-links a,
.tsd-kind,
.tsd-breadcrumb {
    text-transform: uppercase;
    letter-spacing: var(--tracking-chrome);
    font-size: 0.75rem;
    font-weight: 700;
}
.page-menu .tsd-accordion-summary > h3, .tsd-navigation.settings summary { color: var(--text-light); font-size: 0.7rem; }
.tsd-breadcrumb, .tsd-breadcrumb a { color: var(--text-light); text-decoration: none; }
.tsd-page-toolbar { border-bottom: var(--hairline) solid var(--border-color); background: var(--bg-color); }

@media (prefers-reduced-motion: reduce) {
    a, .tsd-navigation a { transition: none; }
}
