/* Per-language typography for the l2m-qq mirror.
 *
 * The original site is built for Chinese: it hard-codes 微软雅黑 / 宋体 / 等线 both in
 * its CSS and in thousands of inline styles pasted out of Word. Those stacks have no
 * Thai/Vietnamese glyphs, so every non-Chinese build fell back to whatever the OS
 * picked - mismatched sizes, wrong weights, broken Thai tone marks.
 *
 * Fonts are self-hosted (/assets/fonts, see _i18n/fetch_noto.py); css/fonts.css holds
 * the @font-face rules and must be linked BEFORE this file.
 * build_site.py strips the inline Chinese font-family declarations for non-zh builds,
 * so these rules are the ones that actually apply.
 */

:root {
  --l2m-font: 'Noto Sans', 'Segoe UI', Arial, sans-serif;
  --l2m-font-cjk: 'Microsoft YaHei', '微软雅黑', 'PingFang SC', sans-serif;
}

html[lang="th"] {
  --l2m-font: 'Noto Sans Thai', 'Noto Sans', 'Segoe UI', sans-serif;
}

/* Latin languages (en / vi / id / tl) already sit in Noto Sans: latin + latin-ext +
   vietnamese subsets are loaded, so Vietnamese diacritics come from the same family. */

html[lang]:not([lang="zh-CN"]) body,
html[lang]:not([lang="zh-CN"]) p,
html[lang]:not([lang="zh-CN"]) span,
html[lang]:not([lang="zh-CN"]) div,
html[lang]:not([lang="zh-CN"]) a,
html[lang]:not([lang="zh-CN"]) li,
html[lang]:not([lang="zh-CN"]) td,
html[lang]:not([lang="zh-CN"]) th,
html[lang]:not([lang="zh-CN"]) h1,
html[lang]:not([lang="zh-CN"]) h2,
html[lang]:not([lang="zh-CN"]) h3,
html[lang]:not([lang="zh-CN"]) h4,
html[lang]:not([lang="zh-CN"]) input,
html[lang]:not([lang="zh-CN"]) button,
html[lang]:not([lang="zh-CN"]) .nav-box,
html[lang]:not([lang="zh-CN"]) .lang-switch {
  font-family: var(--l2m-font);
}

/* Thai needs a little more line height than the Chinese layout allowed, or the tone
   marks on the upper vowel row get clipped by the fixed-height nav/list rows. */
html[lang="th"] body {
  line-height: 1.55;
}
html[lang="th"] .nav-box,
html[lang="th"] .nav-box p {
  line-height: 1.2;
}

/* Article bodies: the Word paste sets absolute pt sizes that were tuned for CJK glyphs.
   Latin/Thai at the same pt reads slightly small, so nudge the article column only. */
html[lang]:not([lang="zh-CN"]) .news-content p,
html[lang]:not([lang="zh-CN"]) .news-content span,
html[lang]:not([lang="zh-CN"]) .con-box p,
html[lang]:not([lang="zh-CN"]) .con-box span {
  font-size: 1.06em;
  letter-spacing: 0;
}

/* The decorative title face (fz.ttf) only has CJK + basic latin; keep it for headings
   that are pure latin, but let anything else fall through to Noto. */
html[lang="th"] [class*="title"],
html[lang="vi"] [class*="title"] {
  font-family: var(--l2m-font);
}
