/*
 * kkbc-cjk-break-1.css - line breaks of Korean, Japanese and Chinese headings and paragraphs (finding H4, 2026-10-13).
 * Loaded after the other stylesheets of the theme. Only :lang() selectors: nothing changes on a page of another language.
 * No older .css or .js file was changed. A later change gets a new file name (kkbc-cjk-break-2.css): the CDN keeps
 * a file under its old name. No !important is used. No font size is changed.
 *
 * The library BudouX (framework/budoux/0.7.0, four script tags printed by a plugin snippet after the footer scripts)
 * is loaded on every page, but no page uses it: no <budoux-ja> element and no parser.applyToElement call is in the
 * theme or in the pages read on 2026-10-13. These rules give the same help with CSS, without a script.
 */

/* Korean: a break only at a space, never inside a word. A word that is wider than its box still breaks
   (overflow-wrap), so a page never becomes wider than the screen. The old rules (css/kkbc-heading-wrap-1.css:17-19,
   css/kkbc-overflow-2.css:40, 72, 103) set only overflow-wrap and are not changed. */
:lang(ko) h1, :lang(ko) h2, :lang(ko) h3, :lang(ko) h4, :lang(ko) h5, :lang(ko) h6, :lang(ko) p {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* Japanese and Chinese: strict rules for the start of a line (no closing mark, no small kana, no long-vowel mark
   at the start). */
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ja) h4, :lang(ja) h5, :lang(ja) h6, :lang(ja) p,
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) h4, :lang(zh) h5, :lang(zh) h6, :lang(zh) p {
  line-break: strict;
}

/* Headings only: break at the border of a phrase, and balance the lines (no line of one character). A browser that
   does not know a value ignores that line; the line above stays. */
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ja) h4, :lang(ja) h5, :lang(ja) h6,
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3, :lang(zh) h4, :lang(zh) h5, :lang(zh) h6 {
  word-break: auto-phrase;
  text-wrap: balance;
}
