/* src/core/static/core/theme.css
   The institutional theme's additions (UI refresh spec §3.4): only what
   djust's register_preset() and register_design_system() can't express.
   Colours are theme tokens only (tests/core/test_css_tokens.py). Each block
   names the gap it fills; the spec's §10.5 lists them for upstream. */

/* Gap: a design system names its fonts but can't ship them. Self-hosted
   woff2, Latin subset, SIL Open Font License (fonts/OFL-*.txt). */
@font-face {
    font-family: "Source Serif 4";
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url("fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
        U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 200 900;
    font-display: swap;
    src: url("fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
        U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The "civic" pack's fonts (core.theme_civic; case page spec §5.4): the
   same self-hosting, Latin subset and SIL Open Font License
   (fonts/OFL-*.txt). A browser fetches a face only when a rule uses it,
   so institutional pages load neither. */
@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url("fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
        U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Figtree";
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
        U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Gap: the preset emits no color-scheme, so native controls (a checkbox, a
   select's open list, scrollbars) stay light in dark mode. */
html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

/* Gap: components.css colours no plain link. :where() keeps this at zero
   specificity, so the rail, panel, tabs and buttons keep their own colours. */
:where(a:not(.btn)) {
    color: hsl(var(--link));
}

:where(a:not(.btn):hover) {
    color: hsl(var(--link-hover));
}

a.btn {
    text-decoration: none;
}

/* Gap: components.css draws a focus ring only on its own components; links,
   summaries and the rest keep the browser's. One ring everywhere; the rail
   draws its own on the green (navigation.css). */
:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

/* Gap: no typography option for tabular figures. */
table {
    font-variant-numeric: tabular-nums;
}

/* .input pins a 2.5rem height; a <textarea class="textarea input"> needs its
   rows. */
textarea.input {
    height: auto;
    min-height: 5.5rem;
}

/* Gap: the file picker inside an .input box keeps the browser's button. */
input[type="file"].input {
    align-items: center;
    height: auto;
    min-height: 2.5rem;
    padding: 0.375rem 0.5rem;
}

input[type="file"].input::file-selector-button {
    margin-inline-end: 0.75rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid hsl(var(--border));
    border-radius: calc(var(--radius) - 2px);
    background-color: hsl(var(--secondary));
    color: hsl(var(--secondary-foreground));
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}
