/**
 * Vocabulary Exhibition — word → phrase → full verse rebuild.
 * Enable: exhibitProfile vocabularyExhibition + typography mobile-refine
 */

.exhibition-root.is-vocabulary-exhibition {
  /* Match foundations / assisted-reading legibility on gallery artwork */
  --kml-vocab-jp: var(--kml-foundations-exhibition-verse-jp);
  --kml-vocab-en: var(--kml-foundations-exhibition-verse-en);
  /* Single-word / reading steps — between verse and foundations kanji */
  --kml-vocab-word: clamp(4.5rem, 15vmin, 9rem);
  --kml-vocab-shadow-jp:
    0 1px 3px rgba(0, 0, 0, 0.78),
    0 3px 20px rgba(0, 0, 0, 0.62),
    0 0 36px rgba(0, 0, 0, 0.45);
  --kml-vocab-shadow-en:
    0 1px 3px rgba(0, 0, 0, 0.72),
    0 3px 16px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(0, 0, 0, 0.4);
}

.exhibition-root.is-vocabulary-exhibition .exhibition-keyword,
.exhibition-root.is-vocabulary-exhibition .exhibition-kanji,
.exhibition-root.is-vocabulary-exhibition .exhibition-title {
  display: none !important;
}

.exhibition-root.is-vocabulary-exhibition .exhibition-veil {
  opacity: 0 !important;
  pointer-events: none;
}

.exhibition-root.is-vocabulary-exhibition.is-initial-black .exhibition-veil {
  opacity: 1 !important;
}

.exhibition-root.is-vocabulary-exhibition .exhibition-artwork {
  /* Extra bleed — long holds must stay edge-to-edge during guardian drift */
  inset: -14%;
  transition: opacity var(--ex-artwork-arrival, var(--ex-transition, 3.5s)) ease-in-out;
}

.exhibition-root.is-vocabulary-exhibition .exhibition-artwork.is-exhaling {
  transition-duration: var(--ex-transition, 3.5s);
  transition-timing-function: ease-in-out;
  opacity: 0;
}

.exhibition-root.is-vocabulary-exhibition .exhibition-artwork.is-on-top {
  z-index: 2;
}

.exhibition-root.is-vocabulary-exhibition .exhibition-notes {
  top: 50%;
  bottom: auto;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(96vw, 48rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85em;
  min-height: 4rem;
}

html.kml-typography-mobile-refine.kml-verse-sequential
  .exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-jp {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 clamp(0.5rem, 2vw, 1rem);
  text-align: center;
  transform: none !important;
  font-size: var(--kml-vocab-jp);
  font-family: var(--kml-font-heart-verse-jp);
  font-weight: 600;
  color: rgba(255, 252, 245, 0.98);
  text-shadow: var(--kml-vocab-shadow-jp);
  transition: opacity var(--ex-verse-fade, 1.4s) ease-in-out;
  line-height: 1.68;
  opacity: 0;
}

html.kml-typography-mobile-refine.kml-verse-sequential
  .exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-jp.is-visible {
  opacity: 1;
}

html.kml-typography-mobile-refine.kml-verse-sequential
  .exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-en {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0 clamp(0.75rem, 3vw, 1.5rem);
  text-align: center;
  transform: none !important;
  font-family: var(--kml-font-heart-voice);
  font-size: var(--kml-vocab-en);
  font-weight: 500;
  font-style: italic;
  line-height: 1.55;
  letter-spacing: 0.02em;
  white-space: pre-line;
  color: var(--kml-color-verse-en);
  text-shadow: var(--kml-vocab-shadow-en);
  opacity: 0;
  transition: opacity var(--ex-verse-fade, 1.4s) ease-in-out;
}

html.kml-typography-mobile-refine.kml-verse-sequential
  .exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-en.is-visible {
  opacity: 1;
}

/* Final verse reveal — same JP / EN sizes as vocabulary steps */
html.kml-typography-mobile-refine.kml-verse-authored
  .exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-jp.is-vocab-verse-reveal.has-authored-lines
  .kml-verse-line {
  display: block;
  /* text-wrap:unset after nowrap resets wrap mode in Chromium (shorthand split) */
  white-space: nowrap;
  text-wrap: nowrap;
}

html.kml-typography-mobile-refine.kml-verse-authored
  .exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-jp.is-vocab-verse-reveal.has-authored-lines
  .kml-verse-line
  + .kml-verse-line {
  margin-top: 0.42em;
}

html.kml-typography-mobile-refine.kml-verse-authored
  .exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-jp.is-vocab-verse-reveal.has-authored-lines
  br {
  display: none;
}

.exhibition-root.is-vocabulary-exhibition .exhibition-verse-jp.is-vocab-verse-reveal.show-furigana ruby {
  ruby-position: over;
}

.exhibition-root.is-vocabulary-exhibition .exhibition-verse-jp.show-furigana ruby {
  ruby-position: over;
}

.exhibition-root.is-vocabulary-exhibition .exhibition-verse-jp.show-furigana ruby rt {
  font-family: var(--kml-font-heart-verse-jp);
  font-size: 0.46em;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-shadow: var(--kml-vocab-shadow-jp);
  transition: opacity var(--ex-furigana-fade, 2.2s) ease-in-out;
}

.exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-jp.show-furigana.is-furigana-hidden
  ruby
  rt,
.exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-jp.show-furigana.is-furigana-entering
  ruby
  rt {
  opacity: 0;
}

.exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-jp.show-furigana:not(.is-furigana-hidden):not(.is-furigana-fading):not(
    .is-furigana-entering
  )
  ruby
  rt {
  opacity: 1;
}

.exhibition-root.is-vocabulary-exhibition .exhibition-verse-jp.show-furigana.is-furigana-fading ruby rt {
  opacity: 0;
}

.exhibition-root.is-vocabulary-exhibition .exhibition-verse-jp.is-vocab-verse-reveal.show-furigana ruby rt {
  font-family: var(--kml-font-heart-verse-jp);
  font-size: 0.46em;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-shadow: var(--kml-vocab-shadow-jp);
}

/* Verse vs everyday readings — same JP size as all other Japanese */
html.kml-typography-mobile-refine
  .exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-jp.has-vocab-readings {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55em;
}

html.kml-typography-mobile-refine
  .exhibition-root.is-vocabulary-exhibition
  .kml-vocab-jp-main {
  display: block;
  font-size: var(--kml-vocab-jp);
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 252, 245, 0.98);
  text-shadow: var(--kml-vocab-shadow-jp);
}

html.kml-typography-mobile-refine
  .exhibition-root.is-vocabulary-exhibition
  .kml-vocab-reading-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28em;
  font-family: var(--kml-font-heart-verse-jp);
  font-size: var(--kml-vocab-jp);
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.04em;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: var(--kml-vocab-shadow-jp);
}

html.kml-typography-mobile-refine
  .exhibition-root.is-vocabulary-exhibition
  .kml-vocab-reading-row {
  display: block;
}

html.kml-typography-mobile-refine
  .exhibition-root.is-vocabulary-exhibition
  .kml-vocab-reading-label {
  font-style: italic;
  opacity: 0.72;
  margin-right: 0.35em;
}

html.kml-typography-mobile-refine.kml-verse-sequential
  .exhibition-root.is-vocabulary-exhibition
  .exhibition-verse-jp:not(.show-furigana):not(.is-vocab-verse-reveal):not(.has-vocab-readings) {
  font-size: var(--kml-vocab-word);
  line-height: 1.22;
}

html.kml-typography-mobile-refine
  .exhibition-root.is-vocabulary-exhibition
  .kml-vocab-jp-main {
  font-size: var(--kml-vocab-word);
  line-height: 1.15;
}

/* foundations typography — same JP / EN pair as reading exhibitions */
html.kml-typography-mobile-refine
  .exhibition-root.is-vocabulary-exhibition.is-foundations-typography
  .exhibition-verse-jp,
html.kml-typography-mobile-refine
  .exhibition-root.is-vocabulary-exhibition.is-foundations-typography
  .exhibition-verse-jp.is-vocab-verse-reveal {
  font-size: var(--kml-vocab-jp);
}

html.kml-typography-mobile-refine.kml-verse-sequential
  .exhibition-root.is-vocabulary-exhibition.is-foundations-typography
  .exhibition-verse-en,
html.kml-typography-mobile-refine.kml-verse-sequential
  .exhibition-root.is-vocabulary-exhibition.is-foundations-typography
  .exhibition-verse-en.is-vocab-verse-reveal {
  font-size: var(--kml-vocab-en);
}
