/* HES International theme override for Twenty (v2.9.4).
 *
 * Loaded AFTER the app bundle via a <link> injected into index.html by
 * infra/scripts/apply-hes-theme.sh, and mounted into the server container by
 * docker-compose. Twenty's whole theme is CSS custom properties scoped on
 * html.light / html.dark, so we only redefine tokens — no selectors into
 * hashed emotion classes, which keeps this survivable across app upgrades
 * (re-run the apply script after bumping the image tag).
 *
 * NOTE: Twenty has TWO blue systems. Components actually resolve the fixed
 * palette (--t-color-blue + --t-color-blue1..12); the --t-accent-* aliases are
 * a newer layer that mirrors it. We override BOTH (verified empirically: the
 * focus ring uses --t-color-blue).
 *
 * OFFICIAL HES brand palette (brand guidelines):
 *   PRIMARY   #0078BF (PMS 3005) — communication colour: text emphasis, links, buttons.
 *   LOGO ONLY #006A9B (PMS 3015) — reserved for the logo; never in the UI.
 *   Secondary: cyan #00ABE9 · navy #01426A · green #009070 · teal #00A490 · blue-grey #445B6D
 *              (green is primary for energy-transition topics).
 *   Background warm grey #DEDCDB · accent red #E51935 (small accents only).
 *   Typography Aptos, headings in CAPITALS, no italics.
 *   Chart-only 9-colour palette (NOT for UI): #1B5E3F dark green, #6DBE45 light green,
 *   #3F3D8C indigo, #7A4B9C purple, #7B2233 bordeaux, #C0219E magenta, #E8792B orange,
 *   #F2C230 yellow, #3A3F45 anthracite.
 */

/* ── Typeface: Aptos (HES brand font, installed via Microsoft 365), Source Sans
 * as a web fallback (loaded in index.html). "No italics" is a brand rule.
 * v2.20 regression: some components hardcode "Inter" instead of reading the
 * token, so we enforce the token everywhere except monospace contexts. */
html.light, html.dark {
  --t-font-family: 'Aptos', 'Aptos Display', 'Source Sans 3', 'Source Sans Pro', Inter, sans-serif;
}
html.light *:not(code):not(pre):not(kbd):not(samp),
html.dark  *:not(code):not(pre):not(kbd):not(samp) {
  font-family: var(--t-font-family) !important;
  font-style: normal !important;
}

/* ── Bigger type: +12.5% on every text token (all rem-based) ─────────────── */
html.light, html.dark {
  --t-font-size-xxs: 0.70rem;   /* was .625 */
  --t-font-size-xs:  0.96rem;   /* was .85  */
  --t-font-size-sm:  1.04rem;   /* was .92  */
  --t-font-size-md:  1.125rem;  /* was 1    */
  --t-font-size-lg:  1.38rem;   /* was 1.23 */
  --t-font-size-xl:  1.73rem;   /* was 1.54 */
  --t-font-size-xxl: 2.08rem;   /* was 1.85 */
}

/* ── HES blue #0078BF: 12-step scale (Radix-style), light theme ──────────── */
html.light {
  --t-color-blue:   #0078bf;
  --t-color-blue1:  #fafdff;
  --t-color-blue2:  #f2f9fd;
  --t-color-blue3:  #e4f2fa;
  --t-color-blue4:  #d3eaf7;
  --t-color-blue5:  #bfdff2;
  --t-color-blue6:  #a6d2ec;
  --t-color-blue7:  #83bfe2;
  --t-color-blue8:  #4fa4d4;
  --t-color-blue9:  #0078bf;
  --t-color-blue10: #006cab;
  --t-color-blue11: #00679e;
  --t-color-blue12: #0c3a55;

  /* newer accent alias layer — mirror the stock mapping:
     primary/secondary=5, tertiary=3, quaternary=2, 3570/4060=8 */
  --t-accent-accent1:  #fafdff;
  --t-accent-accent2:  #f2f9fd;
  --t-accent-accent3:  #e4f2fa;
  --t-accent-accent4:  #d3eaf7;
  --t-accent-accent5:  #bfdff2;
  --t-accent-accent6:  #a6d2ec;
  --t-accent-accent7:  #83bfe2;
  --t-accent-accent8:  #4fa4d4;
  --t-accent-accent9:  #0078bf;
  --t-accent-accent10: #006cab;
  --t-accent-accent11: #00679e;
  --t-accent-accent12: #0c3a55;
  --t-accent-primary:    #bfdff2;
  --t-accent-secondary:  #bfdff2;
  --t-accent-tertiary:   #e4f2fa;
  --t-accent-quaternary: #f2f9fd;
  --t-accent-accent3570: #4fa4d4;
  --t-accent-accent4060: #4fa4d4;

  /* brand warm CREAM canvas — ported from the approved brand mockup (2026-07-11);
     contrast now lives in the warmed-but-strong borders + navy, not a grey fill */
  --t-background-tertiary: #faf9f5;
}

/* ── Contrast pass (2026-07-11, "people find the app pale") ──────────────────
 * Stock Twenty light theme: secondary text 40% grey, tertiary 60%, borders at
 * 92–95% white. Ported from the approved brand mockup: near-black ink scale for
 * text, warm visible borders (match the warm canvas), slightly stronger hover
 * fills. Light theme only — dark theme keeps stock contrast. */
html.light {
  /* text: ink scale (stock: #333/#666/#999/#b3/#ccc) */
  --t-font-color-primary:     #20252a;
  --t-font-color-secondary:   #44484c;
  --t-font-color-tertiary:    #5f6367;
  --t-font-color-light:       #7a7e82;
  --t-font-color-extra-light: #9a9ea2;
  /* borders: warm cream-family, visible against the cream canvas (mockup values) */
  --t-border-color-strong: #b9b2a5;
  --t-border-color-medium: #d6d0c6;
  --t-border-color-light:  #e4e0d7;
  /* surfaces: crisp near-white cards on the cream canvas */
  --t-background-secondary:  #fdfcfa;
  --t-background-quaternary: #ded9d0;
  /* hover/selected fills: a notch stronger so state reads at a glance */
  --t-background-transparent-lighter: rgba(32, 37, 42, 0.03);
  --t-background-transparent-light:   rgba(32, 37, 42, 0.06);
  --t-background-transparent-medium:  rgba(32, 37, 42, 0.11);
}

/* ── Dark theme equivalents ──────────────────────────────────────────────── */
html.dark {
  --t-color-blue:   #0078bf;
  --t-color-blue1:  #0d1520;
  --t-color-blue2:  #0f1b28;
  --t-color-blue3:  #102a41;
  --t-color-blue4:  #103656;
  --t-color-blue5:  #124267;
  --t-color-blue6:  #15507a;
  --t-color-blue7:  #1a6191;
  --t-color-blue8:  #1f78b1;
  --t-color-blue9:  #0078bf;
  --t-color-blue10: #3390cc;
  --t-color-blue11: #66b5e3;
  --t-color-blue12: #cfe7f7;

  --t-accent-accent1:  #0d1520;
  --t-accent-accent2:  #0f1b28;
  --t-accent-accent3:  #102a41;
  --t-accent-accent4:  #103656;
  --t-accent-accent5:  #124267;
  --t-accent-accent6:  #15507a;
  --t-accent-accent7:  #1a6191;
  --t-accent-accent8:  #1f78b1;
  --t-accent-accent9:  #0078bf;
  --t-accent-accent10: #3390cc;
  --t-accent-accent11: #66b5e3;
  --t-accent-accent12: #cfe7f7;
  --t-accent-primary:    #124267;
  --t-accent-secondary:  #124267;
  --t-accent-tertiary:   #102a41;
  --t-accent-quaternary: #0f1b28;
  --t-accent-accent3570: #1f78b1;
  --t-accent-accent4060: #1f78b1;
}
