/*
 * Design tokens — the only place for colours, spacing, typography and motion.
 * Primary colour: #99ccff, the light blue background of the previous
 * svgilze-rijen.nl WordPress theme (body.custom-background).
 * Contrast notes (WCAG): text-on-primary #0c2d4f on #99ccff ≈ 8:1;
 * link #1a5a96 on #ffffff ≈ 6.9:1; text #10243a on #f4f9ff ≈ 15:1.
 */
:root {
  /* Brand: #99ccff is the light blue of the previous svgilze-rijen.nl (body.custom-background).
     It is the dominant colour in both themes: header, hero, panel header and every other section band. */
  --color-primary: #99ccff;
  --color-primary-hover: #80bfff;
  --color-primary-ring: #b3d9ff;
  --color-primary-tint: #c4e1ff;
  --color-primary-soft: #e3f1ff;
  --color-primary-strong: #1a5a96;
  --color-primary-deep: #0c2d4f;
  --color-on-primary: #0c2d4f;
  --color-on-primary-muted: #1f3d5c;

  /* Logo accents (green, gold, red), only as small accents */
  --color-accent-green: #00813a;
  --color-accent-gold: #e6c93a;
  --color-accent-red: #c4121a;
  --color-on-accent: #ffffff;

  /* Surfaces and text (light theme) */
  --color-bg: #e3f1ff;
  --color-surface: #ffffff;
  --t-text: #10243a;
  --t-muted: #4a6078;
  --color-border: #c9dcef;
  --t-link: #1a5a96;
  --t-link-hover: #0c2d4f;
  --t-focus: #0b4f9c;
  --color-bg-warning: #fff6d6;
  --color-border-warning: #c9a400;
  --color-bg-danger: #fde8e8;
  --color-border-danger: #d9787d;
  --color-backdrop: rgb(12 45 79 / 60%);

  /* Section bands: A = light blue (#99ccff), B = soft blue (light) / navy (dark) */
  --band-a-bg: var(--color-primary);
  --band-a-rule: var(--color-primary-deep);
  --band-b-bg: var(--color-primary-soft);
  --band-b-rule: var(--color-primary-strong);

  /* Buttons. On light-blue surfaces (.on-primary) buttons are always navy. */
  --t-button-bg: #0c2d4f;
  --t-button-fg: #ffffff;
  --t-button-hover-bg: #1a5a96;
  --t-ghost-fg: #0c2d4f;
  --t-ghost-hover-bg: rgb(12 45 79 / 10%);
  --t-arrow-bg: #0c2d4f;
  --t-arrow-fg: #ffffff;
  --t-arrow-hover-bg: #1a5a96;

  /* Header, hero, panel, footer */
  --color-header-bg: var(--color-primary);
  --color-header-text: var(--color-on-primary);
  --color-nav-active-bg: #0c2d4f;
  --color-nav-active-fg: #ffffff;
  --color-hero-bg: var(--color-primary);
  --color-hero-ring: var(--color-primary-ring);
  /* Faint crest tints: brand green #069146 and rose #e11d48 mixed into the hero blue. */
  --color-hero-crest-wreath: color-mix(in srgb, #069146 24%, var(--color-hero-bg));
  --color-hero-crest-target: color-mix(in srgb, #e11d48 22%, var(--color-hero-bg));
  --color-panel-bar-bg: var(--color-primary);
  --color-close-bg: #0c2d4f;
  --color-close-fg: #ffffff;
  --color-footer-bg: #0c2d4f;
  --color-footer-text: #e3f1ff;
  --color-footer-link: #99ccff;
  --color-footer-rule: rgb(255 255 255 / 16%);
  --brand-bg: #ffffff;

  /* Visuals */
  --color-target-bg: #ffffff;
  --color-media-bg: var(--color-primary-soft);
  --lottie-color-1: #99ccff;
  --lottie-color-2: #1a5a96;
  --lottie-color-3: #0c2d4f;
  --pattern-dot: rgb(26 90 150 / 16%);
  --pattern-dot-gap: 14px;
  --lottie-card-size: 7.5rem;
  --lottie-state-size: 9rem;
  --lottie-loading-size: 4.5rem;
  --theme-color: #99ccff;

  --shadow-card: 0 10px 30px rgb(12 45 79 / 12%);
  --shadow-card-hover: 0 18px 40px rgb(12 45 79 / 18%);
  --shadow-panel: 0 30px 80px rgb(12 45 79 / 35%);

  /* Shape */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-pill: 999px;

  /* Spacing */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.25rem;
  --space-2xl: 3.5rem;
  --space-3xl: 5rem;

  /* Typography (system fonts only, no CDN) */
  --font-sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --step--1: clamp(0.88rem, 0.85rem + 0.15vw, 0.95rem);
  --step-0: clamp(1rem, 0.96rem + 0.25vw, 1.1rem);
  --step-1: clamp(1.18rem, 1.05rem + 0.6vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.2rem + 1.3vw, 2.1rem);
  --step-3: clamp(2rem, 1.4rem + 2.6vw, 3.2rem);
  --line: 1.6;
  --excerpt-lines: 4;

  /* Layout */
  --content-width: 74rem;
  --header-width: 90rem;
  --brand-height: clamp(2.5rem, 7vw, 3.25rem);
  --brand-name-size: clamp(1.05rem, 2.2vw, 1.35rem);
  --brand-bg: transparent;
  --narrow-width: 48rem;
  --header-height: 4.25rem;
  --header-h: var(--header-height);
  --card-width: clamp(15.5rem, 78vw, 20rem);
  --card-media-height: 10rem;
  --row-gap: 1.25rem;
  --arrow-size: 2.75rem;
  --panel-width: 54rem;

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --duration-fast: 180ms;
  --duration-base: 420ms;
  --duration-slow: 650ms;
  --reveal-distance: 28px;
  --stagger: 70ms;
  --duration-pulse: 2.8s;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 1ms;
    --duration-base: 1ms;
    --duration-slow: 1ms;
    --reveal-distance: 0px;
    --stagger: 0ms;
    --duration-pulse: 1ms;
  }
}

/* Dark theme. Follows the OS unless the visitor picks Light or Dark in the header
   (stored as data-theme on <html>). Both selectors carry the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0b1a2b;
    --color-surface: #12304f;
    --t-text: #eef6ff;
    --t-muted: #bfd3e8;
    --color-border: #2b5680;
    --t-link: #99ccff;
    --t-link-hover: #c4e1ff;
    --t-focus: #ffd75e;
    --color-bg-warning: #3a3315;
    --color-border-warning: #c9a400;
    --color-bg-danger: #3a1d22;
    --color-border-danger: #d9787d;
    --color-backdrop: rgb(3 10 18 / 70%);
    /* Band B becomes deep navy; band A stays light blue so #99ccff remains a large surface. */
    --band-b-bg: #0b1a2b;
    --band-b-rule: #99ccff;
    --t-button-bg: #99ccff;
    --t-button-fg: #0c2d4f;
    --t-button-hover-bg: #c4e1ff;
    --t-ghost-fg: #99ccff;
    --t-ghost-hover-bg: rgb(153 204 255 / 14%);
    --t-arrow-bg: #99ccff;
    --t-arrow-fg: #0c2d4f;
    --t-arrow-hover-bg: #c4e1ff;
    --color-media-bg: #0f2740;
    --lottie-color-2: #c4e1ff;
    --lottie-color-3: #eef6ff;
    --pattern-dot: rgb(153 204 255 / 16%);
    --color-footer-bg: #07111d;
    --theme-color: #99ccff;
    --color-hero-crest-wreath: color-mix(in srgb, #069146 26%, var(--color-hero-bg));
    --color-hero-crest-target: color-mix(in srgb, #e11d48 24%, var(--color-hero-bg));
    --shadow-card: 0 10px 30px rgb(0 0 0 / 35%);
    --shadow-card-hover: 0 18px 40px rgb(0 0 0 / 45%);
    --shadow-panel: 0 30px 80px rgb(0 0 0 / 55%);
  }
}
:root[data-theme="dark"] {
  --color-bg: #0b1a2b;
  --color-surface: #12304f;
  --t-text: #eef6ff;
  --t-muted: #bfd3e8;
  --color-border: #2b5680;
  --t-link: #99ccff;
  --t-link-hover: #c4e1ff;
  --t-focus: #ffd75e;
  --color-bg-warning: #3a3315;
  --color-border-warning: #c9a400;
  --color-bg-danger: #3a1d22;
  --color-border-danger: #d9787d;
  --color-backdrop: rgb(3 10 18 / 70%);
  /* Band B becomes deep navy; band A stays light blue so #99ccff remains a large surface. */
  --band-b-bg: #0b1a2b;
  --band-b-rule: #99ccff;
  --t-button-bg: #99ccff;
  --t-button-fg: #0c2d4f;
  --t-button-hover-bg: #c4e1ff;
  --t-ghost-fg: #99ccff;
  --t-ghost-hover-bg: rgb(153 204 255 / 14%);
  --t-arrow-bg: #99ccff;
  --t-arrow-fg: #0c2d4f;
  --t-arrow-hover-bg: #c4e1ff;
  --color-media-bg: #0f2740;
  --lottie-color-2: #c4e1ff;
  --lottie-color-3: #eef6ff;
  --pattern-dot: rgb(153 204 255 / 16%);
  --color-footer-bg: #07111d;
  --theme-color: #99ccff;
  --color-hero-crest-wreath: color-mix(in srgb, #069146 26%, var(--color-hero-bg));
  --color-hero-crest-target: color-mix(in srgb, #e11d48 24%, var(--color-hero-bg));
  --shadow-card: 0 10px 30px rgb(0 0 0 / 35%);
  --shadow-card-hover: 0 18px 40px rgb(0 0 0 / 45%);
  --shadow-panel: 0 30px 80px rgb(0 0 0 / 55%);
}

/* Resolve the theme values. Cards, banners and the article panel reset to them,
   so they stay readable inside light-blue (.on-primary) areas in both themes. */
:root, .card, .banner, .reader-body, .stat-list li, .announcement {
  --color-text: var(--t-text);
  --color-text-muted: var(--t-muted);
  --color-link: var(--t-link);
  --color-link-hover: var(--t-link-hover);
  --color-focus: var(--t-focus);
  --button-bg: var(--t-button-bg);
  --button-fg: var(--t-button-fg);
  --button-hover-bg: var(--t-button-hover-bg);
  --button-ghost-fg: var(--t-ghost-fg);
  --button-ghost-hover-bg: var(--t-ghost-hover-bg);
  --arrow-bg: var(--t-arrow-bg);
  --arrow-fg: var(--t-arrow-fg);
  --arrow-hover-bg: var(--t-arrow-hover-bg);
}
.card, .banner, .reader-body, .stat-list li, .announcement { color: var(--color-text); }

/* Light-blue surfaces keep light-theme ink and navy buttons in both themes. */
.on-primary {
  --color-text: #0c2d4f;
  --color-text-muted: #1f3d5c;
  --color-link: #0c2d4f;
  --color-link-hover: #000000;
  --color-focus: #0c2d4f;
  --button-bg: #0c2d4f;
  --button-fg: #ffffff;
  --button-hover-bg: #1a5a96;
  --button-ghost-fg: #0c2d4f;
  --button-ghost-hover-bg: rgb(12 45 79 / 10%);
  --arrow-bg: #0c2d4f;
  --arrow-fg: #ffffff;
  --arrow-hover-bg: #1a5a96;
  color: var(--color-text);
}
