﻿/* =========================================================
   NOCTURNE — language selector + locale typography
   ========================================================= */

.lang-switch {
  position: relative;
  z-index: 5;
}

.lang-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  transition:
    color 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease;
}

.lang-trigger > svg:first-child {
  width: 14px;
  height: 14px;
  opacity: 0.82;
}

#lang-current {
  min-width: 17px;
  text-align: center;
}

.lang-chevron {
  width: 10px;
  height: 10px;
  opacity: 0.55;
  transition: transform 0.25s ease;
}

.lang-trigger:hover,
.lang-switch.is-open .lang-trigger {
  border-color: rgba(255, 229, 205, 0.48);
  background: rgba(255, 236, 220, 0.07);
  color: var(--ink);
}

.lang-switch.is-open .lang-chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 95;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 320px;
  max-height: min(430px, 70vh);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(255, 230, 206, 0.22);
  border-radius: 8px;
  background: #3b0b15;
  box-shadow: 0 24px 64px rgba(35, 4, 9, 0.46);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition:
    opacity 0.2s ease,
    transform 0.25s var(--ease);
}

.lang-switch.is-open .lang-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  color: #f1d7c8;
  background: transparent;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  text-align: start;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.lang-option:hover {
  color: #fff7ef;
  background: rgba(255, 237, 222, 0.08);
}

.lang-option[aria-selected="true"] {
  color: #fff7ef;
  background: rgba(255, 232, 213, 0.13);
}

.lang-option small {
  flex-shrink: 0;
  color: #c99587;
  font-size: 7px;
  letter-spacing: 0.1em;
}

.lang-option[aria-selected="true"] small {
  color: var(--gold-bright);
}

/* ---------------------------------------------------------
   Locale typography
   --------------------------------------------------------- */

html[lang="zh"] {
  --serif: "Songti SC", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

html[lang="ja"] {
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "Yu Gothic", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

html[lang="ko"] {
  --serif: "Batang", "Noto Serif KR", serif;
  --sans: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

html[lang="ar"] {
  --serif: "Noto Naskh Arabic", "Traditional Arabic", "Times New Roman", serif;
  --sans: "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
}

html[lang="hi"] {
  --serif: "Nirmala UI", "Noto Serif Devanagari", "Times New Roman", serif;
  --sans: "Nirmala UI", "Noto Sans Devanagari", "Segoe UI", sans-serif;
}

html[lang="ru"] {
  --sans: "Manrope", "Segoe UI", Arial, sans-serif;
}

/* Keep the brand and the English show titles in the display face. */
.brand-name,
.rank-title,
.new-title {
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

html:not([lang="en"]) .hero-copy h1 {
  font-size: clamp(50px, 7.2vw, 98px);
}

html[lang="zh"] .hero-copy h1,
html[lang="ja"] .hero-copy h1,
html[lang="ko"] .hero-copy h1 {
  letter-spacing: 0;
  line-height: 1.08;
}

html[lang="zh"] .hero-copy h1 em,
html[lang="ja"] .hero-copy h1 em,
html[lang="ko"] .hero-copy h1 em,
html[lang="ar"] .hero-copy h1 em,
html[lang="hi"] .hero-copy h1 em {
  font-style: normal;
}

html[lang="ar"] .hero-copy h1,
html[lang="hi"] .hero-copy h1 {
  line-height: 1.2;
}

html[lang="zh"] .download-content h2,
html[lang="ja"] .download-content h2,
html[lang="ko"] .download-content h2,
html[lang="ar"] .download-content h2,
html[lang="hi"] .download-content h2 {
  line-height: 1.16;
  letter-spacing: 0;
}

html[lang="zh"] .download-content h2 em,
html[lang="ja"] .download-content h2 em,
html[lang="ko"] .download-content h2 em,
html[lang="ar"] .download-content h2 em,
html[lang="hi"] .download-content h2 em {
  font-style: normal;
}

html[lang="zh"] .section-heading h2,
html[lang="ja"] .section-heading h2,
html[lang="ko"] .section-heading h2,
html[lang="ar"] .section-heading h2,
html[lang="hi"] .section-heading h2 {
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------
   RTL
   --------------------------------------------------------- */

[dir="rtl"] .hero-wash {
  transform: scaleX(-1);
}

[dir="rtl"] .hero-glow {
  right: auto;
  left: -6%;
}

[dir="rtl"] .hero-copy {
  text-align: right;
}

[dir="rtl"] .hero-stat {
  align-items: flex-start;
  text-align: left;
}

[dir="rtl"] .hero-copy h1,
[dir="rtl"] .download-content h2 {
  letter-spacing: 0;
}

[dir="rtl"] .hero-copy h1 {
  line-height: 1.15;
}

[dir="rtl"] .hero-topline,
[dir="rtl"] .eyebrow,
[dir="rtl"] .stat-label,
[dir="rtl"] .hero-bottomline,
[dir="rtl"] .section-aside p,
[dir="rtl"] .download-note,
[dir="rtl"] .footer-label,
[dir="rtl"] .footer-bottom,
[dir="rtl"] .mobile-sticky > span {
  letter-spacing: 0;
}

[dir="rtl"] .brand-sub,
[dir="rtl"] .button,
[dir="rtl"] .header-app,
[dir="rtl"] .lang-trigger,
[dir="rtl"] .rank-action,
[dir="rtl"] .new-tag,
[dir="rtl"] .download-button,
[dir="rtl"] .mobile-sticky > a,
[dir="rtl"] .footer-nav a,
[dir="rtl"] .footer-meta a,
[dir="rtl"] .footer-meta > span:not(.footer-label) {
  letter-spacing: 0;
}

[dir="rtl"] .button svg {
  transform: scaleX(-1);
}

[dir="rtl"] .button:hover svg {
  transform: scaleX(-1) translateX(-3px);
}

[dir="rtl"] .rank-info,
[dir="rtl"] .new-caption {
  text-align: right;
}

[dir="rtl"] .new-tag {
  right: 15px;
  left: auto;
}

[dir="rtl"] .new-play {
  right: auto;
  left: 14px;
}

[dir="rtl"] .lang-menu {
  text-align: start;
}

/* ---------------------------------------------------------
   Locale responsive
   --------------------------------------------------------- */

@media (min-width: 761px) {
  html:not([lang="en"]) .hero-card {
    height: auto;
    min-height: clamp(580px, 70svh, 680px);
  }

  html:not([lang="en"]) .hero-inner {
    min-height: clamp(580px, 70svh, 680px);
  }

  html:not([lang="en"]) .download-content h2 {
    font-size: clamp(44px, 5.4vw, 66px);
  }
}

@media (max-width: 760px) {
  .header-right {
    gap: 9px;
  }

  .lang-trigger {
    height: 35px;
    padding: 0 9px;
    gap: 6px;
    font-size: 8px;
  }

  .lang-trigger > svg:first-child {
    width: 13px;
    height: 13px;
  }

  .lang-menu {
    position: fixed;
    top: 76px;
    inset-inline: 14px;
    width: auto;
    max-height: min(68vh, 420px);
    padding: 9px;
  }

  .header-app {
    width: 35px;
    height: 35px;
    padding: 0;
    gap: 0;
    justify-content: center;
  }

  .header-app span {
    display: none;
  }

  .header-app svg {
    width: 15px;
    height: 15px;
  }

  html:not([lang="en"]) .hero-copy h1 {
    font-size: clamp(42px, 12.4vw, 60px);
    line-height: 1.06;
  }

  html[lang="ar"] .hero-copy h1,
  html[lang="hi"] .hero-copy h1 {
    line-height: 1.2;
  }

  html[lang="zh"] .hero-copy h1,
  html[lang="ja"] .hero-copy h1,
  html[lang="ko"] .hero-copy h1 {
    line-height: 1.1;
  }

  html:not([lang="en"]) .download-content h2 {
    font-size: clamp(34px, 9.4vw, 48px);
  }

  .lang-option {
    min-height: 40px;
    font-size: 10px;
  }
}

@media (max-width: 370px) {
  .lang-trigger {
    height: 34px;
    padding: 0 8px;
  }

  #lang-current,
  .lang-chevron {
    display: none;
  }

  .lang-trigger {
    width: 34px;
  }
}
