/*
 * KARNOVA Website - script coverage (10-language expansion addendum, 2026-11).
 *
 * The design system ships two faces: Schibsted Grotesk for Latin and
 * Vazirmatn for Arabic script. Vazirmatn covers Dari, Arabic, Pashto and
 * every Urdu letter, so those four languages need nothing here. Chinese,
 * Japanese and Hindi are scripts neither face has, and Urdu is set in
 * Vazirmatn like Dari (see the end of this file). This file gives the three a stack of
 * faces the reader's own system already has, and the type metrics the
 * scripts need. Only pages in those three languages load it; English and
 * Dari never do, so their rendering is untouched.
 *
 * No web font is downloaded. A self-hosted CJK face is several megabytes,
 * and every platform the site targets ships a good one; Schibsted Grotesk
 * stays first in each stack, so Latin text, brand names and numbers keep the
 * brand face inside Chinese, Japanese and Hindi copy.
 *
 * This is the one stylesheet that names faces outside the design-system
 * package. It is a stopgap with an owner: the stacks belong in
 * Karnova.DesignSystem as a script-coverage addendum, and this file goes
 * when the package carries them (decision D-L10N-06).
 */

/* ---------------------------------------------------------------------------
 * Simplified Chinese
 * ------------------------------------------------------------------------- */

:root:lang(zh-Hans) {
  --font-core: "Schibsted Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --font-display: var(--font-core);
  --font-body: var(--font-core);
  --font-data: var(--font-core);
}

/* ---------------------------------------------------------------------------
 * Japanese
 * ------------------------------------------------------------------------- */

:root:lang(ja) {
  --font-core: "Schibsted Grotesk", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans CJK JP", "Noto Sans JP", sans-serif;
  --font-display: var(--font-core);
  --font-body: var(--font-core);
  --font-data: var(--font-core);
}

/* CJK glyphs fill the em box: the Latin display line-heights (.98 to 1.16)
   would make lines touch, and Latin tracking pulls ideographs together.
   Strict line breaking keeps small kana and closing punctuation off the
   start of a line. */
:is(:lang(zh-Hans), :lang(ja)) {
  line-break: strict;
}

:is(:lang(zh-Hans), :lang(ja)) :is(.d-xl, .d-pg, .d-lg, .d-md, .h-lg, .h-md) {
  letter-spacing: 0;
  line-height: 1.3;
}

:is(:lang(zh-Hans), :lang(ja)) :is(.lead, .body, .sm) {
  line-height: 1.85;
}

:is(:lang(zh-Hans), :lang(ja)) .lab {
  letter-spacing: .04em;
}

/* Japanese headings break between phrases rather than inside a word
   (伸ばし|方), where the browser can tell them apart. */
:lang(ja) :is(h1, h2, h3) {
  word-break: auto-phrase;
}

/* ---------------------------------------------------------------------------
 * Hindi (Devanagari)
 * ------------------------------------------------------------------------- */

:root:lang(hi) {
  --font-core: "Schibsted Grotesk", "Nirmala UI", "Kohinoor Devanagari", "Noto Sans Devanagari", "Mangal", sans-serif;
  --font-display: var(--font-core);
  --font-body: var(--font-core);
  --font-data: var(--font-core);
}

/* Vowel signs sit above the headline and below the base: Devanagari needs
   more line height than Latin. Tracking breaks conjuncts apart in some
   renderers, so there is none; and Devanagari has no capitals. */
:lang(hi) :is(.d-xl, .d-pg, .d-lg, .d-md, .h-lg, .h-md) {
  letter-spacing: 0;
  line-height: 1.4;
}

:lang(hi) :is(.lead, .body, .sm) {
  line-height: 1.9;
}

:lang(hi) .lab {
  letter-spacing: 0;
  text-transform: none;
  font-size: 14px;
}

/* Urdu needs nothing here. It is set in Vazirmatn like the other three
   right-to-left languages - every Urdu letter is in the face. Nastaliq from
   system faces was tried and dropped: Windows' Urdu Typesetting renders
   visibly smaller than Vazirmatn beside it, and phones substitute a
   different Nastaliq, so one page mixed two faces at two apparent sizes. A
   self-hosted Noto Nastaliq Urdu is an open decision for the Urdu reviewer
   (06_RTL_LTR_DESIGN_QA.md). */
