.language-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  z-index: 20;
  color: inherit;
}

.language-switcher-trigger {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.9;
  transform: scale(1);
  transform-origin: center;
  transition: opacity 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.language-switcher-trigger:hover {
  color: var(--gold-dark, var(--gold-deep, #9a7547));
  opacity: 1;
  transform: scale(1.14);
}

.language-switcher-trigger:focus-visible,
.language-switcher-option:focus-visible {
  outline: 1px solid var(--gold-dark, var(--gold-deep, #9a7547));
  outline-offset: 3px;
}

.language-switcher-globe {
  width: 20px;
  height: 20px;
  display: block;
  color: inherit;
  fill: none;
  stroke: currentColor;
  stroke-width: 0.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero .language-switcher-globe {
  stroke-width: 1.1;
}

.language-switcher-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  right: auto;
  width: max-content;
  display: grid;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: flex-start;
  gap: 2px 20px;
  padding: 6px 0 2px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  opacity: 0;
  visibility: hidden;
  transform: translate(calc(-50% + var(--language-menu-shift-x, 0px)), -3px);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
}

.language-switcher.is-open .language-switcher-menu {
  opacity: 1;
  visibility: visible;
  transform: translate(calc(-50% + var(--language-menu-shift-x, 0px)), 0);
}

.language-switcher-option {
  width: auto;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: inherit;
  letter-spacing: 0.16em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  opacity: 0.9;
  transform: scale(1);
  transform-origin: left center;
  transition: opacity 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

.language-switcher-option:hover {
  color: var(--gold-dark, var(--gold-deep, currentColor));
  opacity: 1;
  transform: scale(1.14);
}

/* L'accueil conserve le traitement propre à son menu superposé à l'image. */
.hero .language-switcher-trigger:hover,
.hero .language-switcher-option:hover {
  color: inherit;
}

.language-switcher-flag {
  width: 15px;
  height: 10px;
  display: block;
  flex: 0 0 auto;
  opacity: 0.82;
  filter: saturate(0.72);
}

.header-inner.is-nav-vertical .language-switcher {
  position: absolute;
  top: var(--language-switcher-responsive-top, 4px);
  right: var(--language-switcher-responsive-right, 164px);
  left: auto;
  margin: 0;
}

/* Les caractères latins conservent l'identité typographique du site ;
   les familles locales prennent uniquement le relais pour leurs glyphes. */
html[lang="ja"] body {
  font-family: "Manrope", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}

html[lang="el"] body {
  font-family: "Manrope", "Noto Sans", "Arial", sans-serif;
}

html[lang="ko"] body {
  font-family: "Manrope", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

html[lang="zh-cn"] body {
  font-family: "Manrope", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html[lang="ja"] h1:not(.artwork-title),
html[lang="ja"] h2,
html[lang="ja"] h3,
html[lang="ja"] blockquote,
html[lang="ja"] .hero-main-title,
html[lang="ja"] .hero-subtitle,
html[lang="ja"] .section-title,
html[lang="ja"] .intention-title,
html[lang="ja"] .quote-text {
  font-family: "Cormorant Garamond", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  letter-spacing: 0.035em;
}

html[lang="el"] h1:not(.artwork-title),
html[lang="el"] h2,
html[lang="el"] h3,
html[lang="el"] blockquote,
html[lang="el"] .hero-main-title,
html[lang="el"] .hero-subtitle,
html[lang="el"] .section-title,
html[lang="el"] .intention-title,
html[lang="el"] .quote-text {
  font-family: "Cormorant Garamond", "Noto Serif", serif;
  letter-spacing: 0.035em;
}

html[lang="ko"] h1:not(.artwork-title),
html[lang="ko"] h2,
html[lang="ko"] h3,
html[lang="ko"] blockquote,
html[lang="ko"] .hero-main-title,
html[lang="ko"] .hero-subtitle,
html[lang="ko"] .section-title,
html[lang="ko"] .intention-title,
html[lang="ko"] .quote-text {
  font-family: "Cormorant Garamond", "Nanum Myeongjo", "Noto Serif KR", serif;
  letter-spacing: 0.035em;
}

html[lang="zh-cn"] h1:not(.artwork-title),
html[lang="zh-cn"] h2,
html[lang="zh-cn"] h3,
html[lang="zh-cn"] blockquote,
html[lang="zh-cn"] .hero-main-title,
html[lang="zh-cn"] .hero-subtitle,
html[lang="zh-cn"] .section-title,
html[lang="zh-cn"] .intention-title,
html[lang="zh-cn"] .quote-text {
  font-family: "Cormorant Garamond", "Songti SC", "STSong", "Noto Serif SC", serif;
  letter-spacing: 0.035em;
}

.language-switcher-option:is([data-language="ja"], [data-language="ko"], [data-language="zh-cn"]) {
  text-transform: none;
  letter-spacing: 0.08em;
}

/* Ces écritures ont une densité visuelle plus forte que les titres latins. */
:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .hero-main-title {
  font-size: clamp(34px, 3.2vw, 44px);
  line-height: 1.08;
}

:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .about-title {
  font-size: clamp(28px, 2.25vw, 36px);
  line-height: 1.12;
}

:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .collections-side .section-title {
  font-size: clamp(28px, 2.3vw, 36px);
  line-height: 1.12;
}

:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .art-card-title {
  font-size: 25px;
  line-height: 1.15;
}

:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .story-title {
  font-size: clamp(28px, 2.2vw, 35px);
  line-height: 1.12;
}

:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .page-hero h1 {
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1.08;
}

:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .chapter h2 {
  font-size: clamp(25px, 2vw, 30px);
  line-height: 1.12;
}

:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .scene-copy h2 {
  font-size: clamp(27px, 2.4vw, 34px);
  line-height: 1.12;
}

:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .closing h2 {
  font-size: clamp(29px, 2.8vw, 38px);
  line-height: 1.1;
}

:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .hero-main-title,
:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .about-title,
:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .collections-side .section-title,
:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .art-card-title,
:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .story-title,
:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .page-hero h1,
:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .chapter h2,
:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .scene-copy h2,
:is(html[lang="ja"], html[lang="ko"], html[lang="zh-cn"]) .closing h2 {
  line-break: strict;
  text-wrap: balance;
}

.header-inner.is-nav-vertical .language-switcher-menu {
  gap: 2px 8px;
}

.header-inner.is-nav-vertical .language-switcher-option {
  gap: 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.header-inner.is-nav-vertical .language-switcher-flag {
  width: 12px;
  height: 8px;
}

@media (max-width: 680px) {
  .header-inner.is-nav-vertical .language-switcher-menu {
    --language-menu-mobile-offset-x: 18px;
    top: 100%;
    grid-template-rows: repeat(6, auto);
    gap: 3px 12px;
    transform: translate(calc(-50% + var(--language-menu-mobile-offset-x) + var(--language-menu-shift-x, 0px)), -3px);
  }

  .header-inner.is-nav-vertical .language-switcher.is-open .language-switcher-menu {
    transform: translate(calc(-50% + var(--language-menu-mobile-offset-x) + var(--language-menu-shift-x, 0px)), 0);
  }

  .language-switcher-option {
    gap: 5px;
    font-size: 12px;
    letter-spacing: 0.06em;
  }

  .language-switcher-flag {
    width: 13px;
    height: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .language-switcher-trigger,
  .language-switcher-menu,
  .language-switcher-option {
    transition: none;
  }
}
