/* S4-T01 typography — DESIGN.md layer: display ladder, prose devices.
   Self-hosted Vazirmatn, no CDN. Logical properties only. */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-var.f6d31671339d.woff2") format("woff2 supports variations"),
       url("../fonts/Vazirmatn-var.f6d31671339d.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-sans: "Vazirmatn", "Segoe UI", Tahoma, "Iranian Sans", "Noto Sans Arabic", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* root size tuned up: Persian glyphs need more than 16px default */
  font-size: 17px;

  /* modular scale ~1.26 (major third), rem-based */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.175rem;
  --text-xl: 1.45rem;
  --text-2xl: 1.85rem;
  --text-3xl: 2.35rem;
  --text-4xl: 3rem;
  /* masthead display size (home h1 only) */
  --text-display: clamp(2.3rem, 6.5vw, 3.6rem);

  --leading-body: 1.9;
  --leading-tight: 1.55;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4 {
  line-height: var(--leading-tight);
  font-weight: 700;
  text-wrap: balance;
}
h1, .h1 { font-size: var(--text-4xl); font-weight: 800; }
h2, .h2 { font-size: var(--text-2xl); }
h3, .h3 { font-size: var(--text-xl); }
h4, .h4 { font-size: var(--text-lg); }
h5, .h5 { font-size: var(--text-base); }
h1:first-child, .h1:first-child { margin-block-start: 0; }

.page-home .hero h1 { font-size: var(--text-display); letter-spacing: normal; }

/* article prose: comfortable measure + editorial devices */
.prose > :first-child { margin-block-start: 0; }
.prose p { margin-block: 0 1.15em; }
.prose h2 { font-size: var(--text-2xl); margin-block: 1.9em 0.55em; }
.prose h3 { font-size: var(--text-xl); margin-block: 1.5em 0.45em; }
.prose h4 { font-size: var(--text-lg); margin-block: 1.3em 0.4em; }
.prose ul, .prose ol { margin-block: 0 1.2em; padding-inline-start: 1.5em; }
.prose li { margin-block-end: 0.45em; }
.prose li::marker { color: var(--color-primary); }
.prose img { max-inline-size: 100%; block-size: auto; border-radius: var(--radius-md); }
.prose hr { border: 0; border-block-start: 1px solid var(--color-border); margin-block: 2.2em; }
.prose a { text-underline-offset: 3px; }
.prose blockquote {
  margin-inline: 0;
  margin-block: 1.8em;
  padding: var(--sp-4) var(--sp-6);
  border-inline-start: 4px solid var(--color-primary);
  background: color-mix(in oklab, var(--color-primary) 7%, var(--color-background));
  color: var(--color-text);
  font-size: var(--text-xl);
  line-height: 1.75;
  border-radius: var(--radius-md);
}
.prose blockquote p:last-child { margin-block-end: 0; }
.body-html > p:first-of-type { font-size: var(--text-lg); color: var(--color-text); }

/* utility classes for headings/body/meta */
.text-body { font-size: var(--text-base); line-height: var(--leading-body); }
.text-lead { font-size: var(--text-lg); color: var(--color-text-secondary); }
.text-meta { font-size: var(--text-sm); color: var(--color-text-secondary); }
.text-small { font-size: var(--text-xs); }

/* Persian digits by default in numerals-heavy UI; opt out with .num-latin */
.num-fa { font-feature-settings: "ss02"; }
.num-tab { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.num-latin { font-feature-settings: "ss01"; }
