/* Arabic / right-to-left overrides. Loaded only on the Arabic pages,
   after style.css and whichever page sheet applies.

   The important one is letter-spacing. Arabic letters join to each other, so
   tracking them pulls the words apart and the script stops reading as script.
   The whole Latin system here is built on wide tracking, so all of it has to be
   switched off for Arabic and restored only where Latin survives. */

[dir="rtl"]{
  /* IBM Plex Sans Arabic carries both the body and the display voice.
     Noto Naskh Arabic stands in for Newsreader: the quieter, human voice. */
  --sans:'IBM Plex Sans Arabic','Archivo',system-ui,sans-serif;
  --wide:'IBM Plex Sans Arabic','Archivo Expanded',system-ui,sans-serif;
  --serif:'Noto Naskh Arabic',Georgia,serif;
}

/* ---------- never track Arabic ---------- */
/* One sweeping rule rather than a list of element selectors. A list loses:
   .nav ul a and .where b each carry a class and two types, which outranks any
   `[dir="rtl"] a` reset, so tracked Arabic survives in exactly the places that
   matter most. Two attribute selectors outrank all of them. */
[dir="rtl"] *:not([lang="en"]){letter-spacing:normal}

/* anything explicitly marked as English keeps its tracking, the wordmark most */
[dir="rtl"] [lang="en"]{letter-spacing:.12em}
[dir="rtl"] .brand span[lang="en"]{letter-spacing:.175em}
/* two classes and two types, so this one outranks even the sweep above */
[dir="rtl"] .flow li.mark span{letter-spacing:normal}

/* uppercase does nothing to Arabic; saying so keeps the CSS honest */
[dir="rtl"] .nav ul a,[dir="rtl"] .tabs a,[dir="rtl"] .covers h2,
[dir="rtl"] .evidence h4,[dir="rtl"] footer h4,[dir="rtl"] footer dt,
[dir="rtl"] .meta dt,[dir="rtl"] .channels h2,[dir="rtl"] .practical dt,
[dir="rtl"] .where b,[dir="rtl"] .where time,[dir="rtl"] .change time,
[dir="rtl"] .creds dd,[dir="rtl"] .cta,[dir="rtl"] .channels .go,
[dir="rtl"] .flow .promise,[dir="rtl"] .flow li.mark span,
[dir="rtl"] .voice figcaption strong,[dir="rtl"] .voice figcaption span,
[dir="rtl"] .explore a span{text-transform:none;font-weight:600}

/* ---------- the small labels need a couple of points back ---------- */
/* Those eyebrows sit at 10.5px because Latin small caps read at that size.
   Arabic has no caps, so the same label is simply small, not quiet. */
[dir="rtl"] .covers h2,[dir="rtl"] .evidence h4,[dir="rtl"] footer h4,
[dir="rtl"] footer dt,[dir="rtl"] .channels h2,
[dir="rtl"] .practical dt{font-size:12.5px}
[dir="rtl"] .cta,[dir="rtl"] .channels .go,[dir="rtl"] .flow .promise,
[dir="rtl"] .flow li.mark span,[dir="rtl"] .meta dt,
[dir="rtl"] .voice figcaption span{font-size:13px}
[dir="rtl"] .nav ul a,[dir="rtl"] .tabs a{font-size:14px}
[dir="rtl"] .change time,[dir="rtl"] .where time{font-size:13.5px}

/* the switcher reads "English" on these pages, so set it in the Latin face */
[dir="rtl"] .nav .lang[lang="en"]{font-family:'Archivo',system-ui,sans-serif;
  font-size:13px;letter-spacing:.1em}

/* ---------- Arabic needs more leading than Latin ---------- */
[dir="rtl"] .hero h1{line-height:1.42;font-weight:700}
[dir="rtl"] .band > h2,[dir="rtl"] .proof h2,[dir="rtl"] .partners h2,
[dir="rtl"] .career > h2,[dir="rtl"] .able > h2{line-height:1.45}
[dir="rtl"] .lede,[dir="rtl"] .intro,[dir="rtl"] p.body{line-height:2.0}
[dir="rtl"] .change p,[dir="rtl"] .steps p,[dir="rtl"] .covers li,
[dir="rtl"] .row p,[dir="rtl"] .record p{line-height:1.95}
[dir="rtl"] blockquote{line-height:1.75}

/* ---------- the pieces that were aligned for Arabic inside an English page ---------- */
[dir="rtl"] footer .names p,
[dir="rtl"] footer .names p.ar,
[dir="rtl"] .practical dd.ar{text-align:start}

/* ---------- things that do not mirror ---------- */
/* Latin-script values stay left-to-right even in an Arabic sentence */
[dir="rtl"] .brand span,
[dir="rtl"] a[href^="mailto"],
[dir="rtl"] a[href^="https://wa.me"],
[dir="rtl"] .evidence dd{direction:ltr;unicode-bidi:isolate}
/* numbers and the CR read as one Latin run */
[dir="rtl"] .meta dd,[dir="rtl"] footer .legal span{unicode-bidi:isolate}

/* the motion sweeps from the right in an RTL page */
[dir="rtl"] .rule{transform-origin:right center}

/* and the hero enters from the side the reader starts on, which is the other
   one. translateX is a physical axis, so the keyframe has to be mirrored by
   hand; there is no logical equivalent. */
@keyframes slide-rtl{from{opacity:0;transform:translateX(26px)}to{opacity:1;transform:none}}
[dir="rtl"] .hero h1,[dir="rtl"] .heroft{animation-name:slide-rtl}
/* that 26px of travel starts outside the 20px gutter on a phone */
[dir="rtl"] .hero{overflow-x:clip}

/* the counter column on numbered lists sits on the correct side automatically
   through the logical properties; only the digits themselves stay Latin */
[dir="rtl"] .steps li::before,[dir="rtl"] .flow li::before,
[dir="rtl"] .first li::before{direction:ltr;letter-spacing:.06em}

/* ---------- guards ---------- */
/* .ln exists to be tracked out to a flush edge; the fitter skips RTL, so a
   span left in an Arabic headline would force a break it cannot justify. */
[dir="rtl"] .hero h1 .ln,[dir="rtl"] .proof h2 .ln,
[dir="rtl"] .partners h2 .ln{display:inline}

/* the registered English name sits in an Arabic definition list */
[dir="rtl"] .practical dt[lang="en"],
[dir="rtl"] .practical dd[lang="en"]{direction:ltr;text-align:start;unicode-bidi:isolate}
