/**
 * Typography — the single source of truth for fonts and figures.
 *
 * Every view gets its fonts, and its figure style (lining / tabular), from
 * here and names none of its own: the
 * buyer-facing site, the broadcast graphics, the overlays, both clerk views
 * and the Tabler admin. Change a typeface by editing the @import below and
 * the tokens under :root; nothing else should need touching.
 *
 * Buyer-facing and broadcast views link this file directly, before their other
 * stylesheets. The admin views reach it through an @import at the top of
 * admin-shared.css, which they all already load - see the note there for why
 * the two differ. The superadmin views name no font at all and so link
 * neither; they render on Tabler's stack.
 *
 * Load it FIRST, before any other stylesheet. auction-shared.css and
 * auction-overlays.css both consume these tokens and define none of their own.
 *
 * ONE DELIBERATE EXCEPTION, which this file should not absorb:
 *
 *   public/css/catalog-preview.css self-hosts Roboto as @font-face. Playwright
 *   renders the catalogue PDF from it, and PDF output has to embed a font file
 *   it controls - a Google Fonts @import would make the PDF depend on a network
 *   fetch at render time. It is a separate system on purpose.

 *
 * @author Budnavet Development Team
 * @version 1.0.0
 */

/* ===========================================
   FONT FILES

   Weights are the union of what the views actually use: 300-900 for Archivo,
   300-800 for both Spectral faces. Italic is Archivo-only (400/500/700 - the
   seller lines and unknown pedigree names); no serif rule is ever italic, so
   the Spectral italics are deliberately not loaded.

   Browsers fetch only the faces a page actually renders, so an unused weight
   in this list costs nothing but a line of CSS.
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Archivo:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,500;1,700&family=Spectral:wght@300;400;500;600;700;800&family=Spectral+SC:wght@300;400;500;600;700;800&display=swap');

/* ===========================================
   FAMILY TOKENS
   =========================================== */

:root {
    /* Display voice. Spectral SC applies its small caps through an always-on
       OpenType `ccmp` feature rather than `smcp`, so naming the family is
       enough - `font-variant-caps` neither enables nor disables it. The only
       way to get mixed case is to use --font-serif instead.

       Small caps set ~20-29% wider than the Playfair Display they replaced,
       so this belongs on display type and short labels, never on prose. */
    --font-display: 'Spectral SC', Georgia, serif;

    /* Mixed-case serif. The readable fallback for generic headings, alert
       headings, empty states and anything sentence-shaped. */
    --font-serif: 'Spectral', Georgia, serif;

    /* Everything else: body copy, UI, numbers, labels.

       Archivo replaced Inter here. It is narrower than Inter on every string
       measured, digits included (-5%), so it can never overflow a box Inter
       fitted, and its x-height is within 3% of Inter's so nothing reads
       smaller at the same font-size. */
    --font-sans: 'Archivo', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Fixed-width, for operator surfaces: keyboard hints, ids, slugs, debug
       output. A system stack on purpose - it downloads nothing, and these are
       desktop views where the local mono face is the familiar one.

       Deliberately NOT used for the broadcast countdown: that renders on
       whatever machine runs OBS, so a system stack would make the output vary
       by machine. See .auto-clerk-timer-display .timer-value. */
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco,
                 Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* Admin surface (Tabler).

       The admin views render body text in Tabler's own stack, which this
       codebase never names, so there is nothing to centralise there. These two
       tokens cover the only faces the admin views did name. Values are copied
       verbatim: pulling admin onto this file changed nothing on screen, it
       only moved the values here so a future change has one place to happen.

       Two tokens rather than one because the views had two different stacks,
       and merging them would change what renders - .stream-info takes the
       browser's generic mono, .font-mono pins Monaco ahead of it. */
    --font-admin-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    --font-admin-mono-generic: monospace;

    /* Neither Spectral face ships a 900 - the range stops at 800. Rules that
       want maximum weight on --font-display must say 800; 900 on a --font-sans
       element is fine, Archivo has it. */
}

/* ===========================================
   FIGURES

   Spectral and Spectral SC default to old-style figures: digits at
   lowercase height, with a zero that reads as the letter o ("125 ooo",
   "Lot 1o"). Lining figures are set once, on the root, and every element
   inherits them - font-variant-numeric is an inherited property. Archivo's
   figures are lining already, so this changes nothing there.

   Numbers that change while you watch - bids, prices in a list, countdowns,
   timers, bid times - also want tabular (fixed-width) figures, or the text
   jitters as digits change. Use the token:

       font-variant-numeric: var(--numeric-tabular);

   Never write a bare `tabular-nums`. The declaration replaces the inherited
   value rather than adding to it, so `tabular-nums` alone silently drops
   Spectral back to old-style figures. The token carries both.
   =========================================== */

:root {
    --numeric-default: lining-nums;
    --numeric-tabular: lining-nums tabular-nums;
}

html {
    font-variant-numeric: var(--numeric-default);
}
