/* ==========================================================================================================
   Themes. The layout is identical everywhere; a theme only overrides design tokens (colours, header look) and
   points the decoration tokens at SVG files in assets/deco/ (purely visual, same-origin, no external images).

     <html>                      neutral look (before a student chose a theme, staff, login before the first choice)
     <html data-theme="lanyos">  "Lányos": pastel pink / purple / mint, flowers, hearts, unicorns, rainbows
     <html data-theme="fiusos">  "Fiús":   blue / green / orange, planets, rockets, cars and balls

   Token groups that themes set (see docs/frontend.md for the full table):
     surfaces and text   --bg --bg-2 --surface --surface-2 --surface-3 --text --text-muted --border --border-strong
     brand               --primary(-dark|-soft) --on-primary  --accent(-dark|-soft) --on-accent  --success --danger --warning ...
     block categories    --blk-move --blk-loop --blk-cond --blk-proc (+ -dark, -soft)
     shell               --header-bg --header-fg --header-fg-muted --header-active-bg --header-active-fg --header-border
     decorations         --deco-pattern (page background tile) --deco-header (banner at the right end of the top bar)
                         --deco-hero (wide scene for hero panels / theme preview cards) --deco-opacity
                         --theme-icon --theme-icon-2 --theme-icon-3 (emoji strings for `content:`)
   Text colour pairs are verified (WCAG AA 4.5:1, 3:1 for large text and focus rings) by test/e2e/core-contrast.mjs.
   ========================================================================================================== */

:root {
  color-scheme: light;
  --header-bg: var(--surface);
  --header-fg: var(--text);
  --header-fg-muted: var(--text-muted);
  --header-border: var(--border);
  --header-active-bg: var(--primary);
  --header-active-fg: var(--on-primary);
  --header-hover-bg: var(--surface-2);
  --deco-hero: none;
  --theme-icon: "🤖";
  --theme-icon-2: "⭐";
  --theme-icon-3: "🧩";
  --hero-bg: linear-gradient(135deg, var(--primary-soft), var(--accent-soft));
  --hero-fg: var(--text);
}

/* ------------------------------------------------------------------------------------------ Lányos */
html[data-theme="lanyos"] {
  --bg: #fff2fa;
  --bg-2: #ffe1f2;
  --surface: #ffffff;
  --surface-2: #fdebf6;
  --surface-3: #f8dbed;
  --text: #3a1c4b;
  --text-muted: #6a4a7c;
  --text-inverse: #ffffff;
  --border: #f2cde4;
  --border-strong: #d9a6c8;

  --primary: #a8329a;
  --primary-dark: #781f6e;
  --primary-soft: #fbd8f0;
  --on-primary: #ffffff;

  --accent: #3bcfa6;
  --accent-dark: #17886a;
  --accent-soft: #d3f7ea;
  --on-accent: #06382b;

  --success: #17804a;
  --success-dark: #0f5c34;
  --success-soft: #d8f6e5;
  --danger: #c3294f;
  --danger-dark: #8d1a38;
  --danger-soft: #fde0e8;
  --warning-soft: #fff1c9;
  --info-soft: #ece3ff;
  --focus: #6527d6;
  --header-focus: #6527d6;

  --blk-move: #c4409d;      --blk-move-dark: #8c226e;     --blk-move-soft: #fbdaf0;
  --blk-loop: #f59f0b;      --blk-loop-dark: #b36d00;     --blk-loop-soft: #ffeccb;
  --blk-cond: #7a4de0;      --blk-cond-dark: #4f2fa8;     --blk-cond-soft: #e9deff;
  --blk-proc: #0a8660;      --blk-proc-dark: #066245;     --blk-proc-soft: #d3f5e7;

  --sh-1: 0 1px 2px rgba(120, 31, 110, 0.12), 0 1px 1px rgba(120, 31, 110, 0.06);
  --sh-2: 0 4px 10px rgba(120, 31, 110, 0.14), 0 1px 3px rgba(120, 31, 110, 0.08);
  --sh-3: 0 14px 34px rgba(120, 31, 110, 0.24), 0 3px 8px rgba(120, 31, 110, 0.12);

  --header-bg: linear-gradient(100deg, #ffd0ea 0%, #f1d3ff 55%, #dcd3ff 100%);
  --header-fg: #3a1c4b;
  --header-fg-muted: #5d3a70;
  --header-border: #ecb9da;
  --header-active-bg: #a8329a;
  --header-active-fg: #ffffff;
  --header-hover-bg: rgba(255, 255, 255, 0.55);

  --deco-pattern: url("../assets/deco/pattern-lanyos.svg");
  --deco-header: url("../assets/deco/header-lanyos.svg");
  --deco-hero: url("../assets/deco/hero-lanyos.svg");
  --deco-opacity: 0.6;
  --theme-icon: "🦄";
  --theme-icon-2: "🌸";
  --theme-icon-3: "💖";
  --hero-bg: linear-gradient(180deg, #ffd6ec, #e5dcff);
  --hero-fg: #3a1c4b;
}

/* ------------------------------------------------------------------------------------------ Fiús */
html[data-theme="fiusos"] {
  --bg: #eaf3ff;
  --bg-2: #d8e8ff;
  --surface: #ffffff;
  --surface-2: #e4eeff;
  --surface-3: #d1e1fb;
  --text: #0f2547;
  --text-muted: #40567c;
  --text-inverse: #ffffff;
  --border: #c2d7f4;
  --border-strong: #98b6e2;

  --primary: #1458d6;
  --primary-dark: #0c3a94;
  --primary-soft: #d2e3ff;
  --on-primary: #ffffff;

  --accent: #ff8a1f;
  --accent-dark: #b65a00;
  --accent-soft: #ffe2c0;
  --on-accent: #2a1300;

  --success: #13863f;
  --success-dark: #0c5e2b;
  --success-soft: #d3f4df;
  --danger: #c4263b;
  --danger-dark: #8f1a2a;
  --danger-soft: #fde1e5;
  --warning-soft: #fff0c2;
  --info-soft: #dbeeff;
  --focus: #c24e00;

  --blk-move: #2563eb;      --blk-move-dark: #1a45a8;     --blk-move-soft: #d9e8ff;
  --blk-loop: #f59f0b;      --blk-loop-dark: #b36d00;     --blk-loop-soft: #ffeccb;
  --blk-cond: #7c3aed;      --blk-cond-dark: #5521b5;     --blk-cond-soft: #ebe2ff;
  --blk-proc: #0a8660;      --blk-proc-dark: #066245;     --blk-proc-soft: #d3f5e7;

  --sh-1: 0 1px 2px rgba(12, 58, 148, 0.14), 0 1px 1px rgba(12, 58, 148, 0.06);
  --sh-2: 0 4px 10px rgba(12, 58, 148, 0.16), 0 1px 3px rgba(12, 58, 148, 0.08);
  --sh-3: 0 14px 34px rgba(12, 40, 110, 0.28), 0 3px 8px rgba(12, 40, 110, 0.14);

  --header-bg: linear-gradient(100deg, #0d2a68 0%, #1747b3 60%, #1f61dc 100%);
  --header-fg: #ffffff;
  --header-fg-muted: #eaf1ff;
  --header-focus: #ffffff;
  --header-border: #0a2150;
  --header-active-bg: #ff8a1f;
  --header-active-fg: #2a1300;
  --header-hover-bg: rgba(255, 255, 255, 0.16);

  --deco-pattern: url("../assets/deco/pattern-fiusos.svg");
  --deco-header: url("../assets/deco/header-fiusos.svg");
  --deco-hero: url("../assets/deco/hero-fiusos.svg");
  --deco-opacity: 0.6;
  --theme-icon: "🚀";
  --theme-icon-2: "⚽";
  --theme-icon-3: "🚗";
  --hero-bg: linear-gradient(180deg, #0b2a6b, #2f6fe0);
  --hero-fg: #ffffff;
}

/* ------------------------------------------------------------------------------------------ theme hero panel
   <section class="theme-hero"> ... </section>  A wide panel with the theme scene at the bottom (map header, onboarding
   preview cards). Text inside uses --hero-fg. The scene is decoration only (aria-hidden by nature: it is a background). */
.theme-hero {
  position: relative; overflow: hidden; isolation: isolate;
  color: var(--hero-fg);
  background: var(--hero-bg);
  border-radius: var(--r-xl);
  border: 3px solid var(--surface);
  box-shadow: var(--sh-2);
}
.theme-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--deco-hero) center bottom / cover no-repeat;
}

/* a small emoji of the current theme: <span class="theme-icon" aria-hidden="true"></span>  (:nth variants -2 / -3) */
.theme-icon::before { content: var(--theme-icon); }
.theme-icon-2::before { content: var(--theme-icon-2); }
.theme-icon-3::before { content: var(--theme-icon-3); }

/* previews of a theme that is NOT active (the onboarding choice cards): <div class="theme-preview" data-preview="lanyos"> */
.theme-preview { position: relative; overflow: hidden; border-radius: var(--r-lg); background-size: cover; background-position: center bottom; background-repeat: no-repeat; }
.theme-preview[data-preview="lanyos"] { background-image: url("../assets/deco/hero-lanyos.svg"); background-color: #ffd6ec; }
.theme-preview[data-preview="fiusos"] { background-image: url("../assets/deco/hero-fiusos.svg"); background-color: #1747b3; }

@media print {
  html[data-theme] { --deco-pattern: none; --deco-header: none; --deco-hero: none; }
}
