/* Arabic (right to left) fixes for the homepage platform section
   (<section id="platform">: .eng-head and the layered diagram .lay).
   Load after css/teradix-rtl.css. Grid and flex order already follow the
   direction: the five products run 01 to 05 from the right, the agent cells
   sit under their steps, and the band art moves to the right with its column.
   Not mirrored on purpose: the isometric band art, the vertical wires and
   their dots, the up and down flow glyphs, and the small bar chart. */

/* ---- type: Arabic needs more leading than the Latin display settings ---- */
[dir="rtl"] .eng-head .eng-head__sub{line-height:var(--lh-ar-h3)}
[dir="rtl"] .eng-head .eng-head__def{line-height:var(--lh-ar-ui);font-size:14px;font-weight:700;margin-bottom:6px}
[dir="rtl"] .lay .lay__band-tx b{line-height:1.4}
[dir="rtl"] .lay .lay__band-tx span{line-height:1.7}
[dir="rtl"] .lay .lay__flows{line-height:var(--lh-ar-ui)}
[dir="rtl"] .lay .lay__tx-h{line-height:1.7}
[dir="rtl"] .lay .lay__tx-name{line-height:1.4}
[dir="rtl"] .lay .lay__no{line-height:var(--lh-ar-ui);font-size:13px}
[dir="rtl"] .lay .lay__prod b{line-height:1.4}
[dir="rtl"] .lay .lay__what{line-height:1.7}
[dir="rtl"] .lay .lay__ai-h{line-height:1.7}
[dir="rtl"] .lay .lay__ai-h b{line-height:1.4}
[dir="rtl"] .lay .lay__ai-cells b{line-height:1.4}
[dir="rtl"] .lay .lay__ai-cells span{line-height:1.7}
[dir="rtl"] .lay .lay__spend-tx b{line-height:1.4}
[dir="rtl"] .lay .lay__spend-tx span{line-height:1.7}
[dir="rtl"] .lay .lay__spend-agent b{line-height:1.4}
/* the figure is Latin and keeps its tight leading; only the Arabic caption opens up */
[dir="rtl"] .lay strong small{line-height:1.5;font-size:13.5px;max-width:20ch}
[dir="rtl"] .lay strong bdi{direction:ltr;text-align:right}
[dir="rtl"] .flow__note{line-height:1.8}

/* ---- product cards ---- */
/* the chevron between two steps sits in the gap on the right and points left */
[dir="rtl"] .lay__prod+.lay__prod::before{left:auto;right:calc(var(--g) * -.5 - 7px);border-width:0 0 3px 3px}
/* the "open" arrow moves to the top-left corner */
[dir="rtl"] .lay__go{right:auto;left:14px}
[dir="rtl"] .lay__prod a:hover .lay__go,
[dir="rtl"] .lay__spend:hover .lay__go{transform:translateX(-4px)}
/* hover: the lime block falls to the bottom-left, the card lifts up and right */
[dir="rtl"] .lay__prod a:hover{transform:translate(3px,-3px);box-shadow:-8px 8px 0 #E7FF5A}
[dir="rtl"] .lay__prod.is-hot a:hover{box-shadow:inset 0 0 0 2px #0203E9,-8px 8px 0 #E7FF5A}

/* ---- Teradix AI ---- */
[dir="rtl"] .lay__ai-h b{margin-right:0;margin-left:8px}
/* cell dividers move to the left edge of each cell */
[dir="rtl"] .lay__ai-cells li{border-right:0;border-left:1.5px solid rgba(12,23,134,.2)}
[dir="rtl"] .lay__ai-cells li:last-child{border-left:0}
[dir="rtl"] .lay__ai-wide{border-right:0!important;border-left:1.5px solid rgba(12,23,134,.2)!important}
/* the rule that draws across the top of a cell starts from the right */
[dir="rtl"] .lay__ai-cells li::before{transform-origin:100% 50%}
@media(max-width:1000px){
  [dir="rtl"] .lay__ai-cells li{border-left:0}
  [dir="rtl"] .lay__ai-wide{border-left:0!important}
}

/* ---- Spend Analytics ---- */
[dir="rtl"] .lay__spend{padding:clamp(14px,1.4vw,20px) clamp(14px,1.4vw,20px) clamp(14px,1.4vw,20px) 52px;border-left:0;border-right:8px solid #E7FF5A}
[dir="rtl"] .lay__spend:hover{transform:translate(3px,-3px);box-shadow:-8px 8px 0 #E7FF5A}
/* a small chart with a time axis: it keeps rising to the right */
[dir="rtl"] .lay__bars{direction:ltr}
/* narrow screens: the figure takes its own row, so its width no longer sets the
   icon column and squeezes the Arabic title into a sliver */
@media(max-width:1000px){
  [dir="rtl"] .lay__spend strong{grid-column:1/-1}
  [dir="rtl"] .lay__spend strong small{max-width:none}
}
/* phones: the arrow moves up to the top-left corner, so the copy column gets the
   52px that the centred arrow was holding back and stops wrapping every few words */
@media(max-width:700px){
  [dir="rtl"] .lay__spend{padding-left:clamp(14px,1.4vw,20px)}
  [dir="rtl"] .lay__spend .lay__go{top:18px;margin-top:0}
}
