/*
 * Loaded only for Chinese (zh) and Korean (ko).
 * Glyphs come from the reader's system CJK font: the page fonts have no Han or
 * Hangul glyphs, and the lang attribute makes the browser pick the right
 * regional fallback. This file only fixes line breaking and Latin-tuned spacing.
 */

/* Korean wraps between words, never inside one. */
html[lang="ko"] body {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Chinese: keep closing punctuation off the start of a line. */
html[lang^="zh"] body {
  line-break: strict;
  overflow-wrap: break-word;
}

/* Tracking and forced uppercase are tuned for Latin text and hurt CJK legibility. */
html[lang^="zh"] h1,
html[lang^="zh"] h2,
html[lang^="zh"] h3,
html[lang^="zh"] h4,
html[lang="ko"] h1,
html[lang="ko"] h2,
html[lang="ko"] h3,
html[lang="ko"] h4 {
  letter-spacing: 0;
}

/* Code and mono islands keep Latin wrapping rules. */
html[lang^="zh"] code,
html[lang^="zh"] pre,
html[lang="ko"] code,
html[lang="ko"] pre {
  word-break: normal;
  line-break: auto;
}
