/* ═══════════════════════════════════════════════════════════════════════════
   CMS DESIGN TOKENS  ·  v2.0
   Layer 1 — primitives (raw palette, never used directly in components)
   Layer 2 — semantic tokens (what components use)
   See docs/DESIGN.md for the reasoning behind every value.
   Rules: flat colour only (no gradients, no glow) · Lato everywhere ·
   the CMS carries the project's name, never a product name of its own ·
   light only (no dark mode).
   ═══════════════════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;0,900;1,400&display=swap');

:root {
  /* ── Primitives · Navy (primary) ────────────────────────── */
  --navy-50: #F0F0FB; --navy-100: #E2E2F7; --navy-200: #C5C5EF; --navy-300: #9C9CFF; --navy-400: #5C5CD6;
  --navy-500: #2525B0; --navy-600: #000094; --navy-700: #000078; --navy-800: #00005C; --navy-900: #0B0B3A;
  /* ── Primitives · Paper (warm neutrals) ─────────────────── */
  --sand-0: #FFFFFF; --sand-25: #FFFDFA; --sand-50: #FCF9F4; --sand-75: #F9F4EB; --sand-100: #F3EDE2; --sand-150: #ECE4D7;
  --sand-200: #E2D9CB; --sand-300: #CFC5B6; --sand-400: #A89E94; --sand-500: #7A7068; --sand-600: #5F5650;
  --sand-700: #433C37; --sand-800: #2B2522; --sand-850: #231E1B; --sand-900: #1C1816; --sand-950: #141110;
  /* ── Primitives · Supporting hues (status + member identity) ── */
  --ember-50: #FFF4EE; --ember-300: #FFA27B; --ember-500: #FF5B1F; --ember-700: #C1380A;
  --violet-50: #F4F1FF; --violet-100: #E9E3FF; --violet-300: #B9A8FF; --violet-500: #7B5CFF; --violet-600: #6842F5; --violet-700: #5531D6;
  --rose-500: #E5487F;
  --green-50: #E9F9EF; --green-100: #CDF2DB; --green-500: #12A150; --green-600: #0E8A44; --green-700: #0B6E37;
  --amber-50: #FFF7E6; --amber-100: #FFEABF; --amber-500: #F5A524; --amber-600: #C27C0E; --amber-700: #8F5A06;
  --red-50: #FFEEEF; --red-100: #FFD6D8; --red-500: #E5484D; --red-600: #CE2C31; --red-700: #A11D22;
  --blue-50: #EDF4FF; --blue-100: #D6E6FF; --blue-500: #3B82F6; --blue-600: #2563EB; --blue-700: #1D4FC4;
  --teal-50: #E8FAF7; --teal-100: #C7F2EA; --teal-500: #14B8A6; --teal-700: #0E7C70;

  /* ── Typography ─────────────────────────────────────────── */
  /* Lato is the only CMS typeface. Display = Lato Black; UI = Lato Regular/Bold. */
  --font-display: 'Lato', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-ui: 'Lato', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  /* Small text (≤13px) gets a hairline stroke so Regular reads a touch heavier — Lato has no 500/600. */
  --small-stroke: .25px;
  --text-2xs: 11px; --text-xs: 12px; --text-sm: 13px; --text-md: 14px; --text-base: 15px;
  --text-lg: 17px; --text-xl: 20px; --text-2xl: 24px; --text-3xl: 30px; --text-4xl: 40px; --text-5xl: 52px;
  --leading-tight: 1.15; --leading-snug: 1.35; --leading-normal: 1.5;
  /* Lato ships 400 / 700 / 900 — there is no 500 or 600, so the scale snaps to real weights. */
  --weight-regular: 400; --weight-medium: 400; --weight-semibold: 700; --weight-bold: 700; --weight-black: 900;

  /* ── Spacing (4px grid) ─────────────────────────────────── */
  --space-0: 0; --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px; --space-20: 80px;

  /* ── Radius ─────────────────────────────────────────────── */
  --radius-xs: 6px; --radius-sm: 8px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 20px; --radius-2xl: 28px; --radius-full: 999px;

  /* ── Motion ─────────────────────────────────────────────── */
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --duration-fast: 120ms; --duration-base: 200ms; --duration-slow: 320ms;

  /* ── Layout ─────────────────────────────────────────────── */
  --sidebar-w: 248px; --subnav-w: 232px; --topbar-h: 60px; --content-max: 1200px;
  --z-dropdown: 50; --z-sticky: 40; --z-drawer: 70; --z-modal: 80; --z-toast: 90; --z-tooltip: 100;

  /* ═════════ Semantic tokens · Light ═════════ */
  color-scheme: light;
  --bg: var(--sand-25);                 /* #FFFDFA — main page body */
  --bg-subtle: var(--sand-75);          /* #F9F4EB — sunken areas, table heads, footers */
  --nav-bg: var(--sand-75);             /* #F9F4EB — side navigation body */
  --nav-hover: var(--sand-100);
  --nav-active: var(--sand-150);        /* active item = a darker box, no shadow, no border */
  --surface: var(--sand-0);
  --surface-raised: var(--sand-0);
  --surface-sunken: var(--sand-75);
  --surface-hover: var(--sand-50);
  --surface-active: var(--sand-100);
  --surface-inverse: var(--sand-900);
  --border: var(--sand-150);
  --border-strong: var(--sand-200);
  --border-focus: var(--navy-600);
  --text: #1F1A17;
  --text-muted: var(--sand-600);
  --text-subtle: var(--sand-500);
  --text-disabled: var(--sand-400);
  --text-inverse: #FFFFFF;
  --text-link: var(--navy-600);

  --primary: var(--navy-600);           /* #000094 — 14.7:1 with white */
  --primary-hover: var(--navy-700);
  --primary-soft: var(--navy-50);
  --primary-soft-hover: var(--navy-100);
  --primary-text: var(--navy-600);
  --on-primary: #FFFFFF;
  --brand: var(--navy-600);             /* selection marks, active tab underline, drop lines */

  --success: var(--green-600); --success-soft: var(--green-50); --success-text: var(--green-700);
  --warning: var(--amber-500); --warning-soft: var(--amber-50); --warning-text: var(--amber-700);
  --danger: var(--red-600); --danger-hover: var(--red-700); --danger-soft: var(--red-50); --danger-text: var(--red-700);
  --info: var(--blue-600); --info-soft: var(--blue-50); --info-text: var(--blue-700);
  --violet: var(--violet-600); --violet-soft: var(--violet-50); --violet-text: var(--violet-700);

  /* Chips — fills for small pills (badges, status, number counts). One step darker
     than the -soft tints so they stay visible on #FFFDFA and #F9F4EB; text ≥ 4.8:1. */
  --chip-neutral: var(--sand-200); --chip-neutral-text: var(--sand-700);
  --chip-primary: var(--navy-100);
  --chip-success: var(--green-100);
  --chip-warning: var(--amber-100);
  --chip-danger: var(--red-100);
  --chip-info: var(--blue-100);
  --chip-violet: var(--violet-100);

  /* Content status — consistent everywhere a page state appears */
  --status-draft: var(--sand-500);
  --status-published: var(--green-500);
  --status-changed: var(--amber-600);
  --status-scheduled: var(--violet-500);

  --shadow-xs: 0 1px 2px rgba(43, 30, 20, .05);
  --shadow-sm: 0 1px 2px rgba(43, 30, 20, .05), 0 2px 6px -1px rgba(43, 30, 20, .06);
  --shadow-md: 0 2px 4px rgba(43, 30, 20, .04), 0 8px 20px -4px rgba(43, 30, 20, .10);
  --shadow-lg: 0 4px 8px rgba(43, 30, 20, .04), 0 20px 44px -8px rgba(43, 30, 20, .18);
  --shadow-xl: 0 8px 16px rgba(43, 30, 20, .06), 0 32px 72px -12px rgba(43, 30, 20, .28);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--navy-600) 28%, transparent);
  --overlay: rgba(28, 24, 22, .42);
}

@media (prefers-reduced-motion: reduce) {
  :root { --duration-fast: 0ms; --duration-base: 0ms; --duration-slow: 0ms; }
}
