/* ==========================================================================
   Pars Pooyesh — pp-typography.css  ·  brand font system
   -------------------------------------------------------------------------
   Single source of truth for fonts, weights, tracking and line-height.
   pp-design.css and every page template consume these tokens only.

   PERSIAN  "Yekan"   = IRANYekanX FaNum  (FontIran, v4.000)   Regular / Medium / Bold
   LATIN    "Manrope" = Manrope           (v4.504)             Regular / Medium / SemiBold / Bold
   Inter is an approved ALTERNATE and is deliberately not loaded.

   All font files are the ones supplied by the brand designer, served locally.
   No Google Fonts, no Adobe Fonts, no third-party CDN.
   Documentation: docs/design/typography.md
   ========================================================================== */

/* ---- 1 · FONT FACES ----------------------------------------------------- */
/* One file per weight — nothing is mapped to several weights, so the browser
   never needs to synthesise a bold (see font-synthesis below). */
/* Yekan is limited to Arabic-script code points so Latin letters and numerals
   inside Persian text fall through to Manrope. Latin digits (0-9) are excluded
   on purpose: in the FaNum cut they carry Persian digit shapes. */
@font-face {
  font-family: "Yekan"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/wp-content/uploads/pars-pooyesh-derived/fonts/IRANYekanXFaNum-Regular.woff2") format("woff2"),
       url("/wp-content/uploads/pars-pooyesh-derived/fonts/IRANYekanXFaNum-Regular.woff") format("woff");
  unicode-range: U+0600-06FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Yekan"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/wp-content/uploads/pars-pooyesh-derived/fonts/IRANYekanXFaNum-Medium.woff2") format("woff2"),
       url("/wp-content/uploads/pars-pooyesh-derived/fonts/IRANYekanXFaNum-Medium.woff") format("woff");
  unicode-range: U+0600-06FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "Yekan"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/wp-content/uploads/pars-pooyesh-derived/fonts/IRANYekanXFaNum-Bold.woff2") format("woff2"),
       url("/wp-content/uploads/pars-pooyesh-derived/fonts/IRANYekanXFaNum-Bold.woff") format("woff");
  unicode-range: U+0600-06FF, U+200C-200F, U+FB50-FDFF, U+FE70-FEFF;
}
/* Manrope: the supplied folder contains TTF only (no WOFF/WOFF2). The supplied
   files are used as-is; format limitation documented in typography.md. */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/wp-content/uploads/pars-pooyesh-derived/fonts/Manrope-Regular.woff2") format("woff2"),
  url("/wp-content/uploads/pars-pooyesh-derived/fonts/Manrope-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/wp-content/uploads/pars-pooyesh-derived/fonts/Manrope-Medium.woff2") format("woff2"),
  url("/wp-content/uploads/pars-pooyesh-derived/fonts/Manrope-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/wp-content/uploads/pars-pooyesh-derived/fonts/Manrope-SemiBold.woff2") format("woff2"),
  url("/wp-content/uploads/pars-pooyesh-derived/fonts/Manrope-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/wp-content/uploads/pars-pooyesh-derived/fonts/Manrope-Bold.woff2") format("woff2"),
  url("/wp-content/uploads/pars-pooyesh-derived/fonts/Manrope-Bold.ttf") format("truetype");
}

/* ---- 2 · TOKENS --------------------------------------------------------- */
:root {
  /* families */
  --pp-font-fa: "Yekan", "Manrope", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  --pp-font-en: "Manrope", "Yekan", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pp-font-data: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pp-font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --pp-font-body: var(--pp-font-en);

  /* weights — every value resolves to one real file */
  --pp-w-regular: 400;
  --pp-w-medium: 500;
  --pp-w-semibold: 600;
  --pp-w-bold: 700;
  --pp-w-heading: var(--pp-w-bold);       /* H1 / H2 / wordmarks */
  --pp-w-subheading: var(--pp-w-semibold); /* H3 / H4 / card + item titles */
  --pp-w-ui: var(--pp-w-semibold);         /* nav, buttons, eyebrows, chips, labels, links */
  --pp-w-status: var(--pp-w-semibold);     /* product status chips (Latin-only by design) */
  --pp-w-data: var(--pp-w-semibold);       /* KPI numbers, metrics, years */
  --pp-w-list: var(--pp-w-semibold);       /* emphasised list items / micro labels */
  --pp-w-caption: var(--pp-w-semibold);    /* figure captions, descriptors */

  /* line-height — rhythm is token-driven, not font-metric-driven */
  --pp-lh-body: 1.6;
  --pp-lh-h1: 1.14;
  --pp-lh-h2: 1.25;
}

/* Persian pages: detected by <html lang="fa-IR"> (Polylang / templates), never by direction alone */
html[lang^="fa"] {
  --pp-font-body: var(--pp-font-fa);
  --pp-w-subheading: var(--pp-w-bold);
  --pp-w-ui: var(--pp-w-medium);
  --pp-w-list: var(--pp-w-medium);
  --pp-w-caption: var(--pp-w-regular);
  --pp-lh-h1: 1.3;
  --pp-lh-h2: 1.35;
}

/* ---- 3 · BASE ----------------------------------------------------------- */
/* body / root content font follows the page language */
html[lang] body { font-family: var(--pp-font-body); }
body.pp-page {
  line-height: var(--pp-lh-body);
  font-synthesis: style;                /* no fake bold; oblique synthesis stays available */
}
html[lang^="fa"] body.pp-page { font-synthesis: none; }   /* Persian has no italics */

/* code blocks / inline code / terminal output keep the monospace stack (§18) */
code, kbd, pre, samp { font-family: var(--pp-font-mono); }

/* ---- 4 · PERSIAN TRACKING RULE (§20) ------------------------------------ */
/* English-style letter-spacing is never applied to Persian text. The list below
   is every pp-design.css rule that carries Persian copy on FA routes (measured
   on all 20 FA routes). Each selector is prefixed with html[lang^="fa"] so it
   outranks the original rule. English-only labels (status chips, diagram labels,
   eyebrows written in English) keep their tracking.
   A new tracked component with Persian copy must be added to this list. */
html[lang^="fa"] .pp-case-tag,
html[lang^="fa"] .pp-eyebrow,
html[lang^="fa"] .pp-fact-n,
html[lang^="fa"] .pp-flow-chip,
html[lang^="fa"] .pp-footer h4,
html[lang^="fa"] .pp-g-cat,
html[lang^="fa"] .pp-glance-devcluster .pp-dev-tag,
html[lang^="fa"] .pp-glance-hint-txt,
html[lang^="fa"] .pp-hero .pp-eyebrow,
html[lang^="fa"] .pp-hero h1,
html[lang^="fa"] .pp-ins-tag,
html[lang^="fa"] .pp-layer span,
html[lang^="fa"] .pp-trusted-label,
html[lang^="fa"] .ppf-eyebrow,
html[lang^="fa"] .ppf-proof-t,
html[lang^="fa"] .ppp-art-crumb,
html[lang^="fa"] .ppp-b-plane-t,
html[lang^="fa"] .ppp-b-ta-tier-t,
html[lang^="fa"] .ppp-c-ai-line,
html[lang^="fa"] .ppp-c-ka-role,
html[lang^="fa"] .ppp-c-ka-step-t,
html[lang^="fa"] .ppp-c-state,
html[lang^="fa"] .ppp-ch-status,
html[lang^="fa"] .ppp-ch-tag2,
html[lang^="fa"] .ppp-cu-band-t,
html[lang^="fa"] .ppp-cs-feat-sector,
html[lang^="fa"] .pps-eyebrow,
html[lang^="fa"] .ppp-cs1-arch-t,
html[lang^="fa"] .ppp-fi-map-t,
html[lang^="fa"] .ppp-fi-rel-role,
html[lang^="fa"] .ppp-fi-status,
html[lang^="fa"] .ppp-h1,
html[lang^="fa"] .ppp-in-cat strong,
html[lang^="fa"] .ppp-in-meta,
html[lang^="fa"] .ppp-in-row-cat,
html[lang^="fa"] .ppp-in-row-date,
html[lang^="fa"] .ppp-l-dev-t,
html[lang^="fa"] .ppp-l-eap-t,
html[lang^="fa"] .ppp-l-uni-engine > span,
html[lang^="fa"] .ppp-l-vi-col strong,
html[lang^="fa"] .ppp-l-x-node,
html[lang^="fa"] .ppp-m-cc-side-t,
html[lang^="fa"] .ppp-o-hub span,
html[lang^="fa"] .ppp-o-planes-h,
html[lang^="fa"] .ppp-o-roles-t,
html[lang^="fa"] .ppp-ocloop-t,
html[lang^="fa"] .ppp-rk-fm-t,
html[lang^="fa"] .ppp-rk-plate-note,
html[lang^="fa"] .ps-aff-label {
  letter-spacing: normal;
}

/* ---- 5 · METRIC FIT (§19) ------------------------------------------------ */
/* The brand fonts run slightly wider than the interim font the layout was first
   tuned on. Only the headings whose approved line breaks changed are corrected
   here, with the smallest change that restores the original line count (measured
   at >=1200px). No other font sizes are touched. */
/* Homepage hero H1: EN back to 3 lines (4 at 46px) · FA back to 2 lines (3 at 46px). */
@media (min-width: 1021px) {
  html[lang^="en"] .pp-hero h1 { font-size: 41px; }
  html[lang^="fa"] .pp-hero h1 { font-size: 45px; }
}
/* Company hero H1: EN back to one line (829px needed vs 820px available at 32px). */
html[lang^="en"] .ppp-co-hero-head .pp-h1 { font-size: 31px; }

/* MITA (EN): the hero H1 and two section H2s were single lines. They return to one line
   with a 1px size step and display-size tracking only — the copy is not re-wrapped. */
html[lang^="en"] #pp-m-h1 { font-size: 31px; letter-spacing: -.02em; }
html[lang^="en"] #pp-m-sj-h { letter-spacing: -.02em; }
html[lang^="en"] #pp-m-ti-h { letter-spacing: -.03em; }
/* LAN "operational challenge" H2: EN would need a 10% size cut to return to two lines, so it
   keeps its size and balances its three lines instead; FA returns to two lines with -1px. */
html[lang^="en"] #pp-l-why-h { text-wrap: balance; }
html[lang^="fa"] #pp-l-why-h { font-size: 39px; }
/* Insights list: room for "November 23, 2026" in Manrope SemiBold in the date column. */
@media (min-width: 1021px) {
  body.pp-page .ppp-in-row { grid-template-columns: 136px 170px 1fr 28px; }
}
/* Homepage timeline: an item name stays on one line; a category chip may use 16px beyond
   the 118px column (other chips are unaffected — they only stop wrapping early). */
html[lang^="en"] .pp-glance-item .pp-g-name { white-space: nowrap; }
.pp-glance-item .pp-g-cat { margin-inline-end: -16px; }
/* Header (§19 "navigation overflow"): the brand fonts are wider than the interim font,
   so a long header CTA pushed "Case Studies" onto two lines, and in the narrow desktop
   band the flex row squashed the logo. Nav labels never wrap and the logo never squashes;
   the header compacts only in the width bands where the original spacing no longer fits. */
body.pp-page .pp-nav a { white-space: nowrap; }
body.pp-page .pp-header .pp-logo { flex-shrink: 0; }
/* BSS and Rebin carry the longest header CTAs: they need ~50px less around the nav. */
@media (min-width: 1216px) {
  body.pp-bss .pp-header-inner, body.pp-rebin .pp-header-inner { gap: 18px; }
  body.pp-bss .pp-nav, body.pp-rebin .pp-nav { gap: 22px; }
}
/* Narrow desktop band (the full navigation is shown down to 1021px; the 1200-1215px
   tail is included because the scrollbar eats 15px of the 1200px wrap). */
@media (min-width: 1021px) and (max-width: 1215px) {
  body.pp-page .pp-header-inner { gap: 14px; }
  body.pp-page .pp-nav { gap: 14px; }
}
@media (min-width: 1121px) and (max-width: 1215px) {
  body.pp-bss .pp-header-inner > .pp-btn, body.pp-rebin .pp-header-inner > .pp-btn { padding-inline: 12px; }
}
/* Below 1141px the header CTA cannot share a row with the full navigation. */
@media (max-width: 1140px) {
  body.pp-page .pp-header-inner > .pp-btn { display: none; }
}
