/* Shared language roles for the application and the standalone How We Work frame. */
@font-face {
  font-family: "Seoul English Hand";
  src: url("/fonts/caveat-latin-variable.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root[lang="zh-Hans"], [lang="zh-Hans"] {
  --locale-sans: "Noto Sans SC";
  --locale-serif: "Noto Serif SC";
  --locale-hand: "Ma Shan Zheng", "Seoul English Hand";
}
:root[lang="th"], [lang="th"] {
  --locale-sans: "Noto Sans Thai";
  --locale-serif: "Noto Serif Thai";
  --locale-hand: "Charm";
}
:root[lang="vi"], [lang="vi"] {
  --locale-sans: "Be Vietnam Pro";
  --locale-serif: "Lora";
  --locale-hand: "Patrick Hand";
}

:root:is([lang="zh-Hans"], [lang="th"], [lang="vi"]),
:root:is([lang="zh-Hans"], [lang="th"], [lang="vi"])[data-palette][data-typography] {
  --sans: var(--locale-sans), system-ui, sans-serif;
  --display: var(--locale-serif), Georgia, serif;
}

/* Explicit English passages retain the original editorial voices. */
[lang="en"] {
  --locale-sans: initial;
  --locale-serif: initial;
  --locale-hand: initial;
  --sans: "Pretendard Variable", Sans, system-ui, sans-serif;
  --serif: var(--font-display, Fraunces), Georgia, serif;
  --hand: "Seoul English Hand", cursive;
}
html :is(h1, h2, h3)[lang="en"] {
  font-family: var(--font-display, Fraunces), Georgia, serif;
}
/* The footer inherits body type, so resetting tokens alone is insufficient. */
html footer[lang="en"], .site-header .desktop-navigation, .site-header .header-assessment, .mobile-navigation a[lang="en"] {
  font-family: "Pretendard Variable", Sans, system-ui, sans-serif;
}
[lang="zh-Hans"] > span[lang="zh-Hans"], span[lang="zh-Hans"],
span[lang="th"], span[lang="vi"] {
  font-family: var(--locale-sans), system-ui, sans-serif;
}

/* Stacked accents need room; Latin display tracking must not squeeze Thai/CJK. */
html[lang="zh-Hans"] :is(h2,h3):lang(zh-Hans),
html[lang="th"] :is(h2,h3):lang(th) {
  line-height: 1.4;
  letter-spacing: 0;
}
html[lang="vi"] :is(h2,h3):lang(vi) { line-height: 1.22; }
html:is([lang="th"],[lang="vi"]) :is(.art-note,.chapter-meta,.ink-notes li,.home-connection strong,.care-roles dt) {
  line-height: 1.4;
}
