/* ============================================================================
 * Self-hosted fonts — Vazirmatn variable font (single 111KB file covers
 * weights 100-900). Replaces fonts.googleapis.com so the render path has ZERO
 * external dependency (critical for users behind slow/filtered networks).
 *
 * ZERO-CLS FONT LOADING (فاز A):
 *   font-display: swap keeps text visible instantly, but a naive swap reflows
 *   the layout when Vazirmatn replaces the system fallback (their line-box
 *   metrics differ) — a real CLS source, worst on mobile.
 *   The 'Vazirmatn Fallback' face below aliases a local system font but FORCES
 *   Vazirmatn's exact vertical metrics (extracted from the woff2:
 *   ascent 102.5%, descent 53.7%, line-gap 0%). So the fallback occupies the
 *   identical vertical space, and when Vazirmatn loads there is NO shift.
 *   Use the stack:  'Vazirmatn', 'Vazirmatn Fallback', Tahoma, sans-serif
 *
 *   font-display: optional — the deterministic, cross-platform zero-CLS choice.
 *   The metric-matched fallback below only applies where its local fonts exist
 *   (desktop); on Android our target the local names are absent, so a `swap`
 *   would still reflow. `optional` never swaps after first paint → ZERO shift on
 *   ANY device. The font is preloaded, so on fast links Vazirmatn still paints
 *   immediately; on throttled mobile the metric-consistent fallback is used for
 *   that view and Vazirmatn shows on the next navigation (cached). Text never
 *   blocks (no FOIT) so FCP/LCP stay fast.
 * ============================================================================ */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/vendor/fonts/Vazirmatn-Variable.woff2?v=1') format('woff2-variations'),
       url('/assets/vendor/fonts/Vazirmatn-Variable.woff2?v=1') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: optional;
}

/* Metric-matched fallback → eliminates layout shift on font swap. */
@font-face {
  font-family: 'Vazirmatn Fallback';
  src: local('Tahoma'), local('Segoe UI'), local('Arial'), local('sans-serif');
  ascent-override: 102.5%;
  descent-override: 53.7%;
  line-gap-override: 0%;
}
