/* ===========================
   i18n — language switcher + lang fonts + EN/zh-tw layout
   Phase 03 / 03.1
   JA styles are left untouched (rules scoped to body.lang-en / body.lang-zh-tw)
   =========================== */

/* Language-specific font stacks (load only needed webfonts in functions.php) */
body.lang-en {
  --font-gothic: "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-mincho: "Libre Baskerville", Georgia, serif;
}

body.lang-zh-tw {
  --font-gothic: "Noto Sans TC", "Roboto", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-mincho: "Noto Sans TC", "Roboto", "PingFang TC", "Microsoft JhengHei", sans-serif;
  letter-spacing: 0;
}

/* === Language switcher (Design A + publish control B) === */
.gc-lang-switch {
  display: flex;
  align-items: center;
}

.gc-lang-switch__list {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gc-lang-switch__item {
  display: flex;
  align-items: center;
}

.gc-lang-switch__item + .gc-lang-switch__item::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 0.75em;
  margin: 0 0.55rem;
  background: currentColor;
  opacity: 0.28;
}

.gc-lang-switch__link {
  font-family: "Roboto", var(--font-gothic);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  color: inherit;
  opacity: 0.55;
  white-space: nowrap;
  transition: opacity 0.2s;
}

a.gc-lang-switch__link:hover {
  opacity: 1;
}

.gc-lang-switch__item.is-current .gc-lang-switch__link {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.gc-lang-switch__draft {
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.7;
  margin-left: 0.15rem;
}

/* Header placement: after PC nav, before hamburger */
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header__logo {
  margin-right: auto;
}

.site-header__lang {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--color-text);
  order: 2;
}

.site-header__menu-btn {
  order: 3;
  flex-shrink: 0;
}

.site-header__nav {
  order: 1;
}

.site-header--transparent:not(.is-scrolled) .site-header__lang {
  color: var(--color-white);
}

/*
 * GC-P05-FIX-01:
 * SP/Tablet（nav 非表示帯）でヘッダー言語スイッチャーが横幅を食い、
 * #menuBtn が viewport 外へ押し出される（QA-04: 375px で x≈453–503）。
 * PC（min-width:992px）のヘッダーは変更せず、SP は全画面メニュー内スイッチャーを使用。
 */
@media (max-width: 991px) {
  .site-header__lang {
    display: none;
  }
}

/* Fullscreen menu footer switcher */
.gc-lang-switch--menu {
  margin-top: 1.25rem;
  color: var(--color-white);
}

.gc-lang-switch--menu .gc-lang-switch__link {
  font-size: 0.8rem;
  opacity: 0.65;
}

.gc-lang-switch--menu .gc-lang-switch__item.is-current .gc-lang-switch__link {
  opacity: 1;
}

.gc-lang-switch--menu .gc-lang-switch__item.is-draft .gc-lang-switch__link {
  opacity: 0.4;
}

.site-footer__lang {
  margin-top: 0;
}

.gc-lang-switch--footer {
  color: var(--color-text-sub);
}

.gc-lang-switch--footer .gc-lang-switch__link {
  font-size: 0.75rem;
}

/* =========================================================
   EN / zh-tw layout safeguards (do not affect body.lang-ja)
   ========================================================= */

/* EN/zh-tw PC header: long labels were wrapping/stacking inside fixed header height */
body.lang-en .header-nav,
body.lang-zh-tw .header-nav {
  gap: 14px;
}

body.lang-en .header-nav > li,
body.lang-zh-tw .header-nav > li {
  flex-shrink: 0;
}

body.lang-en .header-nav__link,
body.lang-zh-tw .header-nav__link {
  font-size: 0.72rem;
  letter-spacing: 0;
  line-height: 1.25;
  white-space: nowrap;
}

body.lang-en .header-nav .hn-btn,
body.lang-zh-tw .header-nav .hn-btn {
  font-size: 0.7rem;
  padding: 8px 12px;
  white-space: nowrap;
  line-height: 1.2;
  max-width: none;
  text-align: center;
}

body.lang-en .header-nav .hn-btns,
body.lang-zh-tw .header-nav .hn-btns {
  margin-left: 4px;
  gap: 6px;
}

/* Drop secondary links / land CTA earlier than JA (News・About are in fullscreen menu) */
@media (max-width: 1400px) {
  body.lang-en .header-nav .hn-sub,
  body.lang-zh-tw .header-nav .hn-sub {
    display: none;
  }
}

@media (max-width: 1200px) {
  body.lang-en .header-nav .hn-btn--outline,
  body.lang-zh-tw .header-nav .hn-btn--outline {
    display: none;
  }
}

body.lang-en .fullscreen-menu__jp,
body.lang-zh-tw .fullscreen-menu__jp {
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  line-height: 1.45;
  letter-spacing: 0.01em;
}

body.lang-en .fv2-hero__jp,
body.lang-zh-tw .fv2-hero__jp {
  font-size: clamp(0.95rem, 1.55vw, 1.15rem);
  line-height: 1.75;
  max-width: 44rem;
  margin-left: auto;
  margin-right: auto;
}

body.lang-en .fv2-mission__title,
body.lang-zh-tw .fv2-mission__title {
  font-size: clamp(1.65rem, 4vw, 3.1rem);
  line-height: 1.3;
  letter-spacing: 0;
}

body.lang-en .fv2-h2,
body.lang-zh-tw .fv2-h2 {
  line-height: 1.35;
  letter-spacing: 0;
}

body.lang-en .fv2-lead,
body.lang-zh-tw .fv2-lead,
body.lang-en .fv2-mission__text,
body.lang-zh-tw .fv2-mission__text,
body.lang-en .fv2-step__text,
body.lang-zh-tw .fv2-step__text,
body.lang-en .fv2-card__text,
body.lang-zh-tw .fv2-card__text,
body.lang-en .fv2-pillar__text,
body.lang-zh-tw .fv2-pillar__text {
  line-height: 1.85;
  letter-spacing: 0;
}

body.lang-en .fv2-btn,
body.lang-zh-tw .fv2-btn {
  white-space: normal;
  line-height: 1.35;
  text-align: left;
  max-width: 100%;
}

body.lang-en .fv2-card__tags li,
body.lang-zh-tw .fv2-card__tags li {
  font-size: 0.72rem;
  line-height: 1.3;
}

body.lang-en .fv2-step__name br,
body.lang-zh-tw .fv2-step__name br {
  display: inline;
}

body.lang-en .fv2-step__name br::after,
body.lang-zh-tw .fv2-step__name br::after {
  content: " ";
}

body.lang-en .fv2-pillar__title,
body.lang-zh-tw .fv2-pillar__title,
body.lang-en .fv2-card__jp,
body.lang-zh-tw .fv2-card__jp {
  line-height: 1.4;
  letter-spacing: 0;
}

body.lang-en .fv2-stat__num small,
body.lang-zh-tw .fv2-stat__num small {
  font-size: 0.32em;
  white-space: nowrap;
}

body.lang-en .fv2-cta__text,
body.lang-zh-tw .fv2-cta__text {
  line-height: 1.75;
}

body.lang-en .site-footer__tagline,
body.lang-zh-tw .site-footer__tagline {
  line-height: 1.7;
  letter-spacing: 0;
}

body.lang-en .sp-cta__link,
body.lang-zh-tw .sp-cta__link {
  font-size: 0.72rem;
  letter-spacing: 0;
}

@media (max-width: 960px) {
  body.lang-en .fv2-hero__cta .fv2-btn,
  body.lang-zh-tw .fv2-hero__cta .fv2-btn,
  body.lang-en .fv2-deal__cta .fv2-btn,
  body.lang-zh-tw .fv2-deal__cta .fv2-btn {
    width: 100%;
    justify-content: space-between;
  }

  body.lang-en .fv2-mission__title,
  body.lang-zh-tw .fv2-mission__title {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }
}

@media (max-width: 1240px) {
  /* Longer EN/TW labels: hide secondary nav earlier than JA if needed via existing hn-sub */
  body.lang-en .header-nav,
  body.lang-zh-tw .header-nav {
    gap: 14px;
  }
}

/* =========================================================
   Phase 04.1 — fixed-page layout (EN / zh-tw only)
   ========================================================= */

body.lang-en .page-header__jp,
body.lang-zh-tw .page-header__jp {
  letter-spacing: 0.02em;
  line-height: 1.45;
}

body.lang-en .page-header__en,
body.lang-zh-tw .page-header__en {
  letter-spacing: 0.08em;
}

body.lang-en .section__en,
body.lang-zh-tw .section__en {
  letter-spacing: 0.08em;
}

body.lang-en .section__title,
body.lang-zh-tw .section__title {
  letter-spacing: 0.02em;
  line-height: 1.45;
}

body.lang-en .section__lead,
body.lang-zh-tw .section__lead {
  letter-spacing: 0;
  line-height: 1.85;
  max-width: 46rem;
}

body.lang-en .feature-item__title,
body.lang-zh-tw .feature-item__title,
body.lang-en .step-flow__title,
body.lang-zh-tw .step-flow__title {
  letter-spacing: 0.01em;
  line-height: 1.4;
}

body.lang-en .feature-item__desc,
body.lang-zh-tw .feature-item__desc,
body.lang-en .step-flow__desc,
body.lang-zh-tw .step-flow__desc,
body.lang-en .background-points li,
body.lang-zh-tw .background-points li {
  letter-spacing: 0;
  line-height: 1.8;
}

body.lang-en .btn,
body.lang-zh-tw .btn,
body.lang-en .cta-banner__copy,
body.lang-zh-tw .cta-banner__copy {
  white-space: normal;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

body.lang-en .cta-banner__sub,
body.lang-zh-tw .cta-banner__sub {
  letter-spacing: 0;
  line-height: 1.7;
}

body.lang-en .info-table__label,
body.lang-zh-tw .info-table__label,
body.lang-en .info-table__value,
body.lang-zh-tw .info-table__value,
body.lang-en .info-table--compare th,
body.lang-zh-tw .info-table--compare th,
body.lang-en .info-table--compare td,
body.lang-zh-tw .info-table--compare td {
  letter-spacing: 0;
  line-height: 1.55;
  word-break: break-word;
}

body.lang-en .info-table--compare,
body.lang-zh-tw .info-table--compare {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.lang-en .proj-overview__stat-unit,
body.lang-zh-tw .proj-overview__stat-unit {
  letter-spacing: 0;
  white-space: nowrap;
}

body.lang-en .proj-table th,
body.lang-zh-tw .proj-table th,
body.lang-en .proj-table td,
body.lang-zh-tw .proj-table td {
  letter-spacing: 0;
  line-height: 1.45;
  word-break: break-word;
}

body.lang-en .contact-sidebar,
body.lang-zh-tw .contact-sidebar {
  letter-spacing: 0;
  line-height: 1.7;
  word-break: break-word;
}

body.lang-en .privacy-body,
body.lang-zh-tw .privacy-body,
body.lang-en .privacy-content,
body.lang-zh-tw .privacy-content,
body.lang-en .page-privacy,
body.lang-zh-tw .page-privacy {
  letter-spacing: 0;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

body.lang-en .faq-item__q,
body.lang-zh-tw .faq-item__q,
body.lang-en .faq__question,
body.lang-zh-tw .faq__question,
body.lang-en .accordion__title,
body.lang-zh-tw .accordion__title {
  letter-spacing: 0.01em;
  line-height: 1.45;
}

body.lang-en .faq-item__a,
body.lang-zh-tw .faq-item__a,
body.lang-en .faq__answer,
body.lang-zh-tw .faq__answer,
body.lang-en .accordion__body,
body.lang-zh-tw .accordion__body {
  letter-spacing: 0;
  line-height: 1.8;
}

body.lang-zh-tw {
  word-break: break-word;
}

@media (max-width: 767px) {
  body.lang-en .page-header__jp,
  body.lang-zh-tw .page-header__jp {
    font-size: clamp(0.95rem, 3.6vw, 1.15rem);
  }

  body.lang-en .section__title,
  body.lang-zh-tw .section__title {
    line-height: 1.5;
  }

  body.lang-en .btn,
  body.lang-zh-tw .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  body.lang-en .step-flow__title,
  body.lang-zh-tw .step-flow__title {
    font-size: 0.95rem;
  }

  body.lang-en .feature-item__title,
  body.lang-zh-tw .feature-item__title {
    font-size: 1rem;
  }
}
