/*
 * LACQUER & GOLD — the redesign's one token file (ADR-0011).
 *
 * The 30 colours are design/handover-v39/tokens/tokens.css verbatim, taken
 * from the wat's seal and the vihara's lacquered, gilded doors. The table
 * "Lacquer & Gold (web)" in docs/ui-guidelines.md is the contract the guard
 * tests hold this file to: change the table first, then this file.
 *
 * The public layout inlines this file, so a page on a weak phone signal
 * makes no extra request; the staff layout links it, versioned by its
 * modification time, so it is cached across a working day. No other file
 * declares a colour (StaffStylesheetTest, PublicStylesheetTest).
 */
:root {
    /* ── Reds and gold ─────────────────────────────────────────────── */
    --wd-lacquer: #9e1b1f;          /* primary buttons, links, sil badges */
    --wd-red-brown: #7e1d20;        /* hero, quote band, featured cards, players, selected states */
    --wd-red-brown-deep: #641719;   /* top date bar, footer, admin sidebar */
    --wd-accent-dark: #4e1214;      /* moon disc, audio cover, call-to-action bands */
    --wd-gold: #e3b64f;             /* ornament, buttons on red-brown, focus ring */
    --wd-ochre: #8a6216;            /* gold-coloured text on light grounds — never on a band */

    /* ── Grounds ───────────────────────────────────────────────────── */
    --wd-page: #faf3e6;             /* page (parchment) */
    --wd-card: #fffcf6;             /* cards */
    --wd-band: #f3e7d0;             /* section bands */
    --wd-tile: #f7ecd6;             /* tiles, notes */
    --wd-track: #f1e4cc;            /* progress tracks, neutral chips */
    --wd-field: #ffffff;            /* inputs, chips */

    /* ── Text ──────────────────────────────────────────────────────── */
    --wd-ink: #2a1712;              /* text */
    --wd-muted: #6b5244;            /* secondary text */
    --wd-on-dark: #fbefd9;          /* text on red-brown */
    --wd-on-dark-muted: #e7cfae;    /* secondary text on red-brown */
    --wd-on-primary: #ffffff;       /* text on lacquer */
    --wd-on-gold: #2a0608;          /* text on gold */

    /* ── Lines ─────────────────────────────────────────────────────── */
    --wd-line: #e6d5b5;             /* card borders, dividers */
    --wd-line-input: #d9c5a0;       /* input and secondary-button borders */

    /* ── States: a tint and the text that sits on it ──────────────── */
    --wd-sila-bg: #f8e1df;          /* sil-day tint, alerts */
    --wd-sila-fg: #8c1519;          /* text on the sil tint, errors */
    --wd-festival-bg: #f6e7c3;      /* festival and waiting tint */
    --wd-festival-fg: #6e4e0e;      /* text on the festival tint */
    --wd-success-bg: #eef6ef;
    --wd-success-fg: #2f7a4a;
    --wd-info-bg: #e8eef8;
    --wd-info-fg: #2c4a7a;

    /* ── The seal ──────────────────────────────────────────────────── */
    --wd-seal-on-light: #b3141c;
    --wd-seal-on-dark: #e3b64f;

    /* ── Two hairlines the canvas draws on red-brown-deep: on-dark-muted at
       35% (the date bar's button outlines) and at 18% (the footer's rule).
       Not colours of their own, so not in the guidelines' table. ────── */
    --wd-on-dark-hairline: rgba(231, 207, 174, .35);
    --wd-on-dark-rule: rgba(231, 207, 174, .18);
    /* The staff sidebar's hovered row (on-dark at 8%), the person card's
       shade, and the scrim behind the sidebar when it opens as a drawer. */
    --wd-on-dark-hover: rgba(251, 239, 217, .08);
    --wd-shade: rgba(0, 0, 0, .16);
    --wd-scrim: rgba(42, 23, 18, .45);

    /* ── Type, in rem against html's 112.5% (18px at the normal size), so
       the small/normal/large switch scales every size on the page together:
       16 / 18 / 20 px base, as the canvas's web boards are drawn in em. ── */
    --wd-text-caption: 0.7222rem;   /* 13 — the floor (ADR-0011) */
    --wd-text-body: 0.8333rem;      /* 15 — text inside cards and lists */
    --wd-text-base: 1rem;           /* 18 — running text, and the canvas's lead */
    --wd-text-h2: 1.2222rem;        /* 22 */
    --wd-text-h1: 1.5556rem;        /* 28 */
    --wd-text-display: 1.8889rem;   /* 34 — a page's one title */
    /* The three «ក» of the text-size switch show the three sizes, so their
       own sizes are fixed rather than scaled. */
    --wd-text-glyph-s: 14px;
    --wd-text-glyph-m: 17px;
    --wd-text-glyph-l: 20px;
    --wd-line-height: 1.8;
    --wd-line-height-display: 1.7;  /* Moul: 1.55–1.75 */

    /* ── Shape and touch ───────────────────────────────────────────── */
    --wd-radius-sm: 10px;
    --wd-radius-md: 12px;
    --wd-radius-lg: 16px;
    --wd-radius-xl: 22px;
    --wd-radius-pill: 999px;
    --wd-target: 44px;              /* the smallest tap target */
    --wd-button-height: 48px;       /* buttons and inputs */

    /* ── THE OLD NAMES, so every screen built before the redesign takes the
       new look without a rewrite. LegacyTokenAllowlistTest lists the views
       still allowed to use them; that list only shrinks, and these go when
       it is empty. ──────────────────────────────────────────────────── */
    --ink: var(--wd-ink);
    --paper: var(--wd-page);
    --site-paper: var(--wd-page);
    --card: var(--wd-card);
    --accent: var(--wd-lacquer);
    --accent-ink: var(--wd-on-primary);
    --site-action: var(--wd-lacquer);
    --header: var(--wd-red-brown-deep);
    --gold: var(--wd-gold);
    --ivory: var(--wd-on-dark);
    --muted: var(--wd-muted);
    --line: var(--wd-line);
    --card-line: var(--wd-line);
    --gold-tint: var(--wd-festival-bg);
    --danger: var(--wd-sila-fg);
    --danger-bg: var(--wd-sila-bg);
    --warning-bg: var(--wd-festival-bg);
    --warning-ink: var(--wd-festival-fg);
    --success-bg: var(--wd-success-bg);
    --info-bg: var(--wd-info-bg);
    --today-tint: rgba(227, 182, 79, .18);   /* gold at 18% */
    --gold-wash: rgba(227, 182, 79, .16);    /* gold at 16% */
    --t-caption: var(--wd-text-caption);
    --t-body: var(--wd-text-base);
    --t-lead: var(--wd-text-base);
    --t-heading: var(--wd-text-h2);
    --t-title: var(--wd-text-h1);
    --t-display: var(--wd-text-display);
}

html { font-size: 112.5%; }
html[data-text-size="small"] { font-size: 100%; }
html[data-text-size="large"] { font-size: 125%; }

/* The canvas's line icons (components/wd/icon), drawn in the colour of
   the words beside them, on every page that uses them. */
.wd-icon {
    width: 1.15em; height: 1.15em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.wd-icon-fill { fill: currentColor; stroke: none; }

/* One ring, gold, on every ground (ADR-0011). On light grounds it measures
   1.55–1.90:1 — accepted with the canvas, and pinned at those values so it
   can only get better (PublicStylesheetTest). A file picker's input is hidden from sight, so its ring is drawn
   on the button that opens it (the gift notice's receipt photo). */
.wd-file:has(+ .wd-file-input:focus-visible), :focus-visible { outline: 3px solid var(--wd-gold); outline-offset: 2px; }
