/* Script fallbacks — loaded only when glyphs of that script appear (unicode-range).
   Covers Chinese / Japanese / Korean / Egyptian hieroglyphs / symbols so rare characters
   never render as tofu boxes. Files come from Google Fonts CDN. */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300..900&family=Noto+Sans+JP:wght@300..900&family=Noto+Sans+KR:wght@300..900&family=Noto+Sans+Egyptian+Hieroglyphs&family=Noto+Sans+Symbols+2&display=swap");
:root {
  --font-scripts: "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Egyptian Hieroglyphs", "Noto Sans Symbols 2", "Segoe UI Symbol", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji";
}
body,
button,
input,
textarea,
select {
  font-family: Alexandria, Arial, sans-serif, var(--font-scripts);
}
/* Per-language rendering hints: correct Han variants + tighter CJK line boxes. */
[lang="ja"], :lang(ja) { font-family: Alexandria, "Noto Sans JP", Arial, sans-serif, var(--font-scripts); }
[lang="zh"], :lang(zh) { font-family: Alexandria, "Noto Sans SC", Arial, sans-serif, var(--font-scripts); }
[lang="ko"], :lang(ko) { font-family: Alexandria, "Noto Sans KR", Arial, sans-serif, var(--font-scripts); word-break: keep-all; }
[lang="egy"], :lang(egy) { font-family: "Noto Sans Egyptian Hieroglyphs", Alexandria, sans-serif, var(--font-scripts); font-size: 1.15em; line-height: 1.5; }
/* Learning-content blocks: mark with class "script-text" (or dir="auto" inputs) to get the full stack. */
.script-text, [dir="auto"] { font-family: Alexandria, Arial, sans-serif, var(--font-scripts); }
