/* ============================================================================
   Right-to-left overrides — loaded only when <html dir="rtl">
   ----------------------------------------------------------------------------
   The main sheet is written with physical properties (padding-left, border-right),
   which is correct for Latin and wrong for Arabic. Rewriting 2,700 lines with
   logical properties would have risked the layout of nine working languages to
   serve one new one, so the mirroring lives here instead: the Latin sheet is
   untouched, and every RTL decision is reviewable in a single file.

   Two rules of thumb used throughout:
     - a border or padding that sat on the left moves to the right, and vice versa;
     - anything that encodes reading order (arrows, generated bullets, numbered
       badges) is flipped with scaleX(-1) or by changing the inset side, never by
       rotating the element, so the vertical rhythm stays intact.
   ============================================================================ */

/* ---------------------------------------------------------------- typography */

html[dir="rtl"] body {
  /* The site ships system stacks per language; Arabic needs its own or Windows
     falls back to a UI font that renders Arabic with clipped diacritics. */
  font-family: "Segoe UI", "Noto Naskh Arabic", "Geeza Pro", "Traditional Arabic", "Dubai", Tahoma, sans-serif;
  line-height: 1.85;
  text-align: right;
}

/* Arabic is cursive: letter-spacing is the single most common way a translated
   site looks broken, because the letters stop joining. The eyebrow labels on
   this site were all set with .1em tracking.
   Every uppercase-tracking label on the site loses its tracking and its case
   transform here, in one declaration, instead of being hunted one by one. */
html[dir="rtl"] [class*="kick"],
html[dir="rtl"] [class*="eyebrow"],
html[dir="rtl"] .hl .t,
html[dir="rtl"] .dirgrid span,
html[dir="rtl"] .perhead th,
html[dir="rtl"] .pm th,
html[dir="rtl"] .adm th,
html[dir="rtl"] .rel-rest span,
html[dir="rtl"] .mw-go,
html[dir="rtl"] .gi-en,
html[dir="rtl"] .label,
html[dir="rtl"] .eyebrow {
  letter-spacing: 0;
  text-transform: none;
}

/* Latin runs inside Arabic sentences (prices, codes, "USD 140") should keep
   their own direction instead of being reordered by the bidi algorithm. */
html[dir="rtl"] .price,
html[dir="rtl"] .unit,
html[dir="rtl"] .td,
html[dir="rtl"] .svcd-p {
  unicode-bidi: plaintext;
}

/* Headings: Arabic ascenders need more room than the Latin tight leading. */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] .lede {
  line-height: 1.5;
}

/* --------------------------------------------------------------- site header */

/* The skip link is parked off-canvas with `left:-9999px` in the Latin sheet.
   In a right-to-left document the scroll origin sits on the right, so a
   negative left edge is *inside* the scrollable area: the homepage grew a
   9,000-pixel empty gutter and every full-page screenshot came back squeezed
   into a strip. Parking it off the right edge instead keeps it reachable by
   keyboard and invisible to the scroll box. */
html[dir="rtl"] .skip {
  left: auto;
  right: -9999px;
}

html[dir="rtl"] .skip:focus {
  left: auto;
  right: 12px;
}

html[dir="rtl"] .site-head .in,
html[dir="rtl"] .site-nav,
html[dir="rtl"] .brand {
  flex-direction: row;
}

html[dir="rtl"] .brand-cn {
  /* The Chinese subtitle reads as a romanised aside in Arabic, so it keeps its
     own direction and sits at the end of the lockup. */
  direction: ltr;
  unicode-bidi: isolate;
}

html[dir="rtl"] .site-nav a + a {
  margin-left: 0;
  margin-right: 22px;
}

/* Chips, pills and the language picker: the caret sits on the opposite side. */
html[dir="rtl"] .hb-ch {
  margin-left: 0;
  margin-right: auto;
}

html[dir="rtl"] .hb-ch svg,
html[dir="rtl"] .mw-go svg,
html[dir="rtl"] .svcchip-p svg {
  transform: scaleX(-1);
}

html[dir="rtl"] .langpick svg,
html[dir="rtl"] .lang-menu {
  left: auto;
  right: 0;
}

/* ------------------------------------------------------------- generic cards */

html[dir="rtl"] .fact {
  border-right: 0;
  border-left: 1px solid var(--line);
  padding: 22px 22px 22px 0;
  padding-left: 0;
  padding-right: 22px;
}

html[dir="rtl"] .fact:last-child {
  border-left: 0;
  padding-right: 0;
  padding-left: 22px;
}

html[dir="rtl"] .citygrid {
  border-left: 0;
  border-right: 1px solid var(--line);
}

html[dir="rtl"] .citycell {
  border-right: 0;
  border-left: 1px solid var(--line);
}

html[dir="rtl"] .citycell .cc-body,
html[dir="rtl"] .relcard.has-pic .rt,
html[dir="rtl"] .relcard.has-pic .rz,
html[dir="rtl"] .relcard.has-pic .rw {
  text-align: right;
}

/* Numbered / bulleted blocks: the gutter moves to the other side so the marker
   leads the line the way the eye now travels. */
html[dir="rtl"] .srow .sn,
html[dir="rtl"] .itin .stops span,
html[dir="rtl"] .inc-col li,
html[dir="rtl"] .tier li,
html[dir="rtl"] .kf li,
html[dir="rtl"] .fitcol li,
html[dir="rtl"] .reasons li,
html[dir="rtl"] .mistakes li {
  padding-left: 0;
  padding-right: 20px;
}

html[dir="rtl"] .srow .sn,
html[dir="rtl"] .itin .stops span {
  padding-right: clamp(18px, 2.6vw, 30px);
}

html[dir="rtl"] .kf li[data-n]::before,
html[dir="rtl"] .tier li::before,
html[dir="rtl"] .inc-col li::before,
html[dir="rtl"] .fitcol li::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .quote,
html[dir="rtl"] blockquote {
  border-left: 0;
  border-right: 2px solid var(--ochre);
  padding-left: 0;
  padding-right: 18px;
}

html[dir="rtl"] .toc a {
  border-right: 0;
  border-left: 1px solid var(--line);
}

html[dir="rtl"] .toc a:last-child {
  border-left: 0;
}

html[dir="rtl"] .pb {
  border-left: 0;
  border-right: 1px solid var(--line);
  padding-left: clamp(12px, 1.8vw, 24px);
  padding-right: clamp(12px, 1.8vw, 24px);
}

html[dir="rtl"] .pb:first-child {
  border-right: 0;
  padding-right: 0;
}

html[dir="rtl"] .cs-list {
  border-left: 0;
  border-right: 1px solid var(--line);
  direction: rtl;
}

html[dir="rtl"] .cs-a {
  margin-left: 0;
  margin-right: auto;
}

/* -------------------------------------------------------------- data tables */

/* The label column is the first column in both directions: what changes is the
   alignment of the numeric columns, which now run right to left while the
   digits themselves stay left-to-right. */
html[dir="rtl"] .pm th,
html[dir="rtl"] .pm td,
html[dir="rtl"] .perhead th,
html[dir="rtl"] .perhead td,
html[dir="rtl"] .adm th {
  text-align: left;
}

html[dir="rtl"] .pm thead th:first-child,
html[dir="rtl"] .pm tbody th,
html[dir="rtl"] .perhead th:first-child,
html[dir="rtl"] .adm th:first-child {
  text-align: right;
}

html[dir="rtl"] .pm td,
html[dir="rtl"] .perhead td {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------- service pages */

html[dir="rtl"] .svcd-p {
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}

html[dir="rtl"] .svcd-b {
  padding-left: 0;
  padding-right: 66px;
}

html[dir="rtl"] .svchub-b {
  padding-left: 0;
  padding-right: 70px;
}

html[dir="rtl"] .svcchip-p small {
  margin-left: 0;
  margin-right: 3px;
}

/* ------------------------------------------------------------- itinerary day */

html[dir="rtl"] .day {
  padding-left: 0;
  padding-right: 28px;
  border-left: 0;
  border-right: 1px solid var(--line2);
}

html[dir="rtl"] .day .gi-en {
  margin-left: 0;
  margin-right: 7px;
}

html[dir="rtl"] .day .t,
html[dir="rtl"] .note,
html[dir="rtl"] .cta .cb-note {
  text-align: right;
}

/* ------------------------------------------------------------- the CTA band */

html[dir="rtl"] .cta .cb-note {
  text-align: left;
}

html[dir="rtl"] .cta .btn,
html[dir="rtl"] .btn {
  direction: rtl;
}

html[dir="rtl"] .btn svg,
html[dir="rtl"] .link-more svg {
  transform: scaleX(-1);
}

/* ------------------------------------------------------------------- footer */

html[dir="rtl"] .foot .in,
html[dir="rtl"] .foot-cols {
  text-align: right;
}

html[dir="rtl"] .foot a svg {
  transform: scaleX(-1);
}

/* ---------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  html[dir="rtl"] .fact {
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
  }

  html[dir="rtl"] .citycell {
    border-left: 1px solid var(--line);
  }

  html[dir="rtl"] .toc a {
    border-left: 1px solid var(--line);
    border-right: 0;
  }

  html[dir="rtl"] .toc a:nth-child(2n) {
    border-left: 0;
  }

  html[dir="rtl"] .pb {
    border-right: 0;
    padding-right: 0;
  }

  html[dir="rtl"] .cs-list {
    border-right: 0;
  }

  html[dir="rtl"] .svcd-b,
  html[dir="rtl"] .svchub-b {
    padding-right: 0;
  }

  html[dir="rtl"] .day {
    padding-right: 22px;
  }
}
