/* ==========================================================================
   UBM — rtl.css
   The RTL corrections that logical properties genuinely cannot cover.

   Everything else mirrors for free because the layout CSS uses inline-size,
   margin-inline, inset-inline-*, padding-block and text-align:start. If this
   file ever grows past a screen or two, the layout CSS was written wrong.

   Five categories only:
     1. transform-origin for scaleX underlines
     2. marquee travel direction
     3. physical-axis gradients and masks
     4. directional glyphs (arrows, chevrons) and directional translations
     5. decorative artwork that must be mirrored — and technical drawings
        that must NOT be
   Load last: fonts → tokens → base → motion → sections → rtl
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. transform-origin — CSS has no logical keyword for it.
   base.css already reads --to-origin on .link; the same token drives every
   scaleX underline in sections.css.
   -------------------------------------------------------------------------- */
[dir="rtl"] {
  --to-origin: right;
}

/* --------------------------------------------------------------------------
   2. Marquee — the track flows right-to-left, so it must travel the other way.
   -------------------------------------------------------------------------- */
[dir="rtl"] .marquee__track { --marquee-to: 50%; }
[dir="rtl"] .logo-wall__rail + .logo-wall__rail .marquee__track { animation-direction: normal; }

/* --------------------------------------------------------------------------
   3. Gradients and masks on the physical inline axis
   -------------------------------------------------------------------------- */
[dir="rtl"] .hero__scrim {
  background:
    linear-gradient(to bottom,
      color-mix(in srgb, var(--c-ink-950) 92%, transparent) 0%,
      color-mix(in srgb, var(--c-ink-950) 30%, transparent) 34%,
      color-mix(in srgb, var(--c-ink-950) 88%, transparent) 82%,
      var(--c-ink-950) 100%),
    linear-gradient(to left,
      color-mix(in srgb, var(--c-ink-950) 84%, transparent) 0%,
      color-mix(in srgb, var(--c-ink-950) 24%, transparent) 62%,
      transparent 100%);
}

/* --------------------------------------------------------------------------
   4. Directional glyphs and nudges
   -------------------------------------------------------------------------- */

/* Any icon marked as pointing along the reading direction */
[dir="rtl"] [data-icon="arrow"],
[dir="rtl"] .job-card__go svg,
[dir="rtl"] .link__arrow,
[dir="rtl"] .section-foot .link svg { transform: scaleX(-1); }

/* Hover nudges that move "forward" */
[dir="rtl"] .job-card:hover .job-card__go { transform: translate3d(-4px, 0, 0); }

/* Breadcrumb chevron: the corner is drawn with logical borders, so in RTL it
   is already the mirrored corner (top + left). Turning it -45deg points it at
   the start of the line, as a left chevron. (-135deg pointed it down.) */
[dir="rtl"] .breadcrumb li + li::before { transform: rotate(-45deg); }

/* Absolutely positioned orbit labels. Each label carries the node's viewBox
   position as a percentage and must sit ON its node — but the SVG behind it
   is a technical drawing on absolute viewBox coordinates, so it does not
   mirror (see §5 below). inset-inline-start would anchor the label from the
   RIGHT edge in RTL, mirroring every label away from its node, so the labels
   are pinned to the physical left instead and keep the centring translate
   from sections.css unchanged. Below 47.99rem they are position:static and
   `left` is inert, so no mobile guard is needed. */
[dir="rtl"] .orbit-figure__label {
  inset-inline-start: auto;
  left: var(--nx, 50%);
}

/* --------------------------------------------------------------------------
   5. Artwork
   -------------------------------------------------------------------------- */

/* Decorative arcs derived from the mark read as a mirror image in RTL. */
[dir="rtl"] .page-hero__arc { transform: translateY(-50%) scaleX(-1); }

/* Technical drawings must NOT mirror — a rack elevation is a rack elevation,
   and a patch panel numbered 01→24 stays numbered 01→24. Pin the drawing's
   inline base direction to LTR so text-anchor keeps its designed side, and
   let each annotation resolve its own direction from its content, so Arabic
   labels still read correctly inside an LTR-anchored drawing. */
[dir="rtl"] .ill { direction: ltr; }
[dir="rtl"] .ill text { unicode-bidi: plaintext; }

/* Bare numeral runs stay LTR inside otherwise-RTL running text (U counts, ports).
   Do NOT add <time> here: an Arabic short date is "7 أغسطس 2026" — a numeral,
   an Arabic word, then a numeral. Pinning that to an LTR base makes the bidi
   algorithm reorder it to "7 2026 أغسطس", dropping the year between the day and
   the month. It already reads correctly under the inherited RTL base. */
[dir="rtl"] .stat-band__value,
[dir="rtl"] .pagination__link,
[dir="rtl"] .table__num { direction: ltr; unicode-bidi: isolate; }
