/* Arabic overrides only. Loaded (media="all") when Arabic is active.
   Most mirroring happens automatically through logical properties
   (inset-inline, padding-inline, margin-inline) in the main stylesheets. */

[dir='rtl'] body {
  line-height: 1.85;
}

/* Arabic letters must never be letter spaced or uppercased, it breaks the joining */
[dir='rtl'] h1,
[dir='rtl'] h2,
[dir='rtl'] h3,
[dir='rtl'] .eyebrow,
[dir='rtl'] .co-card__tag,
[dir='rtl'] .event-card__tag,
[dir='rtl'] .mission__text,
[dir='rtl'] .hero__title {
  letter-spacing: 0;
  text-transform: none;
}

[dir='rtl'] h1,
[dir='rtl'] h2,
[dir='rtl'] h3 {
  line-height: 1.35;
  font-weight: 700;
}

[dir='rtl'] .hero__title {
  max-width: 18ch;
}

@media (max-width: 1023px) and (orientation: portrait) {
  [dir='rtl'] .hero__title {
    max-width: none;
  }
}

[dir='rtl'] .mission__text {
  line-height: 1.5;
}

/* Arrows point the other way */
[dir='rtl'] .icon--arrow,
[dir='rtl'] .link-arrow .icon,
[dir='rtl'] .mobile-menu__links .icon {
  transform: scaleX(-1);
}

/* Arrow swap slides the other way */
[dir='rtl'] .arrow-swap {
  --dir: -1;
}

/* A stat number forced to dir="ltr" (the "3+" tile) keeps its text and gold bar on the start (right) side */
[dir='rtl'] .stat__num[dir='ltr'] {
  text-align: right;
}

[dir='rtl'] .stat__num[dir='ltr']::after {
  margin-inline-start: auto;
}

/* Scroll progress grows from the right */
[dir='rtl'] .scroll-progress {
  transform-origin: right center;
}

/* Marquee stays identical to English: an RTL scroll container anchors the wide track to the right edge and leaves empty gaps */
[dir='rtl'] .marquee {
  direction: ltr;
}

/* Mirror the scattered gallery tiles */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  [dir='rtl'] .gs-tile--1 { left: auto; right: 4%; }
  [dir='rtl'] .gs-tile--2 { left: auto; right: 27%; }
  [dir='rtl'] .gs-tile--3 { left: auto; right: 52%; }
  [dir='rtl'] .gs-tile--4 { left: auto; right: 74%; }
  [dir='rtl'] .gs-tile--5 { left: auto; right: 3%; }
  [dir='rtl'] .gs-tile--6 { left: auto; right: 24%; }
  [dir='rtl'] .gs-tile--7 { left: auto; right: 60%; }
  [dir='rtl'] .gs-tile--8 { left: auto; right: 78%; }
}

/* Phone numbers and emails stay left to right inside Arabic text */
[dir='rtl'] a[href^='tel:'],
[dir='rtl'] a[href^='mailto:'] {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Company page heroes: the dark side overlay follows the text, so it sits on the right in Arabic */
[dir='rtl'] .cv2-hero::after {
  background:
    linear-gradient(to top, var(--navy) 2%, var(--navy-85) 30%, var(--navy-45) 62%, var(--navy-60) 100%),
    linear-gradient(270deg, var(--navy-72) 0%, transparent 62%);
}

[dir='rtl'] .cv2-hero--clear::after {
  background:
    linear-gradient(to top, var(--navy) 0%, var(--navy-45) 24%, transparent 48%),
    linear-gradient(270deg, var(--navy-85) 0%, var(--navy-60) 42%, var(--navy-15) 78%, transparent 100%);
}

/* Tablet and phone: same shading from below as in English (the side shadow is only for the desktop column layout) */
@media (max-width: 1023px) {
  [dir='rtl'] .cv2-hero::after,
  [dir='rtl'] .cv2-hero--clear::after {
    background:
      linear-gradient(to top, var(--navy) 0%, var(--navy-85) 26%, var(--navy-45) 52%, transparent 78%),
      linear-gradient(to bottom, var(--navy-60) 0%, transparent 26%);
  }
}
