/*
 * Per-locale font & layout adjustments.
 *
 * Loaded ONLY on translated pages — the runtime rewriter (src/lib/i18n/
 * translate.ts) injects this stylesheet and stamps <html data-i18n-locale="xx">.
 * The English site never loads it, so it carries zero cost for the default.
 *
 * The brand faces (Futura PT, DM Sans) cover Latin + Cyrillic but NOT CJK or
 * (fully) Vietnamese, so non-Latin scripts fall back to high-quality system
 * fonts — no extra web-font downloads. Latin bits inside a translated page
 * (brand names like "Walt Disney World") still render in the brand face because
 * it leads each stack and the browser falls through per-glyph.
 */

/* ── Japanese ──────────────────────────────────────────────────────────── */
html[data-i18n-locale="ja"] {
  --font-heading: "Futura PT", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "YuGothic", Meiryo, "Noto Sans JP", sans-serif;
  --font-body: "DM Sans", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "YuGothic", Meiryo, "Noto Sans JP", sans-serif;
}

/* ── Korean ────────────────────────────────────────────────────────────── */
html[data-i18n-locale="ko"] {
  --font-heading: "Futura PT", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  --font-body: "DM Sans", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

/* ── Traditional Chinese (Taiwan) ──────────────────────────────────────── */
html[data-i18n-locale="zh"] {
  --font-heading: "Futura PT", "PingFang TC", "Heiti TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  --font-body: "DM Sans", "PingFang TC", "Heiti TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
}

/* ── Russian (Cyrillic) ────────────────────────────────────────────────── */
/* Futura PT's faces are Cyrillic, so headings are covered; DM Sans is not, so
   body falls back to a Cyrillic-capable system UI face. */
html[data-i18n-locale="ru"] {
  --font-body: "DM Sans", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── Vietnamese (full diacritics) ──────────────────────────────────────── */
html[data-i18n-locale="vi"] {
  --font-heading: "Futura PT", system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-body: "DM Sans", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ── CJK line-height: give denser scripts a touch more breathing room ──── */
html[data-i18n-locale="ja"] body,
html[data-i18n-locale="ko"] body,
html[data-i18n-locale="zh"] body {
  line-height: 1.75;
}

/* CJK reads better without the wide tracking tuned for Latin caps. */
html[data-i18n-locale="ja"] .eyebrow,
html[data-i18n-locale="ko"] .eyebrow,
html[data-i18n-locale="zh"] .eyebrow,
html[data-i18n-locale="ja"] .btn,
html[data-i18n-locale="ko"] .btn,
html[data-i18n-locale="zh"] .btn {
  letter-spacing: 0.02em;
}

/* ── Longer languages (German, Russian): keep the desktop nav from crowding
   or overflowing. Tighter tracking + slightly smaller caps + the CTA allowed
   to breathe. Scoped high enough to win over Astro's component styles. ──── */
html[data-i18n-locale="de"] .main-nav .nav-link,
html[data-i18n-locale="ru"] .main-nav .nav-link {
  letter-spacing: 0.015em;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  font-size: 0.72rem;
}

html[data-i18n-locale="de"] .btn-book,
html[data-i18n-locale="ru"] .btn-book {
  font-size: 0.72rem;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
  letter-spacing: 0.02em;
}

/* Never let a translated word force a horizontal scrollbar. */
html[data-i18n-locale] h1,
html[data-i18n-locale] h2,
html[data-i18n-locale] h3 {
  overflow-wrap: break-word;
}
