/*
 * Japanese line breaking shared by every public page.
 *
 * Japanese headings must not use English word-wrapping assumptions. Strict
 * kinsoku rules keep punctuation in the right place; balanced wrapping avoids
 * leaving one or two characters on a final line. Browsers that support phrase
 * segmentation get the stronger auto-phrase behaviour progressively.
 */
html:lang(ja) {
  line-break: strict;
}

html:lang(ja) :where(h1, h2, h3, h4, h5, h6, summary) {
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: normal;
}

html:lang(ja) :where(p, li, dd, figcaption) {
  text-wrap: pretty;
}

@supports (word-break: auto-phrase) {
  html:lang(ja) :where(h1, h2, h3, h4, h5, h6, summary) {
    word-break: auto-phrase;
  }
}
