/* Arabic typography — swap the type system while keeping
   every layout rule in style.css untouched. */
[dir="rtl"] {
  --serif: 'Amiri', 'Noto Naskh Arabic', serif;
  --sans: 'Tajawal', 'Noto Sans Arabic', sans-serif;
  --mono: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
}

/* ══════════════════════════════════════════════
   RTL POLISH OVERRIDES
   Loaded after style.css on Arabic pages only.
   Handles the handful of properties (transform-origin,
   decorative animation directions) that CSS logical
   properties don't cover, so micro-interactions mirror
   correctly for right-to-left reading.
   ══════════════════════════════════════════════ */

[dir="rtl"] nav > a::before {
  transform-origin: left;
}
[dir="rtl"] nav > a:hover::before {
  transform-origin: right;
}

[dir="rtl"] .loader-bar::after {
  transform-origin: right;
}

[dir="rtl"] .group-card::after {
  transform-origin: right;
}

[dir="rtl"] .prac-plus::before,
[dir="rtl"] .prac-plus::after {
  /* plus/cross icon is symmetric, no change needed — kept for clarity */
}

/* Arabic type rides slightly differently on the baseline; nudge
   letter-spacing down since Arabic script doesn't use the same
   tracking conventions as the Latin display type. */
[dir="rtl"] body {
  letter-spacing: 0;
}
[dir="rtl"] .hero-kicker,
[dir="rtl"] .sec-index,
[dir="rtl"] .prac-no,
[dir="rtl"] .prac-tag,
[dir="rtl"] .group-abbr,
[dir="rtl"] .lead-role,
[dir="rtl"] .tech-feat-no,
[dir="rtl"] .arb-col-no,
[dir="rtl"] .c-block h4,
[dir="rtl"] .fld label,
[dir="rtl"] .foot-col h5,
[dir="rtl"] nav > a,
[dir="rtl"] .btn-solid,
[dir="rtl"] .btn-ghost,
[dir="rtl"] .nav-btn,
[dir="rtl"] .footer-links a,
[dir="rtl"] .foot-base p,
[dir="rtl"] .loader-est,
[dir="rtl"] .stat-label,
[dir="rtl"] .proof-label,
[dir="rtl"] .tech-note {
  letter-spacing: 0.02em;
}

/* Quote glyph mirrors for RTL reading direction */
[dir="rtl"] .pull::before {
  content: '”';
  left: auto;
  inset-inline-start: 2rem;
}

/* Keep numerals (years, stats) left-to-right even inside RTL flow —
   standard convention in professional Arabic business typography. */
[dir="rtl"] .proof-num,
[dir="rtl"] .stat-num,
[dir="rtl"] .tl-year {
  direction: ltr;
  unicode-bidi: isolate;
}
