/* ============================================================
   tokens.css — the single source of truth for design values.
   Nothing in this file selects an element. Change a value here
   and it changes everywhere.

   Replaces two competing palettes that had drifted across the
   site: the legacy saffron/cream set (33 pages) and the later
   pitambara/maroon set (13 pages).
   ============================================================ */

:root {
  /* ---- brand ------------------------------------------------ */
  --maroon:        #722F37;   /* primary: nav, dark sections, headings */
  --maroon-deep:   #5A252C;   /* hover / pressed */
  --ivory:         #FAF7F0;   /* page background */
  --saffron:       #C58B36;   /* accent only — see contrast note */
  /* Darkened from #A8752C, which measured only 4.00:1 on white and 3.46:1
     on surface-alt -- below AA for the small uppercase labels it is used
     for (.sec-title-en, .quickfact__k, .area-card__best). Now 5.32:1 on
     ivory. Also serves as the primary-button hover, where it is a
     background and a darker tone is fine. */
  --saffron-deep:  #85601F;
  /* For saffron text ON maroon. Plain --saffron is only 3.27:1 there,
     which fails for the small uppercase labels it was being used for.
     This measures 5.22:1. */
  --saffron-light: #E3B872;

  /* ---- text -------------------------------------------------- */
  --ink:           #242424;   /* body text */
  --ink-muted:     #6B6459;   /* warm grey, secondary text */
  --ink-inverse:   #FAF7F0;   /* text on maroon */

  /* ---- surface ----------------------------------------------- */
  --surface:       #FFFFFF;
  --surface-alt:   #F3EEE4;
  --border:        rgba(36, 36, 36, 0.12);
  --border-strong: rgba(36, 36, 36, 0.22);

  /* ---- fixed ------------------------------------------------- */
  --wa-green:      #25D366;   /* WhatsApp brand — never change */

  /* CONTRAST, measured:
       ink on ivory        13.9:1  ✓ body text
       ivory on maroon      9.6:1  ✓ body text on dark
       ink on saffron       6.4:1  ✓ text on an accent button
       saffron on ivory     2.9:1  ✗ DECORATIVE ONLY — rules, icons,
                                     large display type. Never body text. */

  /* ---- type -------------------------------------------------- */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* Playfair has no Devanagari coverage. Without this, Hindi headings
     fall back silently to whatever the OS supplies. */
  --font-hindi:   'Tiro Devanagari Hindi', Georgia, serif;

  /* 1.250 major third */
  --text-xs:   0.80rem;
  --text-sm:   0.90rem;
  --text-base: 1.00rem;
  --text-lg:   1.25rem;
  --text-xl:   1.56rem;
  --text-2xl:  1.95rem;
  --text-3xl:  2.44rem;
  --text-4xl:  3.05rem;

  --leading-tight: 1.25;
  --leading-body:  1.7;
  --leading-hindi: 1.9;   /* Devanagari needs more room */

  /* ---- space (4px base) --------------------------------------- */
  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-6: 1.5rem;   --space-8: 2rem;
  --space-12: 3rem;    --space-16: 4rem;    --space-24: 6rem;

  /* ---- shape --------------------------------------------------- */
  --radius-sm: 4px;    /* controls */
  --radius-md: 8px;    /* cards */
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(36,36,36,0.06);
  --shadow-md: 0 4px 16px rgba(36,36,36,0.08);

  /* ---- layout -------------------------------------------------- */
  --wrap:       1100px;
  --wrap-text:  720px;   /* ~65 characters */
  --gutter:     1rem;

  --tap-min:    48px;    /* minimum touch target */
}

@media (min-width: 768px) {
  :root { --gutter: 2rem; }
}

/* ============================================================
   Legacy token aliases.

   Pages converted to the shared system had their old :root block
   removed, but their remaining page-specific CSS still refers to
   the old names. An undefined custom property resolves to nothing,
   which silently drops backgrounds and leaves text on white — the
   failure looked like a contrast bug and was actually a missing
   variable.

   Mapping them here fixes every page at once. New CSS should use
   the names above; these exist so old rules keep working.
   ============================================================ */
:root {
  --deep-maroon:    var(--maroon);
  --maroon-legacy:  var(--maroon);
  --cream:          var(--ivory);
  --pale-gold:      var(--surface-alt);
  --bright-gold:    var(--saffron-light);
  --gold:           var(--saffron);
  --pitambara:      var(--saffron);
  --pitambara-deep: var(--saffron-deep);
  --dark:           var(--maroon);
  --text:           var(--ink);
  --text-light:     var(--ink-inverse);
  --muted:          var(--ink-muted);
}
