/**
 * Trip Kailash self-hosted faces
 *
 * Loading these from fonts.googleapis.com costs a DNS lookup and a round trip
 * before a single glyph paints, which is real seconds on the Indian and Nepali
 * mobile connections most of this audience arrives on. So they are served from
 * our own origin, and inc/enqueue.php preloads the two that every page needs.
 *
 * All three are variable fonts, so one file per subset covers every weight of
 * that face: font-weight below is a RANGE, not a value.
 *
 * unicode-range is what keeps this cheap. A typical English page pulls the two
 * latin files, about 50 KB total. The 124 KB Devanagari file is only fetched
 * when a Devanagari character is actually on the page, and latin-ext only when
 * a diacritic is, which is what carries the IAST in terms like
 * Dasa-Divasiya Siva-Parikrama.
 *
 * Files come from bin/fetch-fonts.sh. Both faces are OFL licensed.
 */

/* ---- Cinzel, display. Headings, buttons, small tracked labels. ---------- */

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("../fonts/cinzel-latin.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("../fonts/cinzel-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Karla, body. Every paragraph on the site. ------------------------- */

@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/karla-latin.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Karla";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/karla-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Noto Serif Devanagari -------------------------------------------
   Devanagari is a first-class face here, not a fallback. Packages carry
   terms like Dasa-Divasiya Siva-Parikrama and door labels read शैव, बौद्ध,
   वैष्णव. Rendering those in whatever the system happens to have reads as
   carelessness about the tradition, which is the one thing this brand
   cannot afford to look like.
   ---------------------------------------------------------------------- */

@font-face {
  font-family: "Noto Serif Devanagari";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/noto-deva-devanagari.woff2") format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0,
    U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09;
}

@font-face {
  font-family: "Noto Serif Devanagari";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/noto-deva-latin.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Noto Serif Devanagari";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("../fonts/noto-deva-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Anything tagged as Nepali, Hindi or Sanskrit takes the Devanagari face,
   wherever it sits, including inside a Cinzel heading. */
:lang(ne), :lang(hi), :lang(sa), .tk-deva {
  font-family: var(--font-deva);
}
