/* Oaka Digital - design tokens. Shared by every surface (learner + admin/
 * parent, once views/layout.php links this file too - see this app's own
 * CLAUDE.md "DESIGN SYSTEM" note). Loaded straight after the vendored
 * Bootstrap stylesheet and before any page-family stylesheet (app.css /
 * learner.css), so those files' own rules - and every Bootstrap component
 * that reads a --bs-* custom property - pick these values up automatically
 * without being told to.
 *
 * This file owns exactly two things: the self-hosted Nunito @font-face
 * declarations (no external CDN - CSP is font-src 'self') and the :root
 * custom-property palette (brand, neutrals, shape, shadow, type). It does
 * NOT define page-specific component classes - those belong in learner.css
 * or app.css, next to the markup they style.
 */

/* ---------------------------------------------------------------- font --- */

/* Nunito, self-hosted. Google serves this family as a single variable
 * (wght-axis) woff2 per subset rather than one static file per weight -
 * confirmed by diffing the four weights' generated @font-face rules at
 * fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800: all four
 * point at the exact same "latin" file. Every modern browser renders the
 * correct static instance from a single variable file purely from the
 * font-weight descriptor below (no font-variation-settings needed), so one
 * downloaded file covers all four weights this app uses - see
 * public/assets/fonts/ for the file itself. */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/nunito-latin-variable.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: 'Nunito';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/nunito-latin-variable.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: 'Nunito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/nunito-latin-variable.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: 'Nunito';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/nunito-latin-variable.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;
}

/* --------------------------------------------------------------- tokens --- */

:root {
  /* Brand (Harry, 13 Sep 2026) - this is the single source of truth for
     the palette; app.css and learner.css both read these custom
     properties rather than redefining them (this file is linked first in
     both layouts, immediately before the page-family stylesheet). */
  --oaka-brand: #4a0492;
  --oaka-brand-dark: #29016d;
  --oaka-accent: #95c11e;
  --oaka-brand-rgb: 74, 4, 146;
  --oaka-accent-rgb: 149, 193, 30;

  /* Neutrals - soft lavender page, white surfaces. */
  --oaka-bg: #f5f3fa;
  --oaka-surface: #ffffff;
  --oaka-text: #1f1a2e;
  --oaka-muted: #6b6580;
  --oaka-border: #e6e2f0;
  --oaka-tint: #efe9f8;

  /* Charts (21 Oct 2026, the Business Dashboard, dashboard.css). A single series is brand purple. The four
     categorical slots (phone, tablet, desktop, other) were checked with the dataviz palette validator on white:
     adjacent colour-blind separation 9.1 or more and normal-vision 22.9 or more; aqua and yellow sit below 3:1 on
     white, so every chart using them has a legend and a "Show the Numbers" table. The heat steps are one hue,
     light to dark (white text from step 4). Gridlines are one step off the surface. */
  --oaka-chart-1: #6250d6;
  --oaka-chart-2: #eb6834;
  --oaka-chart-3: #1baf7a;
  --oaka-chart-4: #eda100;
  --oaka-chart-grid: #ece8f4;
  --oaka-chart-axis: #cfc8de;
  --oaka-heat-1: #f3eefb;
  --oaka-heat-2: #e0d2f3;
  --oaka-heat-3: #c2a6e8;
  --oaka-heat-4: #8a5cd0;
  --oaka-heat-5: #4a0492;
  --oaka-delta-good: #2f6b00;
  --oaka-delta-bad: #b42318;

  /* Topic pack stages (24 Oct 2026, the topics list and topic page, pack-status.css): a light fill with dark text,
     each pair at least 7:1. Approve uses the brand tint; Published the green of done. */
  --oaka-stage-stuck-bg: #fde8e7;
  --oaka-stage-stuck-fg: #8f1a12;
  --oaka-stage-booklet-bg: #fff2cf;
  --oaka-stage-booklet-fg: #6b4300;
  --oaka-stage-machine-bg: #e6eefb;
  --oaka-stage-machine-fg: #1c4680;
  --oaka-stage-publish-bg: #ecf5d6;
  --oaka-stage-publish-fg: #355000;
  --oaka-stage-published-bg: #e1f3e8;
  --oaka-stage-published-fg: #1a5e33;
  --oaka-stage-none-bg: #eeecf2;
  --oaka-stage-none-fg: #4f4a5e;

  /* Shape */
  --oaka-radius-surface: 1rem;      /* 16px - cards, panels, trays */
  --oaka-radius-pill: 999px;        /* learner buttons/chips */
  --oaka-radius-admin: .625rem;     /* 10px - admin buttons/inputs */
  --oaka-shadow-soft: 0 8px 24px rgba(41, 1, 109, .08);
  --oaka-shadow-lift: 0 12px 32px rgba(41, 1, 109, .14);

  /* Type */
  --oaka-font-sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;

  /* ---- Bootstrap remaps: every component that reads var(--bs-*) below
     picks up the Oaka palette/type automatically, with no Bootstrap file
     forked (build plan / task brief: "layer on top of it"). */
  --bs-font-sans-serif: var(--oaka-font-sans);
  --bs-body-font-family: var(--oaka-font-sans);
  --bs-body-bg: var(--oaka-bg);
  --bs-body-color: var(--oaka-text);
  --bs-emphasis-color: var(--oaka-text);
  --bs-secondary-color: var(--oaka-muted);
  --bs-border-color: var(--oaka-border);
  --bs-border-color-translucent: var(--oaka-border);
  --bs-tertiary-bg: var(--oaka-tint);
  --bs-secondary-bg: var(--oaka-tint);
}

/* Every surface Bootstrap renders as a .card gets the shared shape/shadow -
   admin and learner alike, once a page links this stylesheet. */
.card {
  --bs-card-bg: var(--oaka-surface);
  --bs-card-border-color: var(--oaka-border);
  --bs-card-border-radius: var(--oaka-radius-surface);
  box-shadow: var(--oaka-shadow-soft);
}

/* ----------------------------------------------------------- typography --- */

body {
  font-family: var(--oaka-font-sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
}
strong, b {
  font-weight: 700;
}

/* Tabular numerals for counts/scores ("3 of 12", "84%") wherever this
   class is used - shared utility, deliberately separate from app.css's
   own .num (admin stat tiles) so neither file depends on the other. */
.oaka-num {
  font-variant-numeric: tabular-nums;
}
