/* ==========================================================================
   Arabic (right to left) fixes: the customer stories section of the homepage.
   Load after css/teradix-rtl.css. Scope: .cases, .cases-head, .cx, .cx__*,
   .cxv, .cxv__*, .cs-foot. Every selector starts with [dir="rtl"].

   Already done by the base, not repeated here: the arrow icon points left,
   the "Book a demo" button block and hover, the eyebrow and h2 leading, the
   highlight underline, inline SVG kept left to right.

   Never mirrored here: the films and their play triangle, the three isometric
   proof scenes, the "film coming soon" bars (a chart with a time axis), the
   quotation-mark icon and the cut-out portrait crop.
   ========================================================================== */

/* ---- 1. Counter and the previous / next buttons --------------------------
   The base turns the arrow left. "Next" (second button, now on the left)
   keeps it; "Previous" (first button, now on the right) is already rotated
   by the English rule, so it points right. Only the hover block moves. */
[dir="rtl"] .cx__count{line-height:var(--lh-ar-ui)}
[dir="rtl"] .cx__nav button:hover{transform:translate(2px,-2px);box-shadow:-5px 5px 0 #E7FF5A}

/* ---- 2. Story cards (.cx__rail) ------------------------------------------
   The grid already runs right to left: story 01 sits on the right. */
[dir="rtl"] .cx__pick,
[dir="rtl"] .cx__pick+.cx__pick{text-align:right}
[dir="rtl"] .cx__pick:hover{transform:translate(3px,-3px);box-shadow:-6px 6px 0 #C3C9F0}
[dir="rtl"] .cx__pick:not(.on){box-shadow:-5px 5px 0 #C3C9F0}
[dir="rtl"] .cx__pick:not(.on):hover{box-shadow:-9px 9px 0 #0203E9;transform:translate(4px,-4px)}
[dir="rtl"] .cx__pick.on{transform:translate(4px,-4px);box-shadow:-10px 10px 0 #E7FF5A}
/* the card number moves to the top-left corner, and the title clears it there */
[dir="rtl"] .cx__no{right:auto;left:16px}
[dir="rtl"] .cx__pt{padding-right:0;padding-left:22px}
/* Arabic needs more leading than the Latin 1.2, most of all inside a clamped box */
/* three lines, not two: at tablet widths two lines cut the hospital's name short */
[dir="rtl"] .cx__pt b{line-height:1.5;-webkit-line-clamp:3}
[dir="rtl"] .cx__pt small{line-height:1.6}
/* the headline figure: Latin figures ("+30×") read left to right, Arabic words
   ("توفير حقيقي") right to left, and both sit against the right edge */
[dir="rtl"] .cx__fig{unicode-bidi:plaintext;text-align:right;line-height:1.3}
[dir="rtl"] .cx__cue{line-height:var(--lh-ar-ui)}
/* the "view this story" cue is taken out of the flow by the English sheet, so its row
   is empty and the taller Arabic line ran past the bottom edge of the card on a phone.
   Reserve one Arabic line for it (the same height the "now showing" cue already takes). */
[dir="rtl"] .cx__pick:not(.on) .cx__cue{min-height:1.5em}
/* the timer bar fills in the reading direction */
[dir="rtl"] .cx__bar i{transform-origin:100% 50%}
/* the "view this story" arrow nudges left */
[dir="rtl"] .cx__pick:not(.on) .cx__cue svg{animation-name:cxNudgeRtl}
@keyframes cxNudgeRtl{0%,60%,100%{transform:translateX(0)}30%{transform:translateX(-6px)}}

/* ---- 3. Stage: a story going forward enters from the left ----------------- */
[dir="rtl"] .cx[data-dir="f"] .cx__panel.on .cx__left>*,
[dir="rtl"] .cx[data-dir="f"] .cx__panel.on .cx__right>*{animation-name:caseL}
[dir="rtl"] .cx[data-dir="b"] .cx__panel.on .cx__left>*,
[dir="rtl"] .cx[data-dir="b"] .cx__panel.on .cx__right>*{animation-name:caseR}

/* ---- 4. Film frame --------------------------------------------------------
   The picture is never flipped. Its controls move: play block and caption to
   the bottom-right, "preview" tag to the top-right, corner marks to the left,
   lime offset block to the bottom-left, progress fills from the right. */
[dir="rtl"] .cx__film{text-align:right}
[dir="rtl"] .cx__filmwrap::before{transform:translate(-14px,14px)}
[dir="rtl"] .cx__panel.on .cx__filmwrap::before{animation-name:cxBlockRtl}
@keyframes cxBlockRtl{from{transform:translate(0,0)}to{transform:translate(-14px,14px)}}
[dir="rtl"] .cx__play{left:auto;right:0;transform-origin:100% 100%}
[dir="rtl"] .cx__filmbar{left:auto;right:96px;line-height:var(--lh-ar-ui);bottom:22px}
[dir="rtl"] .cx__filmbar i{line-height:var(--lh-ar-ui);padding:3px 9px}
[dir="rtl"] .cx__film--soon .cx__filmbar{left:auto;right:24px;bottom:18px}
[dir="rtl"] .cx__live{left:auto;right:16px;line-height:var(--lh-ar-ui);padding:4px 10px}
[dir="rtl"] .cx__corner--a{right:auto;left:14px;border-left:3px solid #E7FF5A;border-right:0}
[dir="rtl"] .cx__corner--b{right:auto;left:14px;border-left:3px solid #E7FF5A;border-right:0}
[dir="rtl"] .cx__prog{left:0;right:76px}
[dir="rtl"] .cx__prog i{transform-origin:100% 50%}
/* a falling-bid chart: time runs left to right in every language */
[dir="rtl"] .cx__soonbars{direction:ltr}

/* ---- 5. Testimonial block (.cxv) ------------------------------------------ */
[dir="rtl"] .cxv .cxv__mark{left:auto;right:clamp(20px,5cqw,34px)}
[dir="rtl"] .cxv .cxv__quote p{line-height:1.65}
/* portrait: the lime block falls to the bottom-left */
[dir="rtl"] .cxv .cxv__face{margin:0 0 6px 6px}
[dir="rtl"] .cxv .cxv__face::before{transform:translate(-6px,6px)}
[dir="rtl"] .cx__panel.on .cxv .cxv__face::before{animation-name:cxvBlockRtl}
@keyframes cxvBlockRtl{from{transform:translate(0,0)}to{transform:translate(-6px,6px)}}
[dir="rtl"] .cxv .cxv__who{line-height:1.6}
[dir="rtl"] .cxv .cxv__who b{line-height:1.4}
/* the link sits at the far left of the signature line; its arrow nudges left */
[dir="rtl"] .cxv .cxv__more{margin-left:0;margin-right:auto;line-height:var(--lh-ar-ui)}
[dir="rtl"] .cxv .cxv__more:hover i{transform:translateX(-5px)}
/* impact cells: the figure keeps its Latin order and sits against the right edge */
[dir="rtl"] .cxv .cxv__cell b{unicode-bidi:plaintext;text-align:right;line-height:1.25}
[dir="rtl"] .cxv .cxv__cell span{line-height:1.55}
@container (max-width:470px){
  [dir="rtl"] .cxv .cxv__more{margin-right:0}
}

/* ---- 6. Proof column (.cx__right) ----------------------------------------- */
[dir="rtl"] .cx__kicker{line-height:var(--lh-ar-ui)}
/* the big figure: Latin display type runs at .95, Arabic words need room */
[dir="rtl"] .cx__metric b{unicode-bidi:plaintext;line-height:1.25}
[dir="rtl"] .cx__metric span{line-height:1.7}
/* labels pinned on the scenes keep their inline left/top (the drawings are not
   flipped); they only get Arabic leading inside the same box height */
[dir="rtl"] .cx__tag{line-height:1.5;padding:.3em .7em}
/* a figure inside a label: the base isolates <bdi> but lets it inherit right to left,
   which turned "+30x" back to front. Force its own order here. */
[dir="rtl"] .cx__tag bdi{direction:ltr}
/* one exception: the Wadi "direct savings" label is pinned at left:74% and the
   Arabic wording runs past the edge of the scene on a phone, so it is anchored
   to the right edge instead (same spot on a wide screen) */
[dir="rtl"] #cs-wadi .cx__proof .cx__tag:last-of-type{left:auto!important;right:1%}

/* ---- 7. Numbers strip and closing line (.cs-foot) ------------------------- */
[dir="rtl"] .cs-foot__nums b{unicode-bidi:plaintext;text-align:right}
[dir="rtl"] .cs-foot__nums span{line-height:1.6}
[dir="rtl"] .cs-foot__cta p{line-height:1.55}

/* ---- 8. Narrow screens ----------------------------------------------------- */
@media(max-width:900px){
  [dir="rtl"] .cx__pick.on{transform:none;box-shadow:-6px 6px 0 #E7FF5A}
  [dir="rtl"] .cx__filmwrap::before{transform:translate(-8px,8px)}
  @keyframes cxBlockRtl{from{transform:translate(0,0)}to{transform:translate(-8px,8px)}}
  [dir="rtl"] .cx__filmbar{left:auto;right:76px;bottom:16px}
  [dir="rtl"] .cx__prog{left:0;right:60px}
}

/* ---- 9. Reduced motion (the English rule is not !important for these) ----- */
@media(prefers-reduced-motion:reduce){
  [dir="rtl"] .cx__pick:not(.on) .cx__cue svg,
  [dir="rtl"] .cx__panel.on .cx__filmwrap::before,
  [dir="rtl"] .cx__panel.on .cxv .cxv__face::before{animation:none!important}
}
