/* ==========================================================================
   Design tokens — the ONE place colors, type, and spacing are defined.
   Change a value here and it changes everywhere.

   BRAND COLORS — PROVISIONAL
   Taken from the old Joomla site's theme (purple #7f3f98, amber #cc8614,
   charcoal #312f38 / #424753). The logo itself is a brighter violet (≈ #9200d2).
   Official codes are still to be confirmed by the society (CLAUDE.md §11).

   Contrast notes (WCAG AA needs 4.5:1 for text):
   - purple #7f3f98 on white = 6.9:1 ✓
   - amber #cc8614 with white text = 3.0:1 ✗ → amber buttons use dark text (5.8:1 ✓)
   ========================================================================== */

:root {
  /* --- Brand palette (provisional, from the old site) ------------------ */
  --brand-primary: #7f3f98;        /* WRS purple */
  --brand-primary-light: #cfa8e0;  /* purple, lightened for dark mode */
  --brand-accent: #cc8614;         /* amber */
  --brand-accent-light: #e3a646;   /* amber, lightened for dark mode */
  --brand-charcoal: #312f38;       /* dark bands and footer */
  --brand-slate: #424753;          /* body text */

  /* --- Neutrals --------------------------------------------------------- */
  --neutral-0: #ffffff;
  --neutral-50: #f4f5f7;   /* cool grey (old site "intro" band) */
  --neutral-100: #eceeef;
  --neutral-300: #c9c3b8;
  --neutral-600: #5f5a52;
  --neutral-800: #2b2925;
  --neutral-900: #1a1917;
  --neutral-950: #111110;

  /* --- Semantic colors: LIGHT (default) -------------------------------- */
  /* Templates and base.css use ONLY these, never the palette above. */
  --color-bg: var(--neutral-0);
  --color-bg-alt: var(--neutral-50);        /* alternating light band */
  --color-bg-inverse: var(--brand-charcoal); /* dark band */
  --color-text: var(--brand-slate);
  --color-text-muted: var(--neutral-600);
  --color-text-inverse: var(--neutral-0);
  --color-heading: var(--brand-primary);
  --color-link: var(--brand-primary);
  --color-link-hover: var(--brand-charcoal);
  --color-border: var(--neutral-300);
  --color-focus: var(--brand-accent);
  --color-button-bg: var(--brand-primary);
  --color-button-text: var(--neutral-0);
  --color-cta-bg: var(--brand-accent);
  --color-cta-text: var(--neutral-900);
  --color-header-bg: var(--neutral-0);
  --color-notice-bg: #fff6dd;
  --color-notice-border: #d9b44a;

  /* --- Type ------------------------------------------------------------- */
  /* System font stacks: no downloads, no Google Fonts.
     Can be swapped for self-hosted fonts later (CLAUDE.md §6). */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Fluid type scale: grows smoothly from phone to desktop. */
  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.94rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-1: clamp(1.2rem, 1.13rem + 0.35vw, 1.4rem);
  --step-2: clamp(1.44rem, 1.32rem + 0.6vw, 1.75rem);
  --step-3: clamp(1.73rem, 1.53rem + 1vw, 2.2rem);
  --step-4: clamp(2.07rem, 1.75rem + 1.6vw, 2.8rem);

  --leading-tight: 1.2;
  --leading-normal: 1.6;
  --measure: 68ch;  /* comfortable line length for prose */

  /* --- Spacing ---------------------------------------------------------- */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2rem;
  --space-xl: 3rem;
  --space-2xl: clamp(3rem, 2rem + 4vw, 5rem);   /* vertical padding of bands */

  /* --- Layout & shape --------------------------------------------------- */
  --container-max: 72rem;
  --gutter: var(--space-s);   /* side padding on phones (16px) */
  --radius: 0.375rem;
  --shadow: 0 1px 3px rgb(0 0 0 / 0.12), 0 4px 12px rgb(0 0 0 / 0.06);

  /* --- Motion ----------------------------------------------------------- */
  --duration: 180ms;
}

@media (min-width: 40em) {
  :root { --gutter: var(--space-l); }
}

/* --- Semantic colors: DARK (follows the visitor's system setting) ------- */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: var(--neutral-950);
    --color-bg-alt: var(--neutral-900);
    --color-bg-inverse: #1f1d24;            /* charcoal, darkened */
    --color-text: var(--neutral-100);
    --color-text-muted: var(--neutral-300);
    --color-text-inverse: var(--neutral-100);
    --color-heading: var(--brand-primary-light);
    --color-link: var(--brand-primary-light);
    --color-link-hover: var(--brand-accent-light);
    --color-border: var(--neutral-800);
    --color-focus: var(--brand-accent-light);
    --color-button-bg: var(--brand-primary-light);
    --color-button-text: var(--neutral-950);
    --color-cta-bg: var(--brand-accent-light);
    --color-cta-text: var(--neutral-950);
    --color-header-bg: var(--neutral-950);
    --color-notice-bg: #2e2810;
    --color-notice-border: #8a7330;
    --shadow: 0 1px 3px rgb(0 0 0 / 0.5);
  }
}
