/* ==========================================================================
   RTL PRESENTATION LAYER — Arabic only. Enqueued exclusively when
   nemax_is_arabic() is true (inc/setup.php); English pages never load this
   file at all, so nothing here can ever affect the approved English site.

   Scope discipline (Multilingual Master Spec §11–14): this file adapts
   TEXTUAL/DIRECTIONAL flow only. VISUAL/BRAND/SPATIAL systems — the NX
   mark, client logos, Project photography, and both Canvas globes — get an
   explicit direction:ltr escape hatch below so page-level dir="rtl" can
   never mirror them; Canvas/image content doesn't auto-mirror from CSS
   direction regardless, but the FLEX/GRID ORDER of the elements around it
   would, without this.
   ========================================================================== */

html[dir="rtl"] body{ font-family:var(--f-arabic); }

/* Arabic must not inherit the Latin display/mono type's positive tracking
   — that reads as broken kerning on Arabic script, not "editorial." Every
   heading/eyebrow/mono class in this theme sets its own letter-spacing;
   resetting it in one place here is far safer than hunting down every
   --ls-wide/--ls-head/--ls-label usage across a dozen stylesheets. */
.is-rtl, .is-rtl * { letter-spacing:normal !important; }

/* ---- Brand / spatial systems — explicitly NOT mirrored ----
   Logo marks, client logos, Project imagery and both globes keep their
   own internal layout physically LTR regardless of page direction. This
   only re-anchors FLEX/GRID ORDER and text-align inside these containers
   (images/canvas already never mirror from a CSS direction change) — the
   point is that reordering never happens to begin with. */
.is-rtl .nav-mark,
.is-rtl .nav-logo-stack,
.is-rtl .arrival,
.is-rtl .globe-wrap,
.is-rtl #nemaxGlobe,
.is-rtl .ctp-globe-wrap,
.is-rtl .client-row,
.is-rtl .plate,
.is-rtl .arc-media,
.is-rtl .p-gallery,
.is-rtl .visual-index,
.is-rtl .materials-grid,
.is-rtl .pt-scroll{
  direction:ltr;
}
/* Arabic captions/labels living inside those forced-LTR containers still
   need to read right-aligned even though their container's own layout
   direction stays LTR (Fig. 01 must stay the same image, brief §19). */
.is-rtl .plate figcaption,
.is-rtl .arc-media figcaption,
.is-rtl .materials-grid figcaption,
.is-rtl .material-card *{
  direction:rtl; text-align:right;
}

/* Hero Services Reel — .arrival stays direction:ltr above (its whole
   layout/animation must never mirror), but the Arabic text riding inside
   it still needs its own correct reading direction, same as .plate
   figcaption above. Only the text direction changes here — position,
   width/height, vertical movement speed, opacity hierarchy and pointer
   interaction are all untouched (assets/js/hero-puzzle.js, home.css). */
.is-rtl .hero-services-item{
  direction:rtl; unicode-bidi:plaintext; font-family:var(--f-arabic);
}

/* ---- Studio process rail — THIS one is meant to reverse. Design →
   Construction → Outcome is still the same sequence in the markup/JS
   (assets/js/system.js's updateDcoRail() threshold math is untouched); an
   RTL reader simply meets Design on the right first, matching how the
   rest of the Arabic page already reads (brief §16). ---- */
.is-rtl .dco-rail{ direction:rtl; }
.is-rtl .dco-node{ /* mirror the node's inline offset to the opposite edge of its stage box */ inset-inline:auto; }

/* ---- Form fields — direction/alignment per field TYPE, not blanket RTL
   (brief §23). Email/phone/URL stay LTR everywhere; free-text fields
   follow the page direction. ---- */
.is-rtl .studio-field-input textarea,
.is-rtl .studio-field-input input[type="text"]{ direction:rtl; text-align:right; }
.is-rtl input[type="email"],
.is-rtl input[type="tel"],
.is-rtl input[type="url"]{ direction:ltr; text-align:left; }

/* ---- Interstitial / eyebrow "Next — 0X Label" devices already read
   correctly left-to-right as Arabic text (the % / number stays legible in
   its own LTR run per the Unicode bidi algorithm) — no override needed;
   listed here only so a future contributor knows this was a deliberate
   omission, not an oversight. ---- */
