/* ── Line breaking, per language ──────────────────────────────────────────────
   Browsers break Korean at any character, because CJK normally has no spaces to
   break at. Korean does have them, so the default chops words in half and drops a
   single syllable onto the next line — legible, but it reads as broken typesetting,
   and on a narrow column it happens in almost every paragraph.

   keep-all breaks only at spaces, which is the correct rule for Korean. It is NOT
   correct for Chinese or Japanese: with no spaces to break at, keep-all makes a long
   line overflow its container instead of wrapping, so this is scoped to lang="ko"
   alone rather than applied to CJK as a group.

   overflow-wrap rides along so the one thing keep-all cannot break — an unbroken
   token longer than the column, typically a URL — still wraps instead of overflowing.

   Scoped to the html element's lang attribute, which every page sets from the URL
   prefix, so it follows the reader's language and never touches the English pages. */
html[lang="ko"] body {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Table cells are the narrowest columns on the site and the place mid-word breaks
   were most visible; they inherit the rule, but spell it out so a future
   `word-break: break-all` on a table does not silently win by specificity. */
html[lang="ko"] td,
html[lang="ko"] th,
html[lang="ko"] li,
html[lang="ko"] h1,
html[lang="ko"] h2,
html[lang="ko"] h3,
html[lang="ko"] h4 {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ── Orphans ─────────────────────────────────────────────────────────────────
   keep-all stops a word being split, but it cannot stop a short last word being
   left alone on its own line — "문항 수" broke correctly at the space and still
   read as broken, because "수" is one syllable sitting by itself.

   balance distributes a heading's words evenly across its lines instead of filling
   the first line and dropping the remainder, which removes the orphan without any
   per-string hand-tuning. pretty does the milder version for body copy: it only
   avoids leaving a single word on the last line.

   Both are progressive — a browser that does not know them ignores the declaration
   and gets today's behaviour, so there is nothing to fall back to. Applied to every
   language: an English heading ending on a lone "the" reads just as badly. */
h1, h2, h3, h4,
.card-body h3,
.blog-card-title {
  text-wrap: balance;
}

p, li, .blog-summary {
  text-wrap: pretty;
}
