/* ==========================================================================
   i18n layer — language switcher + per-language typography.
   Additive only: nothing here overrides the original palette or layout.
   No webfont is loaded; every stack is local system fonts.
   ========================================================================== */

/* ---------- header: online pill + language switch share one flex slot ---------- */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lang-switch {
  position: relative;
  flex: 0 0 auto;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 20px rgba(134, 54, 87, .1);
  color: #744256;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background .18s ease, box-shadow .18s ease;
}

.lang-btn:hover {
  background: #fff;
  box-shadow: 0 10px 24px rgba(134, 54, 87, .16);
}

.lang-btn:focus-visible {
  outline: 2px solid #ff4d8d;
  outline-offset: 2px;
}

.lang-globe {
  font-size: 13px;
  line-height: 1;
}

.lang-code {
  letter-spacing: .02em;
}

.lang-switch.open .lang-btn {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 77, 141, .35), 0 12px 26px rgba(134, 54, 87, .18);
}

/* ---------- dropdown ---------- */
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 200;
  min-width: 152px;
  padding: 6px;
  display: grid;
  gap: 2px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(160, 54, 96, .24), 0 2px 6px rgba(160, 54, 96, .12);
  animation: lang-menu-in .16s ease both;
}

.lang-menu[hidden] {
  display: none;
}

/* transform only: if a browser freezes the animation the panel still renders
   opaque, instead of sitting invisible at opacity:0 */
@keyframes lang-menu-in {
  from { transform: translateY(-6px); }
  to   { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lang-menu { animation: none; }
}

.lang-menu button {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #3a1727;
  font: inherit;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.lang-menu button:hover {
  background: #ffe8f1;
}

.lang-menu button.on {
  background: #ffd9e7;
  color: #d82f72;
  font-weight: 800;
}

.lang-menu button:focus-visible {
  outline: 2px solid #ff4d8d;
  outline-offset: -2px;
}

/* ---------- per-language font stacks (all local) ---------- */
html[lang="ja"] body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic",
    Meiryo, "Noto Sans JP", "Noto Sans CJK JP", Inter, Arial, sans-serif;
}

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

html[lang="hi"] body {
  font-family: "Nirmala UI", "Noto Sans Devanagari", "Kohinoor Devanagari", Mangal,
    Inter, Arial, sans-serif;
}

/* Devanagari sits taller on the line: give the hero and tags room */
html[lang="hi"] .hero-copy h1 {
  letter-spacing: 0;
  line-height: 1.2;
}

html[lang="hi"] .tag {
  font-size: 11.5px;
  line-height: 1.35;
}

html[lang="hi"] .tg span {
  font-size: 10px;
}

/* CJK tracking: the −2px display tracking of the source squeezes kana/hangul */
html[lang="ja"] .hero-copy h1,
html[lang="ko"] .hero-copy h1 {
  letter-spacing: -.4px;
  line-height: 1.1;
}

/* the source forces overflow-wrap:anywhere on mobile, which splits Korean words
   mid-syllable — keep words whole and let the container wrap between them */
html[lang="ko"] .hero-copy h1,
html[lang="ko"] .hero-copy p,
html[lang="ko"] .ft,
html[lang="ko"] .fs,
html[lang="ko"] .urgency .txt,
html[lang="ko"] .foot-hint,
html[lang="ko"] .cta {
  word-break: keep-all;
  overflow-wrap: break-word;
}

html[lang="ja"] .hero-copy h1,
html[lang="ja"] .cta {
  word-break: normal;
  line-break: strict;
}

/* the sticky CTA must survive longer French/Hindi/Hangul strings */
.cta {
  height: auto;
  min-height: 58px;
  padding: 8px 14px;
  line-height: 1.15;
  text-align: center;
}

html[lang="fr"] .cta,
html[lang="hi"] .cta,
html[lang="ko"] .cta,
html[lang="ja"] .cta {
  font-size: 16px;
}

@media (max-width: 620px) {
  html[lang="fr"] .cta,
  html[lang="hi"] .cta,
  html[lang="ko"] .cta,
  html[lang="ja"] .cta {
    font-size: 14px;
  }

  .cta {
    min-height: 56px;
  }
}

/* ---------- small screens: keep the header on one line ---------- */
@media (max-width: 430px) {
  .lang-globe {
    display: none;
  }

  .lang-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .header-right {
    gap: 6px;
  }
}

@media (max-width: 360px) {
  .online-pill {
    font-size: 10px;
    padding: 7px 8px;
  }

  .logo {
    font-size: 18px;
  }
}
