/* Bureo i18n: system font stacks per script. No webfonts are shipped for CJK, Indic or Arabic scripts: the brand Latin
   face stays first (it covers digits and Latin words), then each OS's own font for the script. Pages set
   <html lang="…" dir="…">, and these rules pick the stack. Override the --font custom property the page already uses. */
:root:lang(zh-Hans), :lang(zh-Hans) { --font: 'Outfit', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', 'Source Han Sans SC', system-ui, sans-serif; }
:root:lang(zh-Hant), :lang(zh-Hant) { --font: 'Outfit', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', 'Noto Sans TC', 'Source Han Sans TC', system-ui, sans-serif; }
:root:lang(ja), :lang(ja) { --font: 'Outfit', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Meiryo', 'Noto Sans CJK JP', 'Noto Sans JP', system-ui, sans-serif; }
:root:lang(ko), :lang(ko) { --font: 'Outfit', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans CJK KR', 'Noto Sans KR', system-ui, sans-serif; }
:root:lang(hi), :lang(hi) { --font: 'Outfit', 'Kohinoor Devanagari', 'Nirmala UI', 'Noto Sans Devanagari', 'Mangal', system-ui, sans-serif; }
:root:lang(gu), :lang(gu) { --font: 'Outfit', 'Gujarati Sangam MN', 'Nirmala UI', 'Noto Sans Gujarati', 'Shruti', system-ui, sans-serif; }
:root:lang(pa), :lang(pa) { --font: 'Outfit', 'Gurmukhi MN', 'Nirmala UI', 'Noto Sans Gurmukhi', 'Raavi', system-ui, sans-serif; }
:root:lang(bn), :lang(bn) { --font: 'Outfit', 'Kohinoor Bangla', 'Bangla Sangam MN', 'Nirmala UI', 'Noto Sans Bengali', 'Vrinda', system-ui, sans-serif; }
:root:lang(te), :lang(te) { --font: 'Outfit', 'Kohinoor Telugu', 'Telugu Sangam MN', 'Nirmala UI', 'Noto Sans Telugu', 'Gautami', system-ui, sans-serif; }
:root:lang(ta), :lang(ta) { --font: 'Outfit', 'Tamil Sangam MN', 'Nirmala UI', 'Noto Sans Tamil', 'Latha', system-ui, sans-serif; }
:root:lang(ar), :lang(ar) { --font: 'Outfit', 'SF Arabic', 'Geeza Pro', 'Segoe UI', 'Noto Sans Arabic', 'Tahoma', system-ui, sans-serif; }
:root:lang(fa), :lang(fa) { --font: 'Outfit', 'SF Arabic', 'Geeza Pro', 'Segoe UI', 'Noto Sans Arabic', 'Tahoma', system-ui, sans-serif; }
:root:lang(ur), :lang(ur) { --font: 'Outfit', 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Geeza Pro', 'Segoe UI', 'Noto Sans Arabic', system-ui, sans-serif; }
/* Vietnamese needs stacked diacritics the brand face may lack; the system face handles them */
:root:lang(vi), :lang(vi) { --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', 'Noto Sans', sans-serif; }

/* Scripts with tall marks or no word spaces: a little more line height, and no letter-spacing (it breaks joining scripts). */
:lang(hi), :lang(gu), :lang(pa), :lang(bn), :lang(te), :lang(ta), :lang(ar), :lang(fa), :lang(ur) { line-height: 1.6; letter-spacing: 0 !important; }
:lang(zh-Hans), :lang(zh-Hant), :lang(ja) { word-break: normal; line-break: strict; overflow-wrap: anywhere; }
:lang(ur) { line-height: 1.9; }
:lang(ar) *, :lang(fa) *, :lang(ur) * { letter-spacing: 0 !important; }

/* RTL: mirror direction-bearing icons; logical properties do the rest where pages use them. */
[dir=rtl] .i18n-flip, [dir=rtl] [data-flip] { transform: scaleX(-1); }
/* numbers, IBANs, amounts and tax IDs always read left to right */
[dir=rtl] .num, [dir=rtl] .money, [dir=rtl] .iban, [dir=rtl] bdi[data-ltr], [dir=rtl] input[type=email], [dir=rtl] input[type=tel] { direction: ltr; unicode-bidi: isolate; }

/* The machine-translation note */
.i18n-mt { font-size: 12px; opacity: .75; margin: 6px 0; }
.i18n-mt a { color: inherit; }

/* while a new language loads (max 1.5 s), hide the page instead of flashing the fallback language */
html.i18n-wait body { visibility: hidden; }
