/* Self-hosted font subsets for the redesign.  Generated by site/fonts.py --
 * do not edit by hand; re-run the pipeline instead.
 *
 * Built from pinned upstream releases:
 *   https://github.com/aliftype/amiri/releases/download/1.003/Amiri-1.003.zip
 *     sha256 81af0aff7d2086d8af24cea7202f7546130997982534691373485cd96744d05e
 *   https://github.com/notofonts/arabic/releases/download/NotoNaskhArabic-v2.021/NotoNaskhArabic-v2.021.zip
 *     sha256 6c050ab9bd087d69b733c505a7576e60c528c2f33cd7b91005a5bd7da4514032
 *   https://github.com/aliftype/reem-kufi/releases/download/v2.0/ReemKufi-2.0.zip
 *     sha256 94ae468fd88f37011607f03466bfc3a03fb617682b7bac6419b70de94cac22f0
 *
 * Paste these two lines into the <head> include, before this stylesheet.  Only
 * the body face is here and preloaded: it is the one face on the critical path.
 * The display faces are in _fonts-late.css, which the page adds after its
 * first paint (templates/_head_common.html).
 *
 *   <link rel="preload" href="{% static 'fonts/noto-naskh-arabic-var.woff2' %}"
 *         as="font" type="font/woff2" crossorigin>
 *   <link rel="stylesheet" href="{% static 'css/_fonts.css' %}">
 *
 * `crossorigin` is required even same-origin: fonts are fetched in CORS mode,
 * and a preload without it downloads the file a second time.
 *
 * Font stacks to use (the override faces must come directly after their web
 * font, before the plain system names):
 *
 *   --body:    "Noto Naskh Arabic", "Noto Naskh Arabic Fallback",
 *              "Noto Naskh Arabic Fallback SUI", "Geeza Pro", "Segoe UI",
 *              Tahoma, Arial, sans-serif;
 *   --display: Amiri, "Noto Naskh Arabic", "Noto Naskh Arabic Fallback",
 *              "Geeza Pro", serif;
 *   --kufi:    "Reem Kufi", Amiri, "Noto Naskh Arabic",
 *              "Noto Naskh Arabic Fallback", sans-serif;
 */


/* Noto Naskh Arabic 400 700 -- body text (the one face on the critical path)
   54,132 bytes */
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/noto-naskh-arabic-var.woff2") format("woff2");
}

/* ------------------------------------------------------------------
 * Size-adjusted fallback faces -- this is the CLS defence.
 *
 * Until noto-naskh-arabic-var.woff2 lands, body text is laid out in one
 * of these.  Each renders its local face at the advance width and line
 * box of Noto Naskh Arabic, so the swap changes the glyphs and nothing
 * else: no reflow, no shift.
 *
 * size-adjust is calibrated on shaped advance widths over real fatwa
 * text; the ascent/descent/line-gap overrides are Noto's own typo
 * metrics (1069/-634/0 on 1000 upem) divided by that size-adjust.
 * Derivation and numbers: the FALLBACKS comment in site/fonts.py.
 *
 * Geeza Pro (the Apple default) has no entry: its metrics cannot be
 * measured on a non-Apple machine.  On macOS/iOS without Tahoma the
 * stack falls through to Geeza Pro unadjusted.  Run
 *   python site/fonts.py --calibrate
 * on a Mac to add one.
 * ------------------------------------------------------------------ */

@font-face {
  font-family: "Noto Naskh Arabic Fallback";
  src: local("Tahoma");
  size-adjust: 85.75%;
  ascent-override: 124.66%;
  descent-override: 73.94%;
  line-gap-override: 0.00%;
}

@font-face {
  font-family: "Noto Naskh Arabic Fallback SUI";
  src: local("Segoe UI");
  size-adjust: 87.50%;
  ascent-override: 122.17%;
  descent-override: 72.46%;
  line-gap-override: 0.00%;
}
