/*
 * 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) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  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;
  color: inherit !important;
  font: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
  white-space: nowrap !important;
}

.text-flow-line,
.phrase-line,
.title-line,
.detail-title-line,
.introduction-title__line,
.introduction-title__mobile-line,
.strengths-title__line {
  display: block;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}

[data-text-flow="manual"] {
  text-wrap: wrap !important;
}

.centered :is(.text-flow-line, .phrase-line),
.detail-section-heading--center :is(.text-flow-line, .phrase-line),
.contact-cta :is(.text-flow-line, .phrase-line),
.detail-cta :is(.text-flow-line, .phrase-line) {
  margin-inline: auto;
}

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

:where(main, #SITE_PAGES) img[data-face-focus] {
  object-position: var(--face-focus, 50% 50%);
}

@media (max-width: 900px) {
  :where(main, #SITE_PAGES) .text-link {
    max-width: 100%;
    gap: 12px;
    white-space: nowrap;
  }
}
