/* ============================================================
   My Israeli Guide — Design Tokens
   Modern Heritage rebrand — single source of truth
   ============================================================ */

@font-face {
  font-family: 'Lora';
  src: url('../fonts/Lora.woff2') format('woff2-variations'),
       url('../fonts/Lora.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../fonts/Inter.woff2') format('woff2-variations'),
       url('../fonts/Inter.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Metric-tuned fallbacks (PERF-PLAN 8.2.1): Georgia/Arial re-shaped to the
   webfonts' real metrics (computed from the WOFF2 + system TTF files,
   frequency-weighted avg advance), so the swap reflows ~nothing (CLS).
   The stacks below list these right after the webfonts. */
@font-face {
  font-family: 'Lora Fallback';
  src: local('Georgia');
  size-adjust: 105.98%;
  ascent-override: 94.92%;
  descent-override: 25.85%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  size-adjust: 107.29%;
  ascent-override: 90.29%;
  descent-override: 22.48%;
  line-gap-override: 0%;
}

:root {
  /* === Color ================================================ */
  --mh-navy:        #1A2B4C;
  --mh-navy-2:      #0E1B32;
  --mh-sand:        #F4F1EA;
  --mh-sand-2:      #EAE5DA;
  --mh-terracotta:  #C86A4C;
  --mh-terracotta-2:#A9573D;
  --mh-ink:         #333333;
  --mh-ink-2:       #5A5A5A;
  --mh-cream:       #FDFBF7;
  --mh-rule:        rgba(26, 43, 76, 0.12);
  --mh-rule-strong: rgba(26, 43, 76, 0.22);
  --mh-scrim:       rgba(26, 43, 76, 0.60);

  /* Semantic aliases */
  --bg:           var(--mh-sand);
  --bg-alt:       var(--mh-sand-2);
  --bg-dark:      var(--mh-navy);
  --fg:           var(--mh-ink);
  --fg-heading:   var(--mh-navy);
  --fg-light:     var(--mh-cream);
  --fg-muted:     var(--mh-ink-2);
  --accent:       var(--mh-terracotta);
  --accent-press: var(--mh-terracotta-2);

  /* === Type ================================================= */
  --font-display: 'Lora', 'Lora Fallback', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Fluid type scale */
  --t-display-1: clamp(2.75rem, 4.5vw + 1rem, 4rem);
  --t-display-2: clamp(2.25rem, 3vw + 1rem, 3rem);
  --t-h1:        clamp(2rem, 2vw + 1rem, 2.5rem);
  --t-h2:        clamp(1.625rem, 1.2vw + 1rem, 2rem);
  --t-h3:        1.5rem;
  --t-h4:        1.25rem;
  --t-body-l:    1.125rem;
  --t-body:      1rem;
  --t-caption:   0.875rem;
  --t-eyebrow:   0.8125rem;
  --t-micro:     0.75rem;

  --leading-tight:  1.15;
  --leading-snug:   1.3;
  --leading-normal: 1.6;

  --tracking-tight:   -0.01em;
  --tracking-normal:  0;
  --tracking-wide:    0.06em;
  --tracking-wider:   0.12em;
  --tracking-widest:  0.18em;

  /* === Spacing (8px base) =================================== */
  --space-0:  0;
  --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:  5rem;
  --space-10: 6rem;
  --space-12: 8rem;
  --space-16: 12rem;

  /* Section vertical rhythm — fluid (A5 density). 88px desktop → 60px mobile floor.
     Replaces hardcoded 120px home-section paddings; tapers on mobile (which had no
     override before). Deterministic per width = no CLS. */
  --section-y: clamp(3rem, 6vw, 5rem);

  /* === Radii ================================================ */
  --radius-sm:   2px;
  --radius-md:   4px;
  --radius-lg:   8px;
  --radius-pill: 999px;

  /* === Shadows ============================================== */
  --shadow-1: 0 1px 2px rgba(26,43,76,0.06), 0 1px 3px rgba(26,43,76,0.04);
  --shadow-2: 0 8px 24px rgba(26,43,76,0.10), 0 2px 6px rgba(26,43,76,0.06);

  /* === Motion =============================================== */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 200ms;
  --dur-med:  350ms;
  --dur-slow: 600ms;

  /* === Layout =============================================== */
  --container:  1200px;
  --gutter:     24px;
  --nav-height: 72px;

  /* Width ladder (Design-QA 2026-06-09) — the named widths sections should use.
     Consolidates ~25 ad-hoc max-widths. Edges align to --w-section/--w-wide;
     long prose caps at --w-prose; intro/leads at --w-lead. See DESIGN-SYSTEM-DERIVED.md. */
  --w-section:  1200px;  /* multi-column / grids / band inners — = footer width */
  --w-wide:      960px;  /* wide single-column editorial / body+sidebar */
  --w-prose:     720px;  /* reading measure for article/itinerary/policy text */
  --w-lead:      600px;  /* intro / lede / dek paragraphs, 404/search panels */
  --w-gallery:  1400px;  /* gallery immersive wall (intentionally wider) */
}

/* ============================================================
   BASE / RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--leading-normal);
  text-wrap: pretty;
}

/* ============================================================
   HEADINGS
   ============================================================ */
h1, h2, h3, h4, .display-1, .display-2 {
  font-family: var(--font-display);
  color: var(--fg-heading);
  margin: 0 0 var(--space-4);
  text-wrap: balance;
  letter-spacing: var(--tracking-tight);
}

.display-1 { font-size: var(--t-display-1); font-weight: 400; line-height: var(--leading-tight); }
.display-2 { font-size: var(--t-display-2); font-weight: 400; line-height: var(--leading-tight); }
h1 { font-size: var(--t-h1); font-weight: 500; line-height: var(--leading-tight); }
h2 { font-size: var(--t-h2); font-weight: 500; line-height: var(--leading-snug); }
h3 { font-size: var(--t-h3); font-weight: 600; line-height: var(--leading-snug); letter-spacing: 0; }
h4 { font-size: var(--t-h4); font-weight: 600; line-height: var(--leading-snug); letter-spacing: 0; }

p { margin: 0 0 var(--space-4); }
.body-l  { font-size: var(--t-body-l); line-height: var(--leading-normal); }
.caption { font-size: var(--t-caption); color: var(--fg-muted); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--accent);
}

a {
  color: var(--fg-heading);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out-expo);
}
a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

hr {
  border: 0;
  border-top: 1px solid var(--mh-rule);
  margin: var(--space-7) 0;
}

/* Terracotta accent rule — the recognizable brand motif */
.rule-accent {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--accent);
  border: 0;
  margin: 0 0 var(--space-5);
}

/* ============================================================
   COMPONENT PRIMITIVES
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--t-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  padding: 0.875rem 1.5rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background    var(--dur-fast) var(--ease-out-expo),
    color         var(--dur-fast) var(--ease-out-expo),
    border-color  var(--dur-fast) var(--ease-out-expo),
    transform     var(--dur-fast) var(--ease-out-expo);
}
.btn--primary             { background: var(--accent); color: var(--mh-cream); }
.btn--primary:hover       { background: var(--accent-press); color: var(--mh-cream); text-decoration: none; }
.btn--primary:active      { transform: translateY(1px); }
.btn--secondary           { background: var(--mh-navy); color: var(--mh-cream); }
.btn--secondary:hover     { background: var(--mh-navy-2); color: var(--mh-cream); text-decoration: none; }
.btn--outline             { background: transparent; color: var(--mh-navy); border-color: var(--mh-navy); }
.btn--outline:hover       { background: var(--mh-navy); color: var(--mh-cream); text-decoration: none; }

.card {
  background: var(--mh-cream);
  border: 1px solid var(--mh-rule);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow-1);
  transition:
    transform    var(--dur-fast) var(--ease-out-expo),
    box-shadow   var(--dur-fast) var(--ease-out-expo);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }

.input {
  font-family: var(--font-body);
  font-size: var(--t-body);
  color: var(--mh-ink);
  background: var(--mh-cream);
  border: 1px solid var(--mh-rule-strong);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out-expo);
}
.input:focus {
  outline: none;
  border-color: var(--mh-navy);
  box-shadow: 0 0 0 3px rgba(26,43,76,0.12);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.container  { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.bg-sand    { background: var(--mh-sand); }
.bg-sand-2  { background: var(--mh-sand-2); }
.bg-navy    { background: var(--mh-navy); color: var(--mh-cream); }
.bg-navy h1,
.bg-navy h2,
.bg-navy h3,
.bg-navy h4 { color: var(--mh-cream); }
.text-accent { color: var(--accent); }
