/* Right-to-left fixes for the homepage problem section
   (.gap-head, the "today" illustration and the seven-step strip .gflow).
   Load after css/teradix-rtl.css. Every selector starts with [dir="rtl"]. */

/* ── heading block ─────────────────────────────────────────────────────── */
/* the English rule sets line-height:1.06 with a heavier selector than the base floor */
[dir="rtl"] .section:has(.gflow) .gap-head h2{line-height:var(--lh-ar-h2);max-width:24ch!important;text-wrap:balance}
[dir="rtl"] .section:has(.gflow) .gap-sub{line-height:var(--lh-ar-ui)}
/* the drawing moves to the left column with the grid; push it to the outer (left) edge */
[dir="rtl"] .section:has(.gflow) .gap-head .ill{margin-left:0;margin-right:auto}

/* ── labels pinned on the illustration ─────────────────────────────────────
   They sit at inline left:% over a picture that is never flipped, so the
   positions stay physical. Only the Arabic line-height is raised. */
[dir="rtl"] .gap-head .ill__l{line-height:1.35}
[dir="rtl"] .gap-head .ill__l small{line-height:1.4;margin-top:.1em}

/* ── the seven steps ───────────────────────────────────────────────────────
   The grid follows the direction: step 01 sits on the right, 07 on the left. */
[dir="rtl"] .gflow__s{border-right:0;border-left:1.5px solid rgba(143,214,255,.22)}
[dir="rtl"] .gflow__s:last-child{border-left:0}
[dir="rtl"] .gflow__s i{direction:ltr;unicode-bidi:isolate;text-align:right}
[dir="rtl"] .gflow__s b{line-height:1.4}
[dir="rtl"] .gflow__s--erp span{line-height:var(--lh-ar-ui)}
[dir="rtl"] .gflow__how{line-height:var(--lh-ar-ui)}
[dir="rtl"] .gflow__s strong{line-height:1.45}
/* the tick of an "in the ERP" step goes to the far (left) corner */
[dir="rtl"] .gflow__s--erp::after{right:auto;left:10px}
/* the lime timer bar fills in the reading direction, from the right */
[dir="rtl"] .gflow__s--hot::before{transform-origin:100% 50%}

/* legend */
[dir="rtl"] .gflow__legend{line-height:var(--lh-ar-ui)}

/* ── text drawn inside the four scenes ─────────────────────────────────────
   The scenes are never mirrored. Arabic letters join, so tracking is removed. */
[dir="rtl"] .gflow__art text{letter-spacing:0}
[dir="rtl"] .gflow__art .t-tag{font-size:11px}

/* ── narrow screens ────────────────────────────────────────────────────────
   In the English stylesheet a later desktop rule for .gflow__row overrides its
   own breakpoints, so the strip stays seven columns wide on a phone. The
   Arabic page restores the intended two-column and one-column layouts here. */
@media(max-width:1000px){
  [dir="rtl"] .gflow__row{grid-template-columns:repeat(2,minmax(0,1fr))}
  [dir="rtl"] .gflow__s{border-left:0}
  /* the three "in the ERP" steps are one-line rows: let each span the full width,
     so the four costly steps pair up (02|03, 04|05) with no empty blocks */
  [dir="rtl"] .gflow__s--erp{grid-column:1/-1}
  [dir="rtl"] .gflow__s--hot:nth-child(even){border-left:1.5px solid rgba(143,214,255,.22)}
  /* an older .ba__svg rule gives the scenes a 900px minimum width below 860px */
  [dir="rtl"] .gflow__art.ba__svg{min-width:0}
}
@media(max-width:560px){
  [dir="rtl"] .gflow__row{grid-template-columns:1fr}
  [dir="rtl"] .gflow__s--hot:nth-child(even){border-left:0}
  /* keep the widest lime label inside the phone screen */
  [dir="rtl"] .gflow__fig{margin-inline:0}
}

/* ── strip v2 (tools/brand/gflow.py) ───────────────────────────────────────── */
/* the rail runs in the reading direction: mirror it so the purchase travels from 01 on the right */
[dir="rtl"] .gflow--v2 .gflow__rail{transform:scaleX(-1)}
[dir="rtl"] .gflow--v2 .gflow__s--erp::after{left:0;right:0}
/* tracked capitals break Arabic joining */
[dir="rtl"] .gflow--v2 .gflow__top em,[dir="rtl"] .gflow--v2 .gflow__rec,[dir="rtl"] .gflow--v2 .gflow__k{letter-spacing:0;font-size:12px;line-height:1.4}
[dir="rtl"] .gflow--v2 .gflow__k::after{background:linear-gradient(270deg,rgba(231,255,90,.45),transparent)}
/* labels drawn inside the scenes keep their physical anchor points */
[dir="rtl"] .gf text{direction:ltr;letter-spacing:0}
[dir="rtl"] .gf .gf-late{font-size:10.5px}
@media(max-width:1000px){[dir="rtl"] .gflow--v2 .gflow__rec{margin-left:0;margin-right:auto}}
