/*
  Client-Space Design Tokens — CANONICAL SOURCE (Izon brand kit, v2, IZO-633)

  One palette for every client-facing surface: loger (login), the client
  videowall SPA (consumed through Tailwind indirections, see RULESET.md
  section 1) and any future page. Values are the Izon brand kit as mapped by
  the toolkit's izon-wall-theme.css: ink #12283F, bone #F6F5F1, paper #FCFBF8,
  ember #BF5B24.

  Theme resolution (see ../js/theme-toggle.js):
    1. [data-bs-theme="light"|"dark"] on <html> wins. The pre-paint script
       sets it before first paint from localStorage['vw-theme'] or, when no
       choice is stored, from prefers-color-scheme (Auto).
    2. With no attribute at all (JS disabled), the prefers-color-scheme
       block below follows the device. Light is the base :root value.
  The three colour blocks (light, dark-by-attribute, dark-by-media) carry the
  same dark values on purpose; tests/test_tokens.py fails if they drift.

  Do not edit values here to fix a look on one page. If a page looks wrong,
  the page is out of sync with this file. See ../RULESET.md.
*/

/* Self-hosted fonts (SIL OFL, see ../fonts/LICENSE.txt). Copy ../fonts next
   to the css folder (static/fonts) so these relative URLs resolve. */
@font-face { font-family: Archivo; src: url(../fonts/archivo.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Public Sans'; src: url(../fonts/public-sans.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url(../fonts/ibm-plex-mono-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url(../fonts/ibm-plex-mono-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }

/* ---- Light (base) ---- */
:root,
body.light-mode,
[data-bs-theme="light"] {
  --vw-bg: #F6F5F1;
  --vw-surface: #FCFBF8;
  --vw-surface-2: #EAE7DF;
  --vw-border: #DEDACF;
  --vw-border-strong: #C6BFB2;
  --vw-text: #3A3630;
  --vw-text-muted: #6B655B;
  --vw-accent: #2F5C86;
  --vw-ink: #12283F;
  --vw-on-ink: #F6F5F1;
  --vw-ember: #BF5B24;
  --vw-ember-wash: #F6E7DC;
  --vw-ember-ink: #9E4517;
  --vw-success: #1F7A52;
  --vw-warning: #CE9A2C;
  --vw-warning-ink: #8A6414;
  --vw-danger: #A83A2A;
  --vw-bar: #12283F;
  --vw-cell-bg: #0B1A2A;
  --vw-cell-hdr: rgba(11, 26, 42, .72);
  --vw-field: #FFFFFF;
  --vw-chip-ok: #E8F3EC;
  --vw-chip-watch: #F7EFD9;
  --vw-pick: #E3EAF2;
}

/* ---- Dark, explicit choice ---- */
[data-bs-theme="dark"] {
  --vw-bg: #1B1F26;
  --vw-surface: #232830;
  --vw-surface-2: #2B3139;
  --vw-border: #343B45;
  --vw-border-strong: #465061;
  --vw-text: #EDE9E1;
  --vw-text-muted: #A19C93;
  --vw-accent: #9DB6CD;
  --vw-ink: #E3EAF2;
  --vw-on-ink: #1B1F26;
  --vw-ember: #D9762F;
  --vw-ember-wash: #3A2A1E;
  --vw-ember-ink: #E89152;
  --vw-success: #4FB286;
  --vw-warning: #CE9A2C;
  --vw-warning-ink: #E3BC5C;
  --vw-danger: #E0705C;
  --vw-bar: #11161C;
  --vw-cell-bg: #0A0D11;
  --vw-cell-hdr: rgba(10, 13, 17, .72);
  --vw-field: #1B1F26;
  --vw-chip-ok: #1D3A2E;
  --vw-chip-watch: #3D3418;
  --vw-pick: #2F3B49;
}

/* ---- Dark, device-following when no attribute is set ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme]) {
    --vw-bg: #1B1F26;
    --vw-surface: #232830;
    --vw-surface-2: #2B3139;
    --vw-border: #343B45;
    --vw-border-strong: #465061;
    --vw-text: #EDE9E1;
    --vw-text-muted: #A19C93;
    --vw-accent: #9DB6CD;
    --vw-ink: #E3EAF2;
    --vw-on-ink: #1B1F26;
    --vw-ember: #D9762F;
    --vw-ember-wash: #3A2A1E;
    --vw-ember-ink: #E89152;
    --vw-success: #4FB286;
    --vw-warning: #CE9A2C;
    --vw-warning-ink: #E3BC5C;
    --vw-danger: #E0705C;
    --vw-bar: #11161C;
    --vw-cell-bg: #0A0D11;
    --vw-cell-hdr: rgba(10, 13, 17, .72);
    --vw-field: #1B1F26;
    --vw-chip-ok: #1D3A2E;
    --vw-chip-watch: #3D3418;
    --vw-pick: #2F3B49;
  }
}

/* ---- Theme-independent tokens ---- */
:root {
  --vw-font:    'Public Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --vw-display: Archivo, Helvetica, Arial, sans-serif;
  --vw-mono:    'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --vw-on-bar:       #EDE9E1;   /* text on --vw-bar, same in both themes */
  --vw-on-bar-muted: #B9C3CF;

  --vw-radius:       2px;   /* controls */
  --vw-radius-panel: 4px;   /* cards, sheets, menus; tables stay 0 */

  /* Layout tokens, only for apps with a fixed top navbar and/or a mobile
     bottom tab bar (see ../html-snippets/header.html, bottom-tabbar.html). */
  --vw-navbar-h:      52px;
  --vw-toolbar-h:     44px;
  --vw-bottomtabs-h:   0px;
}

@media (max-width: 767.98px) {
  :root { --vw-bottomtabs-h: 56px; }
}

body {
  background: var(--vw-bg);
  color: var(--vw-text);
  font-family: var(--vw-font);
  font-feature-settings: "tnum";
  margin: 0;
}
h1, h2, h3, h4, h5, .modal-title {
  font-family: var(--vw-display);
  font-weight: 600;
  letter-spacing: 0;
}
time, code, .font-monospace { font-family: var(--vw-mono); }
