/*
 * Design tokens — the only file allowed to contain a colour literal, a raw
 * font size or a :root block. tests/css-tokens.test.ts enforces that.
 *
 * This file is the canonical copy. `make sync-tokens` copies it to
 * api/app/static/css/tokens.css for the back office, and a test on each side
 * fails when the two differ. Edit here, never there.
 *
 * Breakpoints cannot be custom properties (media queries do not resolve var()),
 * so they are a convention the lint checks: 480, 768, 1024, 1280 — min-width,
 * mobile first.
 */

:root {
  /* --- brand ------------------------------------------------------------ */
  --color-blue: #0078c5;
  --color-blue-strong: #005a94; /* hover, and blue text on a tinted surface */
  --color-blue-light: #a9d5f1;
  --color-blue-lighter: #e5f1f9;
  --color-orange: #ff8517; /* fills and accents only: 2.4:1 on white */
  --color-orange-strong: #b9500a; /* orange that carries text, either way round */
  --color-navy: #1a1a2e;

  /* --- neutrals --------------------------------------------------------- */
  --color-white: #ffffff;
  --color-black: #000000;
  --color-gray-lighter: #f3f4f7;
  --color-gray-light: #d9d9d9;
  --color-gray: #767676; /* 4.54:1 on white — the lightest grey allowed for text */
  --color-gray-dark: #494949;
  --color-gray-darker: #1b1b1b;
  --color-brown: #282828;

  /* --- roles ------------------------------------------------------------ */
  --text-strong: var(--color-navy);
  --text: #475569;
  --text-muted: #5b6b81; /* 4.5:1 or better on every --surface-* */
  --text-on-dark: var(--color-white);
  --text-on-dark-muted: rgba(255, 255, 255, 0.8);
  --surface: var(--color-white);
  --surface-subtle: #fafafa;
  --surface-section: #f5f7fa;
  --surface-dark: var(--color-navy);
  --border: #e2e8f0;
  --border-strong: var(--color-gray-light);
  --border-input: var(--color-gray); /* 3:1 against the page: a control's edge is information */
  --overlay: rgba(10, 20, 40, 0.55);
  --overlay-strong: rgba(10, 20, 40, 0.75);
  --glass: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.25);
  --focus-ring: 0 0 0 3px rgba(0, 120, 197, 0.35);

  /* --- status ----------------------------------------------------------- */
  --color-success: #1e7e45;
  --color-success-surface: #e3f6ea;
  --color-danger: #b42318;
  --color-danger-surface: #fdecea;
  --color-info: #005a94;
  --color-info-surface: #e5f1f9;
  --color-warning: #8a6116;
  --color-warning-surface: #fff8e6;
  --color-whatsapp: #1e7e45;

  /* --- type ------------------------------------------------------------- */
  --font-sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.375rem;
  --text-xl: clamp(1.5rem, 1.2rem + 1.2vw, 1.875rem);
  --text-2xl: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
  --text-3xl: clamp(2.25rem, 1.5rem + 3.5vw, 3.5rem);
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  --tracking-label: 0.125em;

  /* --- space ------------------------------------------------------------ */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --section-y: var(--space-8);
  --gutter: var(--space-4);
  --container: 1280px;
  --container-prose: 820px;

  /* --- shape ------------------------------------------------------------ */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
  --shadow-brand: 0 8px 20px rgba(0, 120, 197, 0.3);

  /* --- motion ----------------------------------------------------------- */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.3s var(--ease);

  /* --- layers ----------------------------------------------------------- */
  --z-drawer: 20;
  --z-toast: 1000;

  /* --- media ------------------------------------------------------------ */
  --ratio-card: 4 / 3;
  --ratio-wide: 16 / 9;
  --header-height: 72px;
}

/*
 * /about-cameroon is deliberately its own edition: warm earth tones against the
 * site's blue. It uses every shared component; only its palette differs, and
 * only inside .cam-page.
 */
.cam-page {
  --cam-terracotta: #bf4e1a;
  --cam-terracotta-strong: #a33a10;
  --cam-amber: #d4861a;
  --cam-green: #2b5134;
  --cam-earth: #271610;
  --cam-cream: #f8edd8;
  --cam-paper: #fdf8f0;
  --cam-sand: #e5c98a;
  --cam-ink: #3d2410;
  --cam-muted: #7a5c45;

  --color-blue: var(--cam-terracotta);
  --color-blue-strong: var(--cam-terracotta-strong);
  --color-blue-lighter: var(--cam-cream);
  --text-strong: var(--cam-ink);
  --text: var(--cam-ink);
  --text-muted: var(--cam-muted);
  --surface-subtle: var(--cam-paper);
  --surface-section: var(--cam-cream);
  --surface-dark: var(--cam-earth);
  --border: var(--cam-sand);
  --overlay: rgba(39, 22, 16, 0.55);
  --overlay-strong: rgba(39, 22, 16, 0.85);
  --shadow-brand: 0 8px 20px rgba(191, 78, 26, 0.3);
  --focus-ring: 0 0 0 3px rgba(191, 78, 26, 0.35);
}

@media (min-width: 768px) {
  :root {
    --section-y: var(--space-9);
    --gutter: var(--space-8);
  }
}
