/* Arabic pages (ar/*.html, html[dir=rtl]). Loaded after site.css.
   The layouts mirror through dir=rtl on their own; this file sets the Arabic type and fixes what CSS does not mirror:
   physical offsets, arrows, marquees, and the product demos that keep their English, left-to-right chrome. */

/* ---- type ---- */
html[dir=rtl]{--font:'IBM Plex Sans Arabic','Archivo',system-ui,sans-serif;--mono:'IBM Plex Sans Arabic','Archivo',system-ui,sans-serif}
html[dir=rtl] body{font-family:var(--font)}
/* Arabic takes no tracking and has no case: every tracked or uppercase label becomes plain */
html[dir=rtl] *{letter-spacing:0!important;text-transform:none!important}
/* Arabic leading: display lines sit close, as in English; the dots and marks above and below get room inside each
   clipped line reveal through padding that a negative margin takes back, so it never adds space between lines */
html[dir=rtl] :is(h1,h2,.t){line-height:1.14}
html[dir=rtl] h3{line-height:1.3}
html[dir=rtl] p,html[dir=rtl] li,html[dir=rtl] .lead{line-height:1.65}
html[dir=rtl] :is(h1,h2,h3)>.l{padding:.22em 0;margin:-.22em 0}
/* Arabic descenders run deeper than Latin ones: the last line keeps its room, so what follows a heading never touches it */
html[dir=rtl] :is(h1,h2,h3)>.l:last-child{margin-bottom:0}
/* a column of lines whose margins add up instead of collapsing, so each line steps by exactly its line height */
html[dir=rtl] :is(h1,h2,h3):has(>.l){display:flex;flex-direction:column}
/* measures set in ch were tuned for English words: Arabic headings take the width of their column and break evenly */
html[dir=rtl] :is(h1,h2,h3,h4){max-width:none;text-wrap:balance}
/* Arabic without a slant: no italics */
html[dir=rtl] em,html[dir=rtl] i:not([class]){font-style:normal}
/* figures and numbers stay Latin */
html[dir=rtl] [lang=en],html[dir=rtl] .num,html[dir=rtl] time{font-family:'Archivo',var(--font)}

/* ---- things CSS does not mirror ---- */
html[dir=rtl] .marquee{direction:ltr}
html[dir=rtl] .foot a:not(.foot-logo)::after,html[dir=rtl] .legal a::after{margin-left:0;margin-right:.4em;transform:scaleX(-1)}
html[dir=rtl] .foot a:not(.foot-logo):is(:hover,:focus-visible)::after,html[dir=rtl] .legal a:is(:hover,:focus-visible)::after{transform:scaleX(-1)}
html[dir=rtl] .foot a[href^="mailto:"]::after,html[dir=rtl] .foot a[href^="http"]::after,html[dir=rtl] .legal a[href^="http"]::after{transform:none}
html[dir=rtl] .btn svg.arrow,html[dir=rtl] .link svg.arrow,html[dir=rtl] .more svg{transform:scaleX(-1)}
/* every arrow drawn in the pages points the way Arabic reads; scale composes with any hover transform */
html[dir=rtl] svg:has(>path[d="M2 7h10M8 3l4 4-4 4"]),html[dir=rtl] svg:has(>path[d="M3 8h10M9 4l4 4-4 4"]){scale:-1 1}
/* progress lines and reveal hairlines fill from the right */
html[dir=rtl] :is(.phases .tab .fill,.rail .line,.area .prog i,.path .ptrack i,.step .bar i,#inside .ft .bar i,.kst .bar i,.lbar i),
html[dir=rtl] .phase::after,html[dir=rtl] .dcols .drail::after,html[dir=rtl] .area::before,html[dir=rtl] .kgt li::before{transform-origin:right center}
html[dir=rtl] .ditem .plat+.plat{margin-left:0;margin-right:-6px}

/* ---- product demos: English chrome, left to right ---- */
html[dir=rtl] .dm,html[dir=rtl] .dw,html[dir=rtl] [data-i18n="no"],html[dir=rtl] .ss-stage,html[dir=rtl] .stage{direction:ltr;text-align:left}

/* ---- page fixes ---- */
/* hero titles: Arabic lines run longer than the English ones they were sized for */
html[dir=rtl] .phead h1 .l{white-space:normal}
html[dir=rtl] .phead h1{font-size:min(clamp(34px,4.2vw,60px),8.4cqi)}
/* the product cards' arrow points the way the eye reads */
html[dir=rtl] .own svg{transform:scaleX(-1)} html[dir=rtl] .own a:hover svg{transform:scaleX(-1) translateX(4px)}
/* the form's honeypot sat 9999px to the left, which an RTL page can scroll to */
html[dir=rtl] .hp{left:auto;right:auto;inset-inline-start:0;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%)}
/* illustrations keep their coordinates: SVG text anchors as drawn, Arabic runs inside each label */
html[dir=rtl] svg{direction:ltr}
html[dir=rtl] svg text{unicode-bidi:plaintext}
/* legal pages: the copy-link toast opens toward the text, not off the page edge */
html[dir=rtl] .lg-copy .tip{right:auto;left:calc(100% + 8px)}
/* blocks the English pages set flush left read from the right in Arabic */
html[dir=rtl] :is(.inside .tab,#inside .ft>button,.ab-ar,.f-wf .st,#capabilities .cap-head,.cd,#questions .wrap,#questions .faq,.lh,.start-head,.lg-switch a,.lg-switch button,.lg-table caption,.lg-table th,.lg-table td,.lg-also a,.lg-also button){text-align:right}
/* home hero: subtitle close under the title, the button one and a half times that gap below the subtitle */
html[dir=rtl] #heroIn h1>.l:last-child{margin-bottom:-.22em}
html[dir=rtl] #heroIn .sub{margin-top:28px}
html[dir=rtl] #heroIn .cta{margin-top:42px}
/* about hero: the Arabic title is two lines, the third English line is left empty */
html[dir=rtl] .abhero h1>.l:empty,html[dir=rtl] .abhero h1>.l:has(>span:empty){display:none}
html[dir=rtl] .abhero h1>.l:nth-child(2){margin-bottom:0}
html[dir=rtl] .abhero h1 .l{white-space:nowrap}
