/* Right-to-left overrides for the NEW design. Loaded only on rtl locales,
   after site.css.

   CORRECTION TO PLAN PHASE 2.5. The plan says to "add a dir=rtl hook point
   that composes with the existing rtl.css rather than requiring a parallel
   stylesheet." That is not achievable: the live /rtl.css is written against
   the old design's selectors (.kicker, .num, .svc-badge, .p-badge,
   .hero-name .coord, .nav-links .hire) and mirrors rules from
   _astro/global.BM7v5tI2.css. None of those classes exist in the new markup,
   which uses .nav__in, .nav__links, .nav__drop, .cs-logo, .wrap, .panel.
   A parallel stylesheet is therefore required, and this is it.

   SCOPE. This establishes the hook and fixes the two problems that are known
   now: Arabic glyph coverage and script-mangling letter-spacing. Per-component
   mirroring and the GSAP horizontal-direction audit are Phase 5 work and must
   be done with an Arabic page actually loaded in a browser — rtl.css alone has
   never caught a mirrored animation. */

html[dir="rtl"] {
  /* Archivo ships no Arabic glyphs and font-src is pinned to 'self', so no
     webfont can be added. Latin text stays in Archivo; Arabic falls through to
     whichever of these the device has. Same chain the live site settled on. */
  --display: "Archivo", "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Kufi Arabic",
             "Geeza Pro", "Arabic Typesetting", system-ui, sans-serif;
  --text: "Noto Naskh Arabic", "Times New Roman", Georgia, serif;
}

/* Tracking on uppercase display text mangles connected Arabic script. */
html[dir="rtl"] .kicker,
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .btn,
html[dir="rtl"] .nav__links,
html[dir="rtl"] .lang-btn {
  letter-spacing: 0;
}

/* Martian Mono has no Arabic coverage either. Keep it for genuinely technical
   strings (code, CVEs, hostnames), which stay LTR inside an RTL paragraph. */
html[dir="rtl"] code,
html[dir="rtl"] kbd,
html[dir="rtl"] samp {
  direction: ltr;
  unicode-bidi: isolate;
}

/* The hard offset shadows are directional: an orange shadow thrown to the
   right reads as "behind" in LTR and as "in front" in RTL. */
html[dir="rtl"] .nav__drop,
html[dir="rtl"] .lang-menu {
  box-shadow: -6px 6px 0 var(--orange);
}

/* "Forward" hover nudge on the two inline affordance arrows (CTA button
   arrow, service-card "go" arrow): both move +5px on the physical X axis in
   site.css, which reads as "forward" only in LTR. In RTL, forward is
   visually leftward, so the sign flips. The glyphs themselves (→) are left
   untouched — they're inside <span class="arw">→</span> markup, i.e. actual
   arrow characters BiDi would otherwise mirror into ← via Unicode's built-in
   mirroring; isolating them keeps the glyph pointing the way the English
   source authored it while the motion still reads as "forward" for an RTL
   reader. */
html[dir="rtl"] .btn:hover .arw,
html[dir="rtl"] .svc-card:hover .svc-card__go { translate: -5px 0; }

html[dir="rtl"] .arw { unicode-bidi: isolate; }

/* ---------------------------------------------------------------------------
   Phase 5 checklist — deliberately NOT implemented here, needs a loaded page:
     - GSAP timelines: translateX signs, transform-origin, ScrollTrigger
       horizontal start/end, SplitText reading order
     - .cs-logo canvas animation direction
     - scene/illustration art that reads left-to-right narratively
   --------------------------------------------------------------------------- */
