/*
    Script-specific typography for non-Latin languages (applies only via <html lang="...">; English is unaffected).

    - Letter-spacing: the wide tracked "eyebrow" labels (tracking-[0.18em] etc.) pull letters apart. Cursive scripts
      (Arabic, Urdu), scripts that join letters into clusters or stack marks around them (Thai and the Indian
      scripts), Tifinagh and Chinese/Japanese/Korean all read badly with it, so it is reset.
    - Upper case: the eyebrow labels are upper-cased; scripts without capitals ignore that, and the tracking is the
      only part that does harm, so nothing else changes.
    - Line height: these scripts need more vertical room than Latin (marks above and below the line, taller glyphs),
      so the tight display leading used on headings is relaxed.
    - Fonts: Inter covers Latin, Cyrillic, Greek and Vietnamese. Other scripts use the visitor's system fonts, which
      cover them on current Windows, macOS, iOS and Android; Urdu prefers a Nastaliq face where one is installed, and
      Standard Moroccan Amazigh (Tifinagh) names the faces that ship with Windows and Android.

    Unlayered on purpose so it wins over the Tailwind utility layer without !important.
    :lang() on the element itself, so English blocks inside another language's page (lang="en") keep their styling.
*/
*:lang(ar),
*:lang(ur),
*:lang(th),
*:lang(hi),
*:lang(mr),
*:lang(bn),
*:lang(gu),
*:lang(or),
*:lang(ta),
*:lang(te),
*:lang(ml),
*:lang(zh),
*:lang(yue),
*:lang(ja),
*:lang(ko),
*:lang(zgh) {
    letter-spacing: normal;
}

:is(h1, h2, h3, h4, h5, h6):is(:lang(ar), :lang(th), :lang(hi), :lang(mr), :lang(bn), :lang(gu), :lang(or),
    :lang(ta), :lang(te), :lang(ml), :lang(zgh)) {
    line-height: 1.35;
}

/* Chinese, Japanese and Korean: a little more room than Latin, less than the scripts above. */
:is(h1, h2, h3, h4, h5, h6):is(:lang(zh), :lang(yue), :lang(ja), :lang(ko)) {
    line-height: 1.3;
}

/* Urdu: Nastaliq is tall, so it needs the most room; body text too. */
*:lang(ur) {
    font-family: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Urdu Typesetting", Inter, system-ui, sans-serif;
}
:is(h1, h2, h3, h4, h5, h6):lang(ur) {
    line-height: 1.6;
}
:is(p, li, dd, td, label):lang(ur) {
    line-height: 2;
}

/* Standard Moroccan Amazigh in Tifinagh: Ebrima (Windows) and Noto Sans Tifinagh (Android, if installed elsewhere). */
*:lang(zgh) {
    font-family: Inter, "Noto Sans Tifinagh", Ebrima, system-ui, sans-serif;
}

/*
    One-line "pill" sentences (whitespace-nowrap, sized to fit the English on a phone) would push the page wider than
    the screen in longer languages, so outside English they may wrap, as a rounded box no wider than the page. The
    small labels under the large figures (Evidence page) may wrap too.
*/
html:not([lang|="en"]) dd > span.text-xs.whitespace-nowrap {
    white-space: normal;
}
html:not([lang|="en"]) p.rounded-full.whitespace-nowrap {
    white-space: normal;
    max-width: 100%;
    border-radius: 1.75rem;
    padding-inline: 1.5rem;
    text-wrap: balance;
}
