/* ============================================================
   INSAR V3 — LANGUAGES
   1. The English | 简体中文 switcher (header, drawer, footer)
   2. Chinese typography — loaded on every page, but every rule
      in part 2 is scoped to :lang(zh), so the English page is
      untouched. A future language adds its own :lang() block.
   ============================================================ */

/* ---------- 1 · Language switcher -------------------------- */
.lang-switch{
  display:flex; align-items:center; gap:.45rem;
  white-space:nowrap;
}
.lang-switch__item{
  display:inline-flex; align-items:center; min-height:40px;
  font-size:.66rem; font-weight:500; letter-spacing:.14em; text-transform:uppercase;
  color:var(--ivory-50);
  transition:color .4s var(--ease);
}
/* CJK needs a larger size and tighter tracking to read at the same weight */
.lang-switch__item[lang^="zh"]{ font-size:.76rem; letter-spacing:.06em; }
a.lang-switch__item:hover,
a.lang-switch__item:focus-visible{ color:var(--gold-2); }
.lang-switch__item.is-current{ color:var(--gold-2); }
.lang-switch__sep{ color:var(--ivory-32); font-size:.7rem; line-height:1; }
.lang-switch__short{ display:none; }

/* Header: full names while there is room, short labels below 700px.
   Measured: logo + full switcher + "Enquire Now" + menu need ~572px
   of content width, which a 5vw gutter only leaves from ~640px up. */
.lang-switch--header{ margin-right:.2rem; }
@media (max-width:700px){
  .lang-switch--header .lang-switch__full{ display:none; }
  .lang-switch--header .lang-switch__short{ display:inline; }
  .lang-switch--header .lang-switch__item{ font-size:.68rem; }
  .lang-switch--header .lang-switch__item[lang^="zh"]{ font-size:.76rem; }
  .header__inner{ gap:1rem; }
  .header__act{ gap:.8rem; }
}
/* With the switcher in the bar, the header "Enquire Now" button steps
   aside a little earlier than the old 430px point. Phones still have
   the sticky "Request a Quotation" bar and the drawer's CTA. */
@media (max-width:560px){
  .header__act .btn{ display:none; }
}
@media (max-width:374px){
  .header__inner{ gap:.6rem; }
  .header__act{ gap:.5rem; }
  .lang-switch{ gap:.3rem; }
}

/* Drawer: sits under the contact line, a little larger */
.lang-switch--drawer{ margin-top:-.4rem; gap:.7rem; }
.lang-switch--drawer .lang-switch__item{ font-size:.72rem; }
.lang-switch--drawer .lang-switch__item[lang^="zh"]{ font-size:.82rem; }

/* Footer: inherits the footer bottom line's quiet scale */
.lang-switch--footer .lang-switch__item{ color:var(--ivory-50); }
.lang-switch--footer .lang-switch__item.is-current{ color:var(--gold-2); }

/* Inline form validation message */
.formerr{
  margin-top:1rem; font-size:.8rem; line-height:1.6;
  color:#D08A7E; text-align:center;
}

/* ---------- 2 · Chinese typography -------------------------
   Fraunces and Inter carry no Chinese glyphs, so the stacks list
   a CJK face after them: Latin letters and numerals stay in the
   brand fonts, Chinese falls through to Noto Serif SC (loaded on
   the Chinese page only) for headlines and to each platform's
   native Chinese sans for body text.
   ----------------------------------------------------------- */
html:lang(zh){
  --serif:'Fraunces','Noto Serif SC','Source Han Serif SC','Songti SC','STSong','SimSun',Georgia,serif;
  --sans:'Inter','PingFang SC','Hiragino Sans GB','Microsoft YaHei','Noto Sans SC','Noto Sans CJK SC','Source Han Sans SC','Helvetica Neue',Arial,sans-serif;
}
html:lang(zh) body{ line-height:1.86; letter-spacing:.02em; }
html:lang(zh) p{ text-wrap:pretty; }

/* Headlines: CJK needs more leading than Latin display type, and
   balanced lines avoid a lone character wrapping on its own. */
html:lang(zh) h1,
html:lang(zh) h2,
html:lang(zh) h3{ letter-spacing:.02em; line-height:1.28; text-wrap:balance; }
html:lang(zh) h1{ line-height:1.2; }
html:lang(zh) .card h4,
html:lang(zh) .klass b,
html:lang(zh) .vdetail__cap{ letter-spacing:.03em; }

/* Latin max-widths are set in `ch`; a Chinese character is about two
   of those, so the tightest headline measures are released. */
html:lang(zh) .enq h2,
html:lang(zh) .collection__head h2{ max-width:none; }
html:lang(zh) .hero__lead{ max-width:24em; }

/* Chinese has no true italic — synthesised slants look broken */
html:lang(zh) .em,
html:lang(zh) .pillar-panel .script,
html:lang(zh) .flagship .moment span,
html:lang(zh) .gen__sign .line{ font-style:normal; }
html:lang(zh) .pillar-panel .script{ letter-spacing:.3em; }

/* Small uppercase labels: Latin reads at 9–10px with wide tracking;
   Chinese characters need ≥12px and much less tracking. */
html:lang(zh) .eyebrow{ font-size:.8rem; letter-spacing:.2em; }
html:lang(zh) .pillar__label,
html:lang(zh) .flagship__tag,
html:lang(zh) .flagship__idx,
html:lang(zh) .flagship .moment b,
html:lang(zh) .card__cat,
html:lang(zh) .vcard__type,
html:lang(zh) .vcard__for span,
html:lang(zh) .vgroup__h,
html:lang(zh) .gen__sign .who,
html:lang(zh) .field label{ font-size:.76rem; letter-spacing:.14em; }

html:lang(zh) .caption,
html:lang(zh) .trust__line,
html:lang(zh) .feature span,
html:lang(zh) .stat__lbl,
html:lang(zh) .flagship__meta,
html:lang(zh) .bespoke .meta,
html:lang(zh) .sshot figcaption,
html:lang(zh) .vmodal__interior figcaption,
html:lang(zh) .drawer__meta,
html:lang(zh) .contact-line span small,
html:lang(zh) .footer__bottom{ font-size:.75rem; letter-spacing:.1em; }

html:lang(zh) .btn,
html:lang(zh) .tlink,
html:lang(zh) .vcard__more,
html:lang(zh) .pillar-panel .play,
html:lang(zh) .nav a{ font-size:.8rem; letter-spacing:.12em; }
html:lang(zh) .btn--sm{ font-size:.78rem; }

html:lang(zh) h4{ font-size:.82rem; letter-spacing:.16em; }
html:lang(zh) .card h4{ font-size:1.12rem; letter-spacing:.03em; }
html:lang(zh) .field label em{ font-size:1em; letter-spacing:.04em; }
html:lang(zh) .vcard__cap small{ font-size:.75rem; letter-spacing:.1em; }
html:lang(zh) .vmodal__note{ font-size:.78rem; letter-spacing:.04em; }
html:lang(zh) .pricing__foot,
html:lang(zh) .formnote{ font-size:.8rem; letter-spacing:.04em; }
html:lang(zh) .micro span{ font-size:.86rem; }
html:lang(zh) .trust__year{ font-size:1.25rem; letter-spacing:.04em; }
/* The logo lockup (INSAR · Inside Sarawak · Since 1988) and the two
   campaign badges are brand marks and deliberately stay in English. */

/* Phrase: keep a clause on one line where it fits, so Chinese lines
   break after a comma rather than through the middle of a word.
   Used only inside translation strings (e.g. zh.json). */
.ph{ display:inline-block; }
