/*
 * Theme — the platform's colour tokens and the Franken UI (shadcn) variable
 * overrides, light and dark.
 *
 * The defaults below are the built-in palette. The brand colour is the
 * owner's choice (/admin/settings): platform.BrandCSS sets --brand,
 * --brand-hover, --brand-focus and --brand-rgb (and Franken's --primary and
 * --ring) to it in a style block after this file, so everything written
 * against them follows.
 *
 * --brand    the brand colour (default #ec602b)
 * --ink      near-black: text, the sidebar
 * --paper    the page background
 * --blue     the secondary accent
 * --neutral  greys: --neutral, --neutral-light, --neutral-border
 */

/* ── Display face ──────────────────────────────────────────
   Bricolage Grotesque (SIL Open Font License), served from /static/fonts
   rather than Google Fonts so no page calls out to a third party. Only for
   big display type: the dashboard's greeting, its poster and big numbers
   (--font-display); everything else keeps the system face. */
@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-latin.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: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("/static/fonts/bricolage-grotesque-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Brand tokens ─────────────────────────────────────────── */
:root {
  --ink: #131313;
  --paper: #f0ede8;
  --brand: #ec602b;
  --brand-hover: #d4521f;
  --brand-focus: rgba(236, 96, 43, 0.25);
  /* The brand colour as r, g, b — for rgba(var(--brand-rgb), alpha) in
     style.css, so a brand colour set on the platform settings page reaches
     the tints too. */
  --brand-rgb: 236, 96, 43;
  --blue: #1d4bd5;
  --blue-hover: #1740b8;
  --neutral: #5c5c5c;
  --neutral-light: #979797;
  --neutral-border: #e4e2de;
  --font-display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ── Light mode (Franken UI / shadcn variables) ───────────── */
:root {
  --background: 30 16% 93%;       /* #f0ede8 */
  --foreground: 0 0% 7%;          /* #131313 */
  --card: 0 0% 100%;              /* #fff */
  --card-foreground: 0 0% 7%;
  --popover: 0 0% 100%;
  --popover-foreground: 0 0% 7%;
  --primary: 14 84% 55%;          /* #ec602b */
  --primary-foreground: 0 0% 100%;
  --secondary: 227 74% 47%;       /* #1d4bd5 */
  --secondary-foreground: 0 0% 100%;
  --muted: 30 12% 92%;
  --muted-foreground: 0 0% 36%;   /* #5c5c5c */
  --accent: 30 12% 92%;
  --accent-foreground: 0 0% 7%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 30 10% 89%;           /* #e4e2de */
  --input: 30 10% 89%;
  --ring: 14 84% 55%;             /* the brand colour */
  --radius: 0.5rem;
}

/* ── Explicit body/form overrides (ensure the theme's colours win) ─ */
body {
  background-color: var(--paper);
  color: var(--ink);
}

input, textarea, select {
  background-color: #fff;
  border-color: var(--neutral-border);
}

input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  outline-color: var(--brand);
}

/* ── Dark mode ────────────────────────────────────────────── */
.dark,
[data-theme="dark"] {
  --background: 0 0% 7%;          /* #131313 */
  --foreground: 30 16% 93%;       /* #f0ede8 */
  --card: 0 0% 12%;               /* #1e1e1e */
  --card-foreground: 30 16% 93%;
  --popover: 0 0% 12%;
  --popover-foreground: 30 16% 93%;
  --primary: 14 84% 55%;
  --primary-foreground: 0 0% 100%;
  --secondary: 227 70% 63%;       /* lighter blue for dark bg */
  --secondary-foreground: 0 0% 100%;
  --muted: 0 0% 15%;
  --muted-foreground: 0 0% 59%;   /* #979797 */
  --accent: 0 0% 15%;
  --accent-foreground: 30 16% 93%;
  --destructive: 0 63% 31%;
  --destructive-foreground: 0 0% 100%;
  --border: 0 0% 26%;             /* #434343 */
  --input: 0 0% 26%;
  --ring: 14 84% 55%;
}

.dark body,
[data-theme="dark"] body,
.dark,
[data-theme="dark"] {
  background-color: var(--ink);
  color: var(--paper);
}

.dark input, .dark textarea, .dark select,
[data-theme="dark"] input, [data-theme="dark"] textarea, [data-theme="dark"] select {
  background-color: #1e1e1e;
  border-color: #434343;
}

