/* ==========================================================================
   locale.css — typography corrections for non-Latin locales.
   Loaded on every page; only rules scoped to [data-locale] do anything.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Simplified Chinese
   --------------------------------------------------------------------------
   The Latin stack leads with Source Serif 4, which has no CJK glyphs, so the
   browser falls back mid-heading. Chinese also needs looser leading, no
   negative tracking, and slightly larger display sizes to stay legible.
   -------------------------------------------------------------------------- */
[data-locale="zh-cn"] {
  /* System CJK faces, not a downloaded one. PingFang ships with every Apple
     platform, YaHei with Windows, Noto Sans CJK with Android and most Linux
     desktops, so every reader already has a correct face and the page spends
     nothing to get it. Order matters: the first family present wins. */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans CJK SC", "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --font-display: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC",
    "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
}

[data-locale="zh-cn"] body {
  line-height: 1.75;
}

[data-locale="zh-cn"] .t-display,
[data-locale="zh-cn"] .t-h1,
[data-locale="zh-cn"] .t-h2,
[data-locale="zh-cn"] .t-h3,
[data-locale="zh-cn"] .hero-title,
[data-locale="zh-cn"] .card-title,
[data-locale="zh-cn"] .result-title {
  letter-spacing: 0;
  line-height: 1.32;
}

[data-locale="zh-cn"] .hero-title,
[data-locale="zh-cn"] .t-display {
  font-size: 2.625rem;
  line-height: 1.24;
}

[data-locale="zh-cn"] .t-h1 {
  font-size: 2.25rem;
  line-height: 1.28;
}

[data-locale="zh-cn"] .t-h2 {
  font-size: 1.875rem;
  line-height: 1.3;
}

[data-locale="zh-cn"] .t-h3 {
  font-size: 1.3125rem;
}

[data-locale="zh-cn"] .t-lead {
  font-size: 1.0625rem;
  line-height: 1.8;
}

[data-locale="zh-cn"] .t-small,
[data-locale="zh-cn"] .acc-body,
[data-locale="zh-cn"] .step-text,
[data-locale="zh-cn"] .timeline-text {
  line-height: 1.8;
}

/* Long-form Chinese reads better with a slightly larger size and looser leading */
[data-locale="zh-cn"] .prose-medical {
  font-size: 1.125rem;
  line-height: 1.95;
  max-width: 42em;
}
[data-locale="zh-cn"] .prose-medical h2 {
  font-size: 1.5rem;
  line-height: 1.4;
  margin-top: 2.5rem;
}
[data-locale="zh-cn"] .prose-medical h3 {
  font-size: 1.25rem;
  line-height: 1.45;
}
[data-locale="zh-cn"] .prose-medical p {
  text-align: justify;
  text-justify: inter-ideograph;
}
[data-locale="zh-cn"] .prose-medical ul li::before {
  top: 0.82rem;
}

/* Latin fragments inside Chinese copy (prices, acronyms, drug names) */
[data-locale="zh-cn"] .t-num,
[data-locale="zh-cn"] .stat-value,
[data-locale="zh-cn"] .price-amount,
[data-locale="zh-cn"] .fee-price,
[data-locale="zh-cn"] .treatment-price {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

/* Stat labels are uppercase-tracked in English; Chinese has no case, so the
   tracking only makes it look loose. */
[data-locale="zh-cn"] .stat-label,
[data-locale="zh-cn"] .fact-label,
[data-locale="zh-cn"] .t-micro,
[data-locale="zh-cn"] .eyebrow,
[data-locale="zh-cn"] .verdict-block-title,
[data-locale="zh-cn"] .drawer-label,
[data-locale="zh-cn"] .table thead th {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.8125rem;
}

[data-locale="zh-cn"] .eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Buttons and pills hold more horizontal space per character */
[data-locale="zh-cn"] .btn {
  padding-inline: 1.625rem;
}

[data-locale="zh-cn"] .badge,
[data-locale="zh-cn"] .chip {
  font-size: 0.8125rem;
}

/* Tables: Chinese cells are shorter, so allow a little less padding */
[data-locale="zh-cn"] .table th,
[data-locale="zh-cn"] .table td {
  padding: 0.8125rem 1rem;
}

/* The hero copy column can be narrower with Chinese — fewer, denser lines */
[data-locale="zh-cn"] .hero-content {
  max-width: 34rem;
}

@media (max-width: 960px) {
  [data-locale="zh-cn"] .hero-title {
    font-size: 2rem;
  }
  [data-locale="zh-cn"] .t-h1 {
    font-size: 1.75rem;
  }
  [data-locale="zh-cn"] .t-h2 {
    font-size: 1.5rem;
  }
}

/* --------------------------------------------------------------------------
   Language switcher: pending locales
   -------------------------------------------------------------------------- */
.lang-item.is-current {
  color: var(--brand);
  font-weight: 600;
  cursor: default;
}
.lang-note {
  padding: 0.625rem 0.625rem 0.25rem;
  margin-top: 0.375rem;
  border-top: 1px solid var(--rule);
  line-height: 1.5;
}

/* ==========================================================================
   Right-to-left locales (ar, ur)
   --------------------------------------------------------------------------
   The stylesheets are written with physical properties, so an RTL page would
   otherwise keep its text left-aligned, its list bullets on the wrong side and
   its dropdowns opening off-screen. Rather than rewrite every rule into logical
   properties — which risks the LTR layouts — everything RTL-specific is
   mirrored here, scoped to [dir="rtl"].
   ========================================================================== */

[dir="rtl"] {
  --font-sans: "Noto Sans Arabic", "Inter", "Noto Sans", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Noto Naskh Arabic", "Source Serif 4", Georgia, serif;
}

[dir="rtl"] body {
  /* Arabic and Urdu sit lower on the line than Latin; give them room. */
  line-height: 1.85;
}

/* ---- text alignment ----------------------------------------------------- */
[dir="rtl"] .table caption,
[dir="rtl"] .table th,
[dir="rtl"] .table td,
[dir="rtl"] .prose-medical th,
[dir="rtl"] .prose-medical td,
[dir="rtl"] .flight-city,
[dir="rtl"] .hospital-bar-value,
[dir="rtl"] .pc-table thead th {
  text-align: right;
}

[dir="rtl"] .table td.num,
[dir="rtl"] .table th.num,
[dir="rtl"] .fee-price,
[dir="rtl"] .arch-value,
[dir="rtl"] .treatment-row summary .treatment-price {
  /* figures stay left-to-right even inside an RTL sentence */
  direction: ltr;
  text-align: left;
  unicode-bidi: embed;
}

/* ---- list bullets move to the right ------------------------------------- */
[dir="rtl"] .prose-medical ul li::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .prose-medical ul li {
  padding-left: 0;
  padding-right: 1.5rem;
}

/* ---- step and timeline markers ------------------------------------------ */
[dir="rtl"] .step::before,
[dir="rtl"] .timeline-item:not(:last-child) .timeline-marker::after {
  left: auto;
  right: 0;
}

/* ---- dropdowns and menus open from the other edge ----------------------- */
[dir="rtl"] .dropdown,
[dir="rtl"] .lang-menu {
  left: auto;
  right: 0;
}

/* ---- directional icons -------------------------------------------------- */
[dir="rtl"] .link-arrow .icon,
[dir="rtl"] .link-more .icon,
[dir="rtl"] .card-more .icon,
[dir="rtl"] .chip .icon-xs {
  transform: scaleX(-1);
}

[dir="rtl"] .skip-link {
  left: auto;
  right: 1rem;
}

/* ---- input groups: the icon sits on the trailing edge ------------------- */
[dir="rtl"] .input-group .icon {
  left: auto;
  right: 0.875rem;
}

[dir="rtl"] .input-group .input {
  padding-left: 0.875rem;
  padding-right: 2.75rem;
}

/* ==========================================================================
   Devanagari (hi) and Bengali (bn)
   --------------------------------------------------------------------------
   Both scripts place the baseline lower and carry marks above and below the
   line, so Latin leading clips them.
   ========================================================================== */
[data-locale="hi"],
[data-locale="bn"] {
  --font-sans: "Noto Sans Devanagari", "Noto Sans Bengali", "Inter",
    "Noto Sans", sans-serif;
}

[data-locale="hi"] {
  --font-sans: "Noto Sans Devanagari", "Inter", "Noto Sans", sans-serif;
  --font-display: "Noto Serif Devanagari", "Source Serif 4", Georgia, serif;
}

[data-locale="bn"] {
  --font-sans: "Noto Sans Bengali", "Inter", "Noto Sans", sans-serif;
  --font-display: "Noto Serif Bengali", "Source Serif 4", Georgia, serif;
}

[data-locale="hi"] body,
[data-locale="bn"] body {
  line-height: 1.9;
}

[data-locale="hi"] .t-display,
[data-locale="hi"] .t-h1,
[data-locale="hi"] .t-h2,
[data-locale="hi"] .t-h3,
[data-locale="hi"] .hero-title,
[data-locale="bn"] .t-display,
[data-locale="bn"] .t-h1,
[data-locale="bn"] .t-h2,
[data-locale="bn"] .t-h3,
[data-locale="bn"] .hero-title {
  letter-spacing: 0;
  line-height: 1.45;
}

/* ==========================================================================
   Vietnamese — the Latin stack covers it, but the stacked diacritics need
   more leading than the default.
   ========================================================================== */
[data-locale="vi"] body {
  line-height: 1.8;
}
