/*
 * Self-hosted webfonts.
 *
 * Not loaded from Google Fonts. The audience is largely inside Iran, where fonts.googleapis.com is
 * unreliable to unreachable; a blocked stylesheet there would silently drop the whole site to
 * Tahoma, and a blocked font file would leave text invisible for the swap period. Serving the
 * files from our own origin removes the dependency entirely and costs 176 KB across three files.
 *
 * All three are variable fonts (one file spans the whole weight axis), so the four Vazirmatn
 * weights the design system calls for -- 400/500/600/700 -- cost one download, not four.
 *
 * The unicode-range values are Google's own subsetting ranges, carried over verbatim from the
 * fontsource packages these files come from. They matter: without them a browser downloads the
 * Latin file to render a single Persian paragraph.
 */

/* Persian and Arabic. The file the reader actually needs -- preloaded in _Layout. */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/vazirmatn-arabic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

/* Latin, for the occasional Western numeral, URL or loanword inside Persian prose. */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/vazirmatn-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
 * Quranic and hadith Arabic only, never Persian UI or narrative text. Vazirmatn does not prioritise
 * harakat placement; a naskh face does, and Quran text is unreadable without them. Only the Arabic
 * subset is hosted -- this face never renders anything else.
 */
@font-face {
  font-family: "Noto Naskh Arabic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/noto-naskh-arabic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF,
    U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
