/* ============================================================================
   Restaurant India — Design Tokens
   doc: 04-design-system/brand-guidelines.md   version: 0.2   2026-09-16

   FONTS — two faces, one job each.

     DISPLAY  Tiempos Text (self-hosted, licensed retail cuts, © Klim Type
              Foundry). Headlines, card titles, pull quotes, big numbers.
     TEXT/UI  Open Sans (Google Fonts). Body copy, navigation, labels,
              metadata, tables, forms, legal.

   Tiempos is now display-only, so only three faces ship — Italic was dropped
   because body italics are set in Open Sans. Re-add it if a pull quote or
   display line ever needs a true italic; do not let the browser synthesise one.

     Shipped: Regular 400 · Semibold 600 · Bold 700   (~96 KB, Latin subset)
     Converted from client OTF: 565 KB -> WOFF2 -> Latin subset.

   NOT SUPPLIED: Tiempos Fine (the real display cut). Headlines use Tiempos
   Text Bold. The live site's Tiempos Fine files 404 anyway, so this matches
   what readers already see. See Q-016.

   RUPEE: Tiempos Text has no ₹ (U+20B9) and no Devanagari. Open Sans has
   both, and it is now the body face — so prices, tables and the /hi/ pages
   render correctly without a third font. A ₹ inside a Tiempos headline still
   falls back, which is why Open Sans sits directly behind it in that stack.

   PRODUCTION: self-host Open Sans rather than calling Google Fonts — one less
   third-party request on the critical path, and no third-party font call to
   disclose under the DPDP Act. See Q-021.
   ========================================================================= */

@font-face{font-family:'Tiempos Text';src:url('../fonts/TiemposText-Regular.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'Tiempos Text';src:url('../fonts/TiemposText-Semibold.woff2') format('woff2');font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:'Tiempos Text';src:url('../fonts/TiemposText-Bold.woff2') format('woff2');font-weight:700;font-style:normal;font-display:swap}

/* ============================================================================
   RULES
   1. Components reference SEMANTIC tokens (--color-text-primary), never
      primitives (--red-500) and never raw hex.
   2. Every text/background pair below has a measured WCAG 2.2 contrast ratio
      in its comment. Do not invent new pairs without measuring.
   3. Nothing here is decorative. If a token has no documented use, delete it.
   ========================================================================= */

:root {

  /* ==========================================================================
     1. PRIMITIVES — COLOUR
     Brand red #DB2127 and ink #231F20 are verified from the live theme CSS
     (themes/menshealth/css/*.css) and are LOCKED. The ramps are derived.
     ========================================================================== */

  /* Brand red ramp — ratios are vs #FFFFFF */
  --red-50:  #FEF2F2;   /*  1.09:1 — tint only, never text */
  --red-100: #FDE0E1;   /*  1.24:1 — tint only, never text */
  --red-200: #FAC0C2;   /*  1.57:1 — tint only, never text */
  --red-300: #F58F93;   /*  2.27:1 — tint only, never text */
  --red-400: #EC5A60;   /*  3.39:1 — large text / UI borders only */
  --red-500: #DB2127;   /*  4.93:1 — BRAND. AA normal text, AAA large */
  --red-600: #B81A1F;   /*  6.55:1 — AA. Use for red text at body size */
  --red-700: #951519;   /*  8.75:1 — AAA */
  --red-800: #6E1013;   /* 12.02:1 — AAA */
  --red-900: #4A0B0D;   /* 15.62:1 — AAA */

  /* Neutral ramp — warm-tinted to sit with #231F20, not pure grey.
     Ratios are vs #FFFFFF. */
  --neutral-0:   #FFFFFF;
  --neutral-50:  #F7F6F5;   /*  1.08:1 — surface only */
  --neutral-100: #EDEBEA;   /*  1.19:1 — surface only */
  --neutral-200: #DDD9D8;   /*  1.40:1 — borders, dividers */
  --neutral-300: #C2BDBB;   /*  1.86:1 — disabled borders */
  --neutral-400: #9A9391;   /*  3.02:1 — UI borders, large text only */
  --neutral-500: #756E6C;   /*  5.00:1 — AA. Minimum for secondary text */
  --neutral-600: #5A5352;   /*  7.52:1 — AAA */
  --neutral-700: #423C3B;   /* 10.82:1 — AAA */
  --neutral-800: #2E2928;   /* 14.34:1 — AAA */
  --neutral-900: #231F20;   /* 16.30:1 — BRAND INK. Verified live. LOCKED */
  --neutral-950: #171314;   /* 18.43:1 */

  /* Functional — all measured ≥ 4.5:1 on white */
  --green-600:  #1F7A43;   /* 5.35:1 */
  --amber-700:  #8A5A00;   /* 5.93:1 */
  --crimson-600:#B3261E;   /* 6.54:1 */
  --blue-700:   #1B5E9E;   /* 6.68:1 */
  --gold-700:   #7A5B00;   /* 6.32:1 — sponsored/advertorial labelling */

  /* ==========================================================================
     2. SEMANTIC COLOUR — components use ONLY these
     ========================================================================== */

  --color-bg:                 var(--neutral-0);
  --color-bg-subtle:          var(--neutral-50);
  --color-bg-muted:           var(--neutral-100);
  --color-bg-inverse:         var(--neutral-900);

  --color-text-primary:       var(--neutral-900);  /* 16.30:1 on bg — AAA */
  --color-text-secondary:     var(--neutral-600);  /*  7.52:1 on bg — AAA */
  --color-text-tertiary:      var(--neutral-500);  /*  5.00:1 on bg — AA  */
  --color-text-inverse:       var(--neutral-0);    /* 16.30:1 on inverse — AAA */
  --color-text-inverse-muted: #E8E8E8;             /* 13.30:1 on inverse — AAA */
  --color-text-brand:         var(--red-600);      /*  6.55:1 on bg — AA at body size */
  --color-text-on-brand:      var(--neutral-0);    /*  4.93:1 on red-500 — AA */

  --color-border:             var(--neutral-200);
  --color-border-emphasis:    var(--neutral-300);  /* one step darker than --color-border */
  --color-border-strong:      var(--neutral-400);
  --color-border-brand:       var(--red-500);

  --color-brand:              var(--red-500);      /* marks, rules, fills */
  --color-brand-hover:        var(--red-600);
  --color-brand-active:       var(--red-700);
  --color-brand-wash:         var(--red-50);

  --color-link:               var(--red-600);
  --color-link-hover:         var(--red-700);
  --color-link-visited:       var(--red-800);

  /* Focus ring — must be visible on white, on ink and on brand red */
  --color-focus:              #1B5E9E;
  --focus-ring:               0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-focus);

  --color-success:            var(--green-600);
  --color-warning:            var(--amber-700);
  --color-error:              var(--crimson-600);
  --color-info:               var(--blue-700);
  --color-sponsored:          var(--gold-700);   /* advertorial label — legal requirement */

  --color-ad-surface:         var(--neutral-50);
  --color-ad-label:           var(--neutral-500);

  /* ==========================================================================
     3. TYPOGRAPHY — serif display, sans text

     ONE RULE decides which token to use: is it a headline, or is it
     everything else? Headlines, card titles, pull quotes and display numbers
     take --font-display. Body copy, navigation, labels, metadata, tables,
     forms and legal take --font-text. --font-ui is the same face, kept as a
     separate token so UI can diverge later without touching body copy.

     Open Sans sits directly behind Tiempos in the display stack so that a ₹
     inside a headline has somewhere to go.
     ========================================================================== */

  --font-fallback-sans:  system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Swap 'Open Sans' here to change the entire text face of the site.
     Everything below references these three tokens and nothing else. */
  --font-display: 'Tiempos Text', 'Open Sans', Georgia, 'Times New Roman', serif;
  --font-text:    'Open Sans', var(--font-fallback-sans);
  --font-ui:      'Open Sans', var(--font-fallback-sans);
  --font-mono:    ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Fluid type scale, aligned to the foodandwine.com hierarchy measured at
     1440px: 46 / 36 / 32 / 29 / 23 / 20 / 18 / 16 / 14 / 12 / 11.
     Mobile floors are set so the article measure still lands at 60-75
     characters — 54.3% of this site's users are at 360-413px. */
  --text-display: clamp(2.125rem, 1.55rem + 2.5vw, 2.875rem);  /* 34 → 46  hero */
  --text-h1:      clamp(1.75rem,  1.45rem + 1.3vw, 2.25rem);   /* 28 → 36  page + event panel */
  --text-h2:      clamp(1.5rem,   1.30rem + 0.9vw, 2rem);      /* 24 → 32  module headings */
  --text-h3:      clamp(1.375rem, 1.20rem + 0.8vw, 1.8125rem); /* 22 → 29  section leads */
  --text-h4:      clamp(1.1875rem,1.10rem + 0.4vw, 1.4375rem); /* 19 → 23  card titles */
  --text-lead:    clamp(1.125rem, 1.07rem + 0.25vw,1.25rem);   /* 18 → 20  standfirst */
  --text-body:    clamp(1.0625rem,1.03rem + 0.15vw,1.125rem);  /* 17 → 18  body */
  --text-sm:      1rem;        /* 16  small card titles, rail items */
  --text-xs:      0.875rem;    /* 14  dates, nav, event meta */
  --text-label:   0.75rem;     /* 12  uppercase kickers, bylines */
  --text-micro:   0.6875rem;   /* 11  uppercase micro labels */

  /* Leading matched to the same reference: 1.10 on display, 1.20 on headings,
     1.40 on card titles and short body, 1.50 on standfirst. Article body keeps
     1.6 — 1.40 is fine for a dek but too tight for a 31-minute read. */
  --leading-tight:   1.10;   /* display, hero, event panel */
  --leading-snug:    1.20;   /* module headings, section leads */
  --leading-card:    1.40;   /* card titles, deks, list items */
  --leading-normal:  1.40;   /* UI text */
  --leading-lead:    1.50;   /* standfirst */
  --leading-relaxed: 1.6;    /* article body — long-form readability */

  --tracking-tight:   -0.015em;  /* large display sizes */
  --tracking-normal:  0;
  --tracking-wide:    0.0625em;  /* uppercase labels at 12px (0.75px) */
  --tracking-meta:    0.07em;    /* uppercase meta at 14px (1px) */
  --tracking-eyebrow: 0.30em;    /* major uppercase eyebrows — 5px at 14px */

  /* Tiempos ships 400/600/700. Open Sans covers 300–800, but only these are
     loaded — any other value triggers synthetic weighting, which looks wrong. */
  --weight-regular:  400;
  --weight-strong:   600;   /* inline <strong>, emphasis, nav, small caps labels */
  --weight-display:  700;   /* headlines, card titles */
  --weight-display-heavy: 700;   /* no Tiempos 900 supplied; aliased so callers don't break */

  --measure:       68ch;   /* article body target: 60–75 characters */
  --measure-tight: 45ch;   /* card headlines, pull quotes */

  /* ==========================================================================
     4. SPACING — 4px base, no arbitrary values
     ========================================================================== */
  --space-0:  0;
  --space-1:  0.25rem;  /*  4 */
  --space-2:  0.5rem;   /*  8 */
  --space-3:  0.75rem;  /* 12 */
  --space-4:  1rem;     /* 16 */
  --space-5:  1.25rem;  /* 20 */
  --space-6:  1.5rem;   /* 24 */
  --space-8:  2rem;     /* 32 */
  --space-10: 2.5rem;   /* 40 */
  --space-12: 3rem;     /* 48 */
  --space-16: 4rem;     /* 64 */
  --space-20: 5rem;     /* 80 */
  --space-24: 6rem;     /* 96 */

  /* ==========================================================================
     5. LAYOUT
     Desktop target 1280px (17.3% of users); 1440+ is 12.5% combined.
     ========================================================================== */
  --bp-xs:  360px;
  --bp-sm:  414px;
  --bp-md:  768px;
  --bp-lg:  1024px;
  --bp-xl:  1280px;
  --bp-2xl: 1600px;

  --container-max:    1200px;
  --container-wide:   1440px;
  --container-narrow: 720px;   /* article reading column */
  --gutter:           var(--space-4);   /* 16px minimum side gutter */
  --gutter-lg:        var(--space-6);
  --grid-columns:     12;
  --grid-gap:         var(--space-6);

  /* ==========================================================================
     6. BORDERS, RADII, ELEVATION
     Live site currently uses 3/4/5/8/10px radii with no rule. Consolidated to 4.
     ========================================================================== */
  --radius-none: 0;
  --radius-sm:   2px;
  --radius-md:   4px;
  --radius-lg:   8px;
  --radius-full: 999px;

  --border-thin:  1px;
  --border-thick: 2px;
  --border-brand-rule: 3px;   /* the red rule under the nav — brand signature */

  --shadow-sm: 0 1px 2px rgba(35, 31, 32, 0.06);
  --shadow-md: 0 2px 8px rgba(35, 31, 32, 0.08);
  --shadow-lg: 0 8px 24px rgba(35, 31, 32, 0.12);

  /* ==========================================================================
     7. Z-INDEX — matches existing site layering so ad units keep working
     ========================================================================== */
  --z-base:      0;
  --z-dropdown:  100;
  --z-sticky:    500;   /* sticky nav */
  --z-drawer:    600;   /* mobile menu */
  --z-anchor-ad: 700;   /* sticky bottom ad */
  --z-modal:     800;
  --z-toast:     900;

  /* ==========================================================================
     8. MOTION — restrained; all of it is optional
     ========================================================================== */
  --duration-fast:   120ms;
  --duration-normal: 200ms;
  --duration-slow:   320ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* ==========================================================================
     9. IMAGERY — Google Discover is 58% of organic clicks and requires
     images ≥1200px wide. These ratios are a distribution requirement.
     ========================================================================== */
  --ratio-hero:      16 / 9;   /* lead images; Discover-eligible at ≥1200px */
  --ratio-card:      3 / 2;
  --ratio-thumb:     1 / 1;
  --ratio-portrait:  4 / 5;    /* author, interview subjects */

  /* Ad slot reserved heights — prevent CLS. Sizes from the live GPT config. */
  --ad-leaderboard-h: 90px;    /* 728x90 / 970x90 */
  --ad-anchor-h-desktop: 90px; /* 728x90 */
  --ad-anchor-h-mobile: 50px;  /* 320x50 */
  --ad-mrec-h: 250px;          /* 300x250 */
}

/* ============================================================================
   ACCESSIBILITY BASELINES — not optional
   ========================================================================= */

*:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
