/* ============================================================
   Iran–Israel Peace Studies Institute
   Design System — Light Editorial Think-Tank (Brookings/CFR style)
   Background: White · Text: Deep Navy · Accents: Flag colors
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300..700&family=Inter+Tight:wght@300..700&family=IBM+Plex+Serif:ital,wght@0,400;0,600;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Estedad:wght@300..700&family=Vazirmatn:wght@300..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@300..700&family=Assistant:wght@300..700&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* ===== Surfaces ===== */
  --c-bg:           #ffffff;   /* page background — pure white */
  --c-bg-2:         #f7f5f0;   /* warm ivory section / featured */
  --c-bg-3:         #eeebe3;   /* tinted blocks */
  --c-line:         #e3e0d8;   /* dividers */
  --c-line-2:       #d4d0c4;   /* stronger dividers */

  /* ===== Text ===== */
  --c-ink:          #0d1b2a;   /* primary text — deep navy */
  --c-ink-soft:     #2c3e52;   /* secondary text */
  --c-ink-mute:     #6b7785;   /* tertiary / meta */
  --c-ink-light:    #8b95a4;   /* lightest meta */

  /* ===== Accents — flag-derived ===== */
  --c-iran-green:   #1f7a3f;   /* Iranian flag green (deepened for light bg) */
  --c-iran-red:     #b8202d;   /* Iranian flag red (deepened) */
  --c-isr-blue:     #1f5fa8;   /* Israeli flag blue (deepened) */
  --c-isr-blue-2:   #2c75c4;
  --c-gold:         #a3833b;   /* olive gold — sparingly */

  /* Brand accent */
  --c-accent:       var(--c-isr-blue);
  --c-accent-hover: #174a85;
  --c-signal:       var(--c-iran-red);

  /* ===== Typography ===== */
  --font-display:   'Fraunces', 'IBM Plex Serif', 'Estedad', 'Vazirmatn', 'Frank Ruhl Libre', Georgia, serif;
  --font-body:      'Inter Tight', 'Vazirmatn', 'Assistant', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif:     'IBM Plex Serif', 'Vazirmatn', 'Frank Ruhl Libre', Georgia, serif;

  /* Type scale — REDUCED to professional think-tank size */
  --text-xs:        0.75rem;   /* 12 */
  --text-sm:        0.8125rem; /* 13 */
  --text-base:      0.9375rem; /* 15 — body */
  --text-md:        1rem;      /* 16 */
  --text-lg:        1.125rem;  /* 18 */
  --text-xl:        1.375rem;  /* 22 */
  --text-2xl:       1.625rem;  /* 26 */
  --text-3xl:       2rem;      /* 32 */
  --text-4xl:       2.5rem;    /* 40 — biggest heading */
  --text-hero:      2.875rem;  /* 46 — hero only */

  /* Line heights */
  --lh-tight:       1.15;
  --lh-snug:        1.3;
  --lh-normal:      1.5;
  --lh-relaxed:     1.6;
  --lh-loose:       1.75;

  /* Weights */
  --fw-light:       300;
  --fw-regular:     400;
  --fw-medium:      500;
  --fw-semibold:    600;
  --fw-bold:        700;

  /* Spacing */
  --s-1:  0.25rem;
  --s-2:  0.5rem;
  --s-3:  0.75rem;
  --s-4:  1rem;
  --s-5:  1.25rem;
  --s-6:  1.5rem;
  --s-8:  2rem;
  --s-10: 2.5rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-20: 5rem;
  --s-24: 6rem;
  --s-32: 8rem;

  /* Containers */
  --container-narrow:  680px;
  --container-default: 1140px;
  --container-wide:    1280px;

  /* Radii */
  --r-sm:    2px;
  --r-md:    4px;
  --r-lg:    6px;

  /* Transitions */
  --t-fast:    150ms cubic-bezier(.4,0,.2,1);
  --t-normal:  240ms cubic-bezier(.4,0,.2,1);

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(13,27,42,0.06);
  --shadow-md:  0 4px 12px rgba(13,27,42,0.08);
  --shadow-lg:  0 8px 24px rgba(13,27,42,0.10);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--lh-relaxed);
  color: var(--c-ink);
  background: var(--c-bg);
  font-weight: var(--fw-regular);
  font-feature-settings: "kern", "liga", "calt";
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--t-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }

/* ---------- Typography Base ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: -0.012em;
  color: var(--c-ink);
}

h1 { font-size: var(--text-3xl); font-weight: var(--fw-bold); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); font-weight: var(--fw-semibold); }
h4 { font-size: var(--text-md); }

/* Fraunces variable axes (English headings) */
:root[lang="en"] h1,
:root[lang="en"] h2,
:root[lang="en"] h3,
:root[lang="en"] .h-display {
  font-variation-settings: "opsz" 96, "SOFT" 30, "wght" 600;
}

em, .em {
  font-style: italic;
  color: var(--c-ink);
  font-weight: var(--fw-regular);
}

strong { font-weight: var(--fw-semibold); }

/* ---------- RTL Font Mapping ---------- */
:root[lang="fa"] h1,
:root[lang="fa"] h2,
:root[lang="fa"] h3,
:root[lang="fa"] h4,
:root[lang="fa"] .h-display {
  font-family: 'Estedad', 'Vazirmatn', sans-serif;
  letter-spacing: 0;
  font-weight: var(--fw-bold);
  font-variation-settings: normal;
}
:root[lang="fa"] body { font-family: 'Vazirmatn', sans-serif; }

:root[lang="he"] h1,
:root[lang="he"] h2,
:root[lang="he"] h3,
:root[lang="he"] h4,
:root[lang="he"] .h-display {
  font-family: 'Frank Ruhl Libre', 'Vazirmatn', serif;
  letter-spacing: 0;
  font-weight: var(--fw-bold);
  font-variation-settings: normal;
}
:root[lang="he"] body { font-family: 'Assistant', sans-serif; }

/* ---------- Containers ---------- */
.container {
  width: 100%;
  max-width: var(--container-default);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: var(--container-narrow); }

@media (min-width: 768px) {
  .container { padding: 0 var(--s-8); }
}

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
}

::selection {
  background: var(--c-accent);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
