/* Language pages: script fonts and small fixes. Written for tools/i18n/build.mjs pages; also loaded by lang.mjs
   on English pages for the language links. The site ships Noto Sans Devanagari; other scripts use the system's
   own Indic fonts (phones: Noto; Apple: Kohinoor and Sangam; Windows: Nirmala UI). Latin keeps the brand fonts. */
:root[data-page-lang="bn"] { --lg-x: "Noto Sans Bengali", "Kohinoor Bangla", "Bangla Sangam MN", "Nirmala UI", "Vrinda"; }
:root[data-page-lang="ta"] { --lg-x: "Noto Sans Tamil", "Tamil Sangam MN", "Nirmala UI", "Latha"; }
:root[data-page-lang="te"] { --lg-x: "Noto Sans Telugu", "Kohinoor Telugu", "Telugu Sangam MN", "Nirmala UI", "Gautami"; }
:root[data-page-lang="gu"] { --lg-x: "Noto Sans Gujarati", "Kohinoor Gujarati", "Gujarati Sangam MN", "Nirmala UI", "Shruti"; }
:root[data-page-lang="kn"] { --lg-x: "Noto Sans Kannada", "Kannada Sangam MN", "Nirmala UI", "Tunga"; }
:root[data-page-lang="ml"] { --lg-x: "Noto Sans Malayalam", "Malayalam Sangam MN", "Nirmala UI", "Kartika"; }
:root[data-page-lang="pa"] { --lg-x: "Noto Sans Gurmukhi", "Mukta Mahee", "Gurmukhi Sangam MN", "Nirmala UI", "Raavi"; }
:root[data-page-lang="ur"] { --lg-x: "Noto Nastaliq Urdu", "Noto Naskh Arabic", "Geeza Pro", "Urdu Typesetting", "Segoe UI", "Tahoma"; }
:root[data-page-lang="bn"], :root[data-page-lang="ta"], :root[data-page-lang="te"], :root[data-page-lang="gu"], :root[data-page-lang="kn"], :root[data-page-lang="ml"], :root[data-page-lang="pa"], :root[data-page-lang="ur"] {
  --b2-display: "Bricolage Grotesque", var(--lg-x), system-ui, sans-serif;
  --b2-body: Inter, var(--lg-x), system-ui, sans-serif;
}
/* Indic and Nastaliq scripts stack marks above and below the line: give body copy and headings more room. */
:root[data-page-lang="hi"] body, :root[data-page-lang="mr"] body, :root[data-page-lang="bn"] body, :root[data-page-lang="ta"] body, :root[data-page-lang="te"] body,
:root[data-page-lang="gu"] body, :root[data-page-lang="kn"] body, :root[data-page-lang="ml"] body, :root[data-page-lang="pa"] body { line-height: 1.75; }
:root[data-page-lang="ur"] body { line-height: 2; }
:root[data-page-lang] :is(h1, h2, h3, .b2-h1, .b2-h2, .b2-h3) { line-height: 1.3; letter-spacing: 0; overflow-wrap: anywhere; hyphens: auto; }
:root[data-page-lang="ur"] :is(h1, h2, h3, .b2-h1, .b2-h2, .b2-h3) { line-height: 1.7; }
/* Tamil and Malayalam words run long: let headings and buttons wrap instead of overflowing. */
:root[data-page-lang="ta"], :root[data-page-lang="ml"], :root[data-page-lang="te"], :root[data-page-lang="kn"] { --lg-shrink: .88; }
:root:is([data-page-lang="ta"], [data-page-lang="ml"], [data-page-lang="te"], [data-page-lang="kn"]) :is(h1, .b2-h1) { font-size: calc(clamp(2.5rem, 7vw, 4.75rem) * var(--lg-shrink)); }
:root[data-page-lang] .b2-btn { white-space: normal; text-align: center; line-height: 1.25; }

/* Language links (real links to each language page) look like the shared chooser's buttons. */
a.hm-lang__opt { text-decoration: none; }
.hm-lang { max-height: calc(100dvh - var(--b2-bar) - env(safe-area-inset-top) - 24px); overflow-y: auto; overscroll-behavior: contain; }
.hm-lang__opt[aria-current="true"], .hm-lang__opt[aria-checked="true"] { background: var(--b2-berry-soft); }
.hm-lang__opt[aria-current="true"]::after, a.hm-lang__opt[aria-checked="true"]::after { opacity: 1; transform: rotate(45deg) scale(1); }
.hm-menu__lang a, .hm-footlang a {
  position: relative; width: auto; min-height: 44px; padding: 0 30px 0 14px; display: inline-flex; align-items: center;
  border: 1px solid var(--b2-line); border-radius: 999px; color: var(--b2-ink); text-decoration: none;
}
.hm-menu__lang a::after, .hm-footlang a::after { right: 13px; width: 5px; height: 9px; margin-top: -6px; }
.hm-menu__lang a .hm-lang__sub, .hm-footlang a .hm-lang__sub { display: none; }
.hm-menu__lang a .hm-lang__name, .hm-footlang a .hm-lang__name { font: 500 .9rem/1 var(--b2-body); }
:focus-visible.hm-lang__opt { outline: 2px solid var(--b2-berry); outline-offset: 2px; }
/* Right to left (Urdu): the shared skip link parks itself at left:-9999px, which in RTL becomes scrollable
   space and pushes the whole page out of view. Park it on the clipped side instead. */
[dir="rtl"] .b2-skip { left: auto; right: -9999px; }
[dir="rtl"] .b2-skip:focus { right: 12px; }
/* Nastaliq hangs far below the line; the hero splits its headline into word spans that keep their own line box. */
:root[data-page-lang="ur"] :is(h1, h2, h3) * { line-height: inherit; }
:root[data-page-lang="ur"] :is(h1, .b2-h1) { line-height: 1.9; }
