/* Kungfupunk · i18n.css — the language editions (27 Oct 2026, PLAN-2026-10-27-languages.md section 5).
   Loaded only by the pages under /zh-hans/ /es/ /pt-br/ /ko/ /ja/, after style.css and the r*.css files.
   Owner's decision: Chinese body text in the system fonts, WenKai (the seal face) only on H1, H2 and the seals; Japanese and
   Korean entirely in system fonts; Spanish and Portuguese keep Alegreya. Latin letters and figures stay Alegreya in every
   edition: it is first in every stack, and it has no CJK, so CJK characters fall through to the system face. */

:root {
  --sys-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --sys-ja: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans CJK JP", "Noto Sans JP", sans-serif;
  --sys-ko: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", "Noto Sans KR", sans-serif;
}

/* ---------- Simplified Chinese ---------- */
/* --serif is what every label, button, caption and footer rule in style.css/r2.css/r8.css reaches for; on the English pages it
   ends in Georgia/serif, which on a Chinese page would put the UI in Songti while the body is PingFang. Pointing it at the same
   system stack keeps one Chinese face everywhere (Latin stays Alegreya). */
html[lang="zh-Hans"] { --measure: 40em; --lh-body: 1.75; --serif: "Alegreya", "Alegreya Fallback", var(--sys-zh); }   /* about 40 characters a line; CJK needs more leading than Latin */
html[lang="zh-Hans"] body { font-family: "Alegreya", "Alegreya Fallback", var(--sys-zh); font-variant-numeric: lining-nums; }
/* no hanging-punctuation: on WebKit a hanging 。 at the end of a lede line adds 5px of horizontal scroll at 390 (27 Oct test) */
/* the face is named here, not through a variable: tools/subset-fonts.py reads this rule to know which text needs WenKai glyphs */
html[lang="zh-Hans"] h1, html[lang="zh-Hans"] h2, html[lang="zh-Hans"] .page-head h1 { font-family: "Alegreya", "LXGW WenKai", "WenKai Fallback", "Kaiti SC", "STKaiti", "KaiTi", "BiauKai", var(--sys-zh); font-weight: 500; letter-spacing: .02em; font-synthesis: none; }
html[lang="zh-Hans"] .page-head h1 { max-width: 16em; }                 /* 20ch of Latin is about 10 Chinese characters; a title wants 14–16 */
html[lang="zh-Hans"] .lede, html[lang="zh-Hans"] .sb-answer { max-width: 30em; }
html[lang="zh-Hans"] .lede-more { max-width: var(--measure); }
html[lang="zh-Hans"] .kp__q, html[lang="zh-Hans"] b, html[lang="zh-Hans"] strong { font-weight: 600; }
/* uppercase tracked labels are Latin on every page (KEY POINTS, the group labels); when a label is Chinese the tracking stays, the case rule does nothing */

/* ---------- Japanese ---------- */
html[lang="ja"] { --fs-body: 17px; --lh-body: 1.85; --measure: 40em; --serif: "Alegreya", "Alegreya Fallback", var(--sys-ja); }
html[lang="ja"] body { font-family: "Alegreya", "Alegreya Fallback", var(--sys-ja); line-break: strict; font-variant-numeric: lining-nums; }
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3, html[lang="ja"] .page-head h1 { font-family: "Alegreya", "Alegreya Fallback", var(--sys-ja); letter-spacing: .01em; }
html[lang="ja"] .page-head h1 { max-width: 16em; }
html[lang="ja"] .lede, html[lang="ja"] .sb-answer { max-width: 30em; }

/* ---------- Korean ---------- */
html[lang="ko"] { --fs-body: 17px; --lh-body: 1.7; --measure: 40em; --serif: "Alegreya", "Alegreya Fallback", var(--sys-ko); }
html[lang="ko"] body { font-family: "Alegreya", "Alegreya Fallback", var(--sys-ko); word-break: keep-all; overflow-wrap: anywhere; font-variant-numeric: lining-nums; }
html[lang="ko"] h1, html[lang="ko"] h2, html[lang="ko"] h3, html[lang="ko"] .page-head h1 { font-family: "Alegreya", "Alegreya Fallback", var(--sys-ko); letter-spacing: -0.01em; }
html[lang="ko"] .page-head h1 { max-width: 18em; }
html[lang="ko"] .lede, html[lang="ko"] .sb-answer { max-width: 32em; }

/* ---------- Spanish, Portuguese: Alegreya as on the English pages; longer words, so headings may hyphenate ---------- */
html[lang="es"] .page-head h1, html[lang="pt-BR"] .page-head h1 { max-width: 22ch; }

/* Header panels on the editions anchor to the right edge of their group name, the first group included (style.css anchors only the
   groups after the first). The edition labels carry the "(English)" tag until a page is translated, so the first panel is wider than
   its English counterpart and the nav sits further right behind shorter group names; left-anchored it ran past 1440 and gave the
   page a horizontal scrollbar even while hidden (27 Oct, seen on /zh-hans/bosses). */
.nav-group > .nav-panel { left: auto; right: -24px; }
