/*
 * Shared Japanese text-flow rules.
 *
 * Every public page loads this file after its page-specific styles. The paired
 * text-flow.js wraps words without inserting visible characters, so Chromium
 * and WebKit keep the same Japanese words intact even when their phrase
 * segmentation algorithms disagree.
 */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:where(main, #SITE_PAGES) :is(h1, h2, h3, h4, p, li, summary, figcaption, dt, dd) {
  line-break: strict;
  overflow-wrap: normal;
  text-wrap: pretty !important;
  word-break: normal !important;
}

.text-flow-word,
.applied-keep-word,
[data-no-break] {
  display: inline-block !important;
  white-space: nowrap !important;
}

.text-flow-line {
  display: inline;
}

:where(main, #SITE_PAGES) :is(.contact-mail, a[href^="mailto:"]) {
  white-space: nowrap;
}

@media (max-width: 900px) {
  [data-text-flow="manual"] > .text-flow-line {
    display: block;
  }

  :where(main, #SITE_PAGES) .text-link {
    max-width: 100%;
    flex-wrap: wrap;
    column-gap: 12px;
    white-space: normal;
  }
}
