/*
 * Right-to-left pages (Arabic). Loaded only when <html dir="rtl">, after the page styles.
 * Every rule starts with [dir="rtl"] so it can never change a left-to-right page.
 */

/* Arabic letters: Cairo replaces Bebas Neue and Inter, which have none. */
[dir="rtl"] {
  --fd: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --fb: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

/* Letter spacing breaks the joined Arabic letters; capitals do not exist. */
[dir="rtl"] body,
[dir="rtl"] body * {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* Bebas Neue is tall and narrow; Cairo needs more room between lines and a smaller size. */
[dir="rtl"] :is(.display-title, .section-title, h1, h2) {
  font-weight: 800;
  line-height: 1.3;
}
[dir="rtl"] .display-title { font-size: clamp(2.2rem, 4.2vw, 4.4rem); }
[dir="rtl"] .section-title { font-size: clamp(1.8rem, 3vw, 2.8rem); }
[dir="rtl"] :is(h3, strong, .nav-link, .btn-primary, .btn-secondary) { font-weight: 700; }
[dir="rtl"] .home-hero-copy .display-title em { font: 500 .88em/1.3 var(--fd); font-style: normal; }

/* Arrows point the way you read. */
[dir="rtl"] .icon:is([data-icon="arrow-right"], [data-icon="arrow-left"], [data-icon="chevron-right"], [data-icon="chevron-left"]) {
  transform: scaleX(-1);
}

/* Header and menu */
[dir="rtl"] .skip-link { left: auto; right: 10px; }
[dir="rtl"] .nav-link::after { left: auto; right: 0; }
[dir="rtl"] .mobile-sidebar { inset: 0 0 0 auto; transform: translateX(102%); }
[dir="rtl"] .mobile-sidebar.open { transform: none; }
[dir="rtl"] .status-message ul { padding-left: 0; padding-right: 20px; }

/* Shared blocks */
[dir="rtl"] .how-steps li::before { left: auto; right: 0; }
[dir="rtl"] .team-banner::before { background: linear-gradient(270deg, #0e0b07 28%, rgba(14, 11, 7, .94) 46%, rgba(14, 11, 7, .12) 78%); }
[dir="rtl"] .summary-list dd { text-align: left; }
[dir="rtl"] .summary-list .summary-stack dd { text-align: right; }
[dir="rtl"] :is(.prose ul, .prose ol) { padding-left: 0; padding-right: 24px; }
[dir="rtl"] :is(.prose th, .prose td) { text-align: right; }
@media (max-width: 760px) {
  [dir="rtl"] .team-banner::before { background: linear-gradient(270deg, rgba(14, 11, 7, .96), rgba(14, 11, 7, .84)); }
}

/* Concept, Team building and Contact heroes: the picture moves to the left. */
[dir="rtl"] .service-hero-image { inset: 0 auto 0 0; object-position: 28% center; }
[dir="rtl"] .service-hero::after { background: linear-gradient(270deg, #080705 36%, rgba(8,7,5,.91) 44%, transparent 66%); }

/* Home: the video hero is darker on the right, where the Arabic copy sits. */
[dir="rtl"] .home-hero-playback { right: auto; left: clamp(16px, 2.4vw, 34px); }
/* The video has no text, so it is mirrored: the glowing door moves away from the Arabic copy. */
[dir="rtl"] .home-hero-video { transform: scaleX(-1); }
[dir="rtl"] .home-hero-bloom { background: radial-gradient(ellipse 36% 48% at 36% 40%, rgb(255 196 84 / .5), rgb(255 170 60 / .16) 45%, transparent 72%); }
@media (min-width: 761px) {
  [dir="rtl"] .home-hero-panel::before {
    background:
      linear-gradient(270deg, rgb(8 7 5 / .94) 0%, rgb(8 7 5 / .82) 40%, rgb(8 7 5 / .55) 55%, rgb(8 7 5 / .15) 75%, rgb(8 7 5 / .05) 100%),
      linear-gradient(0deg, rgb(8 7 5 / .82) 0%, transparent 40%);
  }
}
@media (max-width: 760px) {
  [dir="rtl"] .home-hero-playback { left: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  [dir="rtl"] .home-hero-still { animation-name: hero-still-drift-rtl; }
}
@keyframes hero-still-drift-rtl {
  from { transform: scale(1.03); }
  to { transform: scale(1.12) translate(1.5%, -1%); }
}

/* Game slider (top of the Concept page) */
[dir="rtl"] .slider-caption { padding: 16px clamp(18px, 2vw, 26px) 18px 132px; }
[dir="rtl"] .slider-controls { right: auto; left: 18px; }
[dir="rtl"] .slider-playback { right: auto; left: 14px; }
@media (max-width: 760px) {
  [dir="rtl"] .slider-caption { padding: 14px 16px 16px 112px; }
  [dir="rtl"] .slider-controls { left: 12px; }
}

/* Adventures */
[dir="rtl"] .adventure-card-city { left: auto; right: 14px; }

/* Cities: both maps keep a left-to-right geometry; only their texts read right to left. */
[dir="rtl"] .city-atlas { border-left: 0; border-right: 1px solid #373224; }
[dir="rtl"] .city-atlas svg:not(.icon) { direction: ltr; }
[dir="rtl"] .atlas-north { right: auto; left: 16px; }
[dir="rtl"] #map { direction: ltr; }
[dir="rtl"] #map .leaflet-popup-content { direction: rtl; text-align: right; }
[dir="rtl"] #map .leaflet-popup-close-button { right: auto; left: 4px; }
[dir="rtl"] .map-popup-heading { padding: 11px 0 8px 28px; }
[dir="rtl"] .map-top-actions { padding-left: clamp(12px, 2vw, 24px); padding-right: 0; }
[dir="rtl"] .map-zoom-controls { right: auto; left: 12px; }
@media (max-width: 760px) {
  [dir="rtl"] .city-atlas { border-right: 0; }
}

/* Payments */
[dir="rtl"] .pay-next { padding-left: 0; padding-right: 24px; }
[dir="rtl"] .pay-next li { padding-left: 0; padding-right: 4px; }
[dir="rtl"] .pay-return-notice { text-align: right; }

/* Phone numbers, emails, references and amounts stay left to right inside Arabic text. */
[dir="rtl"] :is(input[type="email"], input[type="tel"], input[type="url"]) { direction: ltr; text-align: right; }

/* Adventure opening clue: the picture moves to the left, and the word masks leave room for Arabic dots. */
[dir="rtl"] .clue-question { font-weight: 700; line-height: 1.5; font-size: clamp(2.4rem, 5vw, 5.4rem); max-width: min(70%, 18ch); }
@media (min-width: 721px) {
  [dir="rtl"] .clue-scene { inset: 0 37% 0 0; }
  [dir="rtl"] .clue-scene::after {
    background: linear-gradient(270deg, var(--clue-dark), transparent 62%),
                linear-gradient(0deg, var(--clue-dark), transparent 42%);
  }
}
@media (max-width: 720px) {
  [dir="rtl"] .clue-question { max-width: none; font-size: clamp(2rem, 8.5vw, 3.2rem); }
}
[dir="rtl"] .video-progress span { transform-origin: right; }

/* App page: the phones turn the other way and the floating cards swap sides. */
[dir="rtl"] :is(.app-hero-stage, .app-showcase-stage) { --turn: -1; }
[dir="rtl"] .app-float { direction: rtl; }
[dir="rtl"] .app-hero-stage .app-float--1 { left: auto; right: -2%; }
[dir="rtl"] .app-hero-stage .app-float--2 { right: auto; left: -4%; }
[dir="rtl"] .app-hero-stage .app-float--3 { left: auto; right: 4%; }
[dir="rtl"] .app-showcase-stage .app-float--1 { left: auto; right: 0; }
[dir="rtl"] .app-showcase-stage .app-float--2 { right: auto; left: 0; }
@media (min-width: 961px) {
  [dir="rtl"] .app-hero-bg {
    background:
      radial-gradient(ellipse 42% 58% at 28% 50%, rgb(240 180 77 / .26), transparent 70%),
      radial-gradient(ellipse 36% 46% at 92% 100%, rgb(240 180 77 / .09), transparent 70%);
  }
  [dir="rtl"] .app-hero-bg::before {
    -webkit-mask-image: radial-gradient(ellipse 50% 62% at 28% 48%, #000 15%, transparent 72%);
    mask-image: radial-gradient(ellipse 50% 62% at 28% 48%, #000 15%, transparent 72%);
  }
}
@media (max-width: 760px) {
  [dir="rtl"] .app-hero-stage .app-float--1 { right: 0; }
  [dir="rtl"] .app-hero-stage .app-float--2 { left: 0; }
}
/* Home: the glow and the grid follow the phones to the left. */
@media (min-width: 861px) {
  [dir="rtl"] .app-showcase-panel {
    background:
      radial-gradient(ellipse 46% 62% at 24% 50%, rgb(240 180 77 / .22), transparent 70%),
      radial-gradient(ellipse 40% 50% at 100% 100%, rgb(240 180 77 / .07), transparent 70%),
      #0a0806;
  }
  [dir="rtl"] .app-showcase-panel::before {
    -webkit-mask-image: radial-gradient(ellipse 42% 66% at 24% 50%, #000 15%, transparent 72%);
    mask-image: radial-gradient(ellipse 42% 66% at 24% 50%, #000 15%, transparent 72%);
  }
}
