/* Arabic / RTL layer. Loaded only on ar-* pages. */
html[dir="rtl"],html[dir="rtl"] *{font-family:'Cairo','Segoe UI',Tahoma,system-ui,sans-serif!important;letter-spacing:0!important;text-transform:none!important;}
html[dir="rtl"] body{line-height:1.75;}
html[dir="rtl"] h1,html[dir="rtl"] h2,html[dir="rtl"] h3,html[dir="rtl"] h4{line-height:1.3!important;}
html[dir="rtl"] [style*="text-align:left"],html[dir="rtl"] [style*="text-align: left"]{text-align:right!important;}
html[dir="rtl"] [style*="text-align:right"],html[dir="rtl"] [style*="text-align: right"]{text-align:left!important;}
html[dir="rtl"] .trow,html[dir="rtl"] .pmarqueeWrap,html[dir="rtl"] .pmarquee-track,html[dir="rtl"] .ttrack,html[dir="rtl"] [class*="marquee-track"]{direction:ltr;}
html[dir="rtl"] .pmarquee-track>*,html[dir="rtl"] .ttrack>*{direction:rtl;}
html[dir="rtl"] canvas,html[dir="rtl"] svg{direction:ltr;}
html[dir="rtl"] .sf-link:hover{transform:translateX(-3px);}
html[dir="rtl"] code,html[dir="rtl"] pre,html[dir="rtl"] .ltr,html[dir="rtl"] a[href^="mailto:"]{direction:ltr;unicode-bidi:isolate;}
html[dir="rtl"] input,html[dir="rtl"] textarea{text-align:right;}
html[dir="rtl"] .pcard-ghost{right:auto;left:8px;}
html[dir="rtl"] .pcard-check{right:auto;left:6px;}
html[dir="rtl"] #foundSec .fd-idx,html[dir="rtl"] #aboutStats .fd-idx{right:auto;left:22px;}
html[dir="rtl"] .rotorLine{line-height:1.5!important;padding-top:6px;}
/* legibility floor: Cairo below 11px is unreadable */
html[dir="rtl"] [style*="font-size: 7px"],html[dir="rtl"] [style*="font-size: 8px"],html[dir="rtl"] [style*="font-size: 9px"],html[dir="rtl"] [style*="font-size: 9.5px"],html[dir="rtl"] [style*="font-size: 10px"],html[dir="rtl"] [style*="font-size: 10.5px"],html[dir="rtl"] [style*="font-size:7px"],html[dir="rtl"] [style*="font-size:8px"],html[dir="rtl"] [style*="font-size:9px"],html[dir="rtl"] [style*="font-size:10px"]{font-size:11px!important;}
/* titles: Cairo runs wider than the Latin face; cap h1 so hero titles (+ rotor line) stay within 3 lines */
html[dir="rtl"] h1,html[dir="rtl"] h1+div[style*="8vw"]{font-size:clamp(28px,5vw,50px)!important;line-height:1.3!important;text-wrap:balance;}
/* oversized italic-serif accent words inside h1 (industry pages) follow the h1 size in Arabic */
html[dir="rtl"] h1 span[style*="Cormorant"],html[dir="rtl"] h2 span[style*="Cormorant"]{font-size:inherit!important;font-style:normal!important;}
/* section ruler sits on the free (left) edge in RTL */
html[dir="rtl"] .snav-wrap{right:auto;left:20px;}
html[dir="rtl"] .snav-axis,html[dir="rtl"] .snav-axis-fill{right:auto;left:0;}
html[dir="rtl"] .snav-tick-num{transform:translateX(-4px);}
html[dir="rtl"] .heroRotor{margin-top:6px!important;}
/* eyebrow labels (rule + short caps text): keep on one line now that letter-spacing is off */
html[dir="rtl"] div[style*="inline-flex"][style*="letter-spacing: 0.3em"] .sc-interp,html[dir="rtl"] div[style*="inline-flex"][style*="letter-spacing:0.3em"] .sc-interp,html[dir="rtl"] div[style*="inline-flex"][style*="letter-spacing: 0.3em"]>span:last-child,html[dir="rtl"] div[style*="inline-flex"][style*="letter-spacing:0.3em"]>span:last-child{white-space:nowrap;}

/* flip forward-arrow icons in RTL */
html[dir="rtl"] svg:has(path[d="M5 12h14M12 5l7 7-7 7"]){transform:scaleX(-1)}

/* nowrap for pill labels */
html[dir="rtl"] .memchip,html[dir="rtl"] .navlink{white-space:nowrap}

/* blog chips */
html[dir="rtl"] .catbtn,html[dir="rtl"] .chip,html[dir="rtl"] .tag,html[dir="rtl"] [class*="chip"],html[dir="rtl"] [class*="tag"]{white-space:nowrap}

html[dir="rtl"] span[style*="var(--fw)"],html[dir="rtl"] span[style*="var(--ed)"]{white-space:nowrap}

/* avatars / icon circles must stay round when Arabic text beside them wraps */
html[dir="rtl"] [style*="border-radius: 50%"][style*="width: 46px"],html[dir="rtl"] [style*="border-radius: 50%"][style*="width: 38px"],html[dir="rtl"] [style*="border-radius: 50%"][style*="width: 40px"],html[dir="rtl"] [style*="border-radius: 50%"][style*="width: 44px"],html[dir="rtl"] [style*="border-radius: 50%"][style*="width: 48px"],html[dir="rtl"] [style*="border-radius: 50%"][style*="width: 56px"],html[dir="rtl"] [style*="border-radius: 50%"][style*="width: 64px"]{flex-shrink:0;aspect-ratio:1/1;}

/* ruler overlaps right-aligned copy below the full-nav breakpoint */
@media(max-width:1100px){html[dir="rtl"] .snav-wrap{display:none!important;}}

/* header mega menus anchor to the item's inline-start edge */
html[dir="rtl"] .sh-mega.sh-left{left:auto;right:0;}
html[dir="rtl"] .sh-mega.sh-right{right:auto;left:0;}
/* article-style h1 (case study detail): keep the article scale */
html[dir="rtl"] h1[style*="font-size: 44px"]{font-size:clamp(26px,3.8vw,40px)!important;}

/* phones: long eyebrows may wrap; 3-up stat grids stack */
@media(max-width:640px){
  html[dir="rtl"] div[style*="inline-flex"][style*="letter-spacing: 0.3em"] .sc-interp,html[dir="rtl"] div[style*="inline-flex"][style*="letter-spacing:0.3em"] .sc-interp,html[dir="rtl"] div[style*="inline-flex"][style*="letter-spacing: 0.3em"]>span:last-child,html[dir="rtl"] div[style*="inline-flex"][style*="letter-spacing:0.3em"]>span:last-child{white-space:normal;}
  html[dir="rtl"] div[style*="grid-template-columns: repeat(3, 1fr)"],html[dir="rtl"] div[style*="grid-template-columns:repeat(3,1fr)"]{grid-template-columns:1fr!important;}
}

/* accent rules on callouts / blockquotes sit on the reading-start (right) edge */
html[dir="rtl"] blockquote[style*="border-left"],html[dir="rtl"] div[style*="border-left: 3px"],html[dir="rtl"] div[style*="border-left:3px"],html[dir="rtl"] div[style*="border-left: 2px"],html[dir="rtl"] div[style*="border-left:2px"]{border-left:0!important;border-right:3px solid var(--accent)!important;}
html[dir="rtl"] blockquote[style*="border-radius: 0px 12px 12px 0px"],html[dir="rtl"] blockquote[style*="border-radius:0 12px 12px 0"]{border-radius:12px 0 0 12px!important;}
