/**
 * 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 and superadmin views reach it through an @import at
 * the top of admin.css, which they all load: an @import serialises the
 * request, which is fine for an internal tool but not for the latency-
 * sensitive buyer and broadcast views.
 *
 * 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: ids, slugs and codes (.font-mono in admin.css). Admin
       body text is --font-sans, set by admin.css. */
    --font-admin-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', 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);
}
