/* ═══════════════════════════════════════════════════════════
   RTL / Arabic overrides — loaded only on the Arabic build.
   Layered on top of style.css + theme-crimson.css.

   Three problems this file solves:
   1. Cormorant Garamond and JetBrains Mono have no Arabic
      coverage, so every heading and label falls back to a
      random system font.
   2. letter-spacing on Arabic SEVERS the cursive joins between
      letters — it turns words into disconnected glyphs. Every
      tracked rule in the LTR sheet has to be reset.
   3. text-transform: uppercase is a no-op and font-style:
      italic is not a real style in Arabic type; the editorial
      accent has to be carried by weight and colour instead.
   ═══════════════════════════════════════════════════════════ */

[dir="rtl"] {
  --serif: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Amiri', 'Times New Roman', serif;
  --sans:  'SF Arabic', 'Geeza Pro', 'Noto Sans Arabic', -apple-system, sans-serif;
  --mono:  'SF Arabic', 'Geeza Pro', 'Noto Sans Arabic', -apple-system, sans-serif;
}

/* ── 1. Kill tracking and casing on every micro-type rule ── */
[dir="rtl"] .overline,
[dir="rtl"] .chrome-bar,
[dir="rtl"] .chrome-links a,
[dir="rtl"] .chrome-cta,
[dir="rtl"] .btn,
[dir="rtl"] .meta-block,
[dir="rtl"] .meta-block b,
[dir="rtl"] .plate-cap,
[dir="rtl"] .stat-label,
[dir="rtl"] .stat-num,
[dir="rtl"] .card-num,
[dir="rtl"] .form-group label,
[dir="rtl"] .team-card h4,
[dir="rtl"] .team-card .role,
[dir="rtl"] .footer-desc,
[dir="rtl"] .footer h4,
[dir="rtl"] .footer-bottom,
[dir="rtl"] .hero-orbit span,
[dir="rtl"] .lang-switch a,
[dir="rtl"] .chip,
[dir="rtl"] .tag,
[dir="rtl"] .blog-meta,
[dir="rtl"] .post-back,
[dir="rtl"] .gl-count,
[dir="rtl"] .gl-cat,
[dir="rtl"] .gl-en,
[dir="rtl"] .q-group legend,
[dir="rtl"] .soon-foot,
[dir="rtl"] .prose th,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 {
  letter-spacing: normal;
  text-transform: none;
}

/* Arabic needs more line-height than a Latin serif does */
[dir="rtl"] body { line-height: 1.9; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4 { line-height: 1.5; font-weight: 700; }
[dir="rtl"] .overline, [dir="rtl"] .stat-label, [dir="rtl"] .meta-block,
[dir="rtl"] .plate-cap, [dir="rtl"] .footer h4 { font-weight: 600; }

/* ── 2. Italic is not an Arabic style — use weight + colour ── */
[dir="rtl"] .italic,
[dir="rtl"] em,
[dir="rtl"] .stat-figure,
[dir="rtl"] h1 em, [dir="rtl"] h2 em {
  font-style: normal;
  font-weight: 700;
}
[dir="rtl"] .stat-figure { font-size: 2.6rem; }

/* ── 3. Latin technical tokens inside Arabic text ──
   TG-51, VMAT, FHIR, LA-Track and friends must not be reordered
   by the bidi algorithm when they sit next to Arabic. */
[dir="rtl"] .ltr {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline;   /* inline-block made a line-break opportunity beside brackets */
}

/* ── 4. Flip the handful of side-anchored rules ── */
[dir="rtl"] .hero-media { right: auto; left: 0; }
[dir="rtl"] .card::before { left: auto; right: 0; }
[dir="rtl"] .sphere-stage.right { right: auto; left: 4vw; }
@media (max-width: 900px) {
  [dir="rtl"] .sphere-stage.right { left: 50%; right: auto; }
}
[dir="rtl"] .lang-switch { margin-inline-start: 4px; }

/* Arrows in CTA labels point the other way in RTL */
[dir="rtl"] .btn { flex-direction: row-reverse; }

/* Numerals stay Western and LTR even inside Arabic paragraphs */
[dir="rtl"] .stat-num, [dir="rtl"] .card-num, [dir="rtl"] .plate-cap .num {
  direction: ltr;
  unicode-bidi: isolate;
}
