/* ==========================================================================
   Arabic (RTL) · typography and right-to-left overrides
   ========================================================================== */

/* ---------- Arabic type ---------- */

/* Arabic is cursive, so tracking pulls joined letters apart. The Latin wordmark and
   dir="ltr" marks such as +974 keep their own */
:root[lang="ar"] :not(.brand__word, .brand__word *, [dir="ltr"]) {
  letter-spacing: 0 !important;
}

:root[lang="ar"] body {
  line-height: 1.75;
}
:root[lang="ar"] :is(.lead, .hero__lead, .pdp__tagline, .lab, .log__entry p, .log__disclaimer) {
  line-height: 1.75;
}

/* Big type in Noto Kufi Arabic; Latin words and digits inside it stay in Archivo */
:root[lang="ar"] :is(h1, h2, h3, h4, .h2, .h3, .display, .hero__title, .final__title, .pdp__title, .missions__name, .dive__size, .price__num) {
  font-family: var(--font-display);
}
:root[lang="ar"] :is(.hero__price, .pdp__price, .receipt__total, .drawer__total) .num {
  font-family: var(--font-display);
}
:root[lang="ar"] .site-footer h2 {
  font-family: var(--font-mono);
}
@media (max-width: 1080px) {
  :root[lang="ar"] .site-nav a {
    font-family: var(--font-display);
  }
}

/* Arabic needs taller lines than the tight Latin display settings */
:root[lang="ar"] :is(h1, h2, h3, h4) {
  line-height: 1.35;
}
:root[lang="ar"] :is(.h2, .pdp__title, .display, .hero__title, .final__title) {
  line-height: 1.3;
}
:root[lang="ar"] :is(.h3, .missions__name) {
  line-height: 1.4;
}
:root[lang="ar"] :is(.part__name, .line-item__name, .pdp__part-name) {
  line-height: 1.45;
}
:root[lang="ar"] .dive__size {
  line-height: 1.15;
}

/* Masked headline lines get room above and below for dots and marks, and a longer
   slide so nothing peeks out of that extra room */
:root[lang="ar"] {
  --line-rise: 150%;
}
:root[lang="ar"] :is(.hero__title, .final__title) .line {
  padding-block: 0.1em 0.22em;
}

/* Small print: Arabic under 13px is hard to read */
:where(:root[lang="ar"]) .label {
  font-size: 0.8125rem;
  line-height: 1.6;
}
:root[lang="ar"] :is(.lab__tag, .hero__dock-name, .site-footer h2, .footer__legal, .drawer__note, .receipt__note, .lab__source) {
  font-size: 0.8125rem;
}
:root[lang="ar"] :is(.hero__credit, .fleet__credit) {
  font-size: 12px;
}

/* ---------- Bidi ---------- */

/* Latin runs such as "0.025 µm", "2.5 L / min" or "+974" keep their order; Arabic stays RTL */
[dir="rtl"] :is(.num, dd, .label, .hero__facts li) {
  unicode-bidi: plaintext;
}
/* Sentences and counts read with the page, whatever word or symbol they open with */
[dir="rtl"] :is(.section-head > .label, .dive__copy > .label, .lab__intro > .label, .log__head > .label, .savings__intro > .label, .faq__intro > .label, .log__disclaimer, .hero__count .label) {
  unicode-bidi: isolate;
}
/* plaintext takes start and end from the content, so align with the page instead */
:where([dir="rtl"]) :where(.num, dd, .label) {
  text-align: right;
  text-align: match-parent;
}
[dir="rtl"] :is(.ledger dd, .bar .num) {
  text-align: left;
}

/* ---------- Direction ---------- */

/* Arrows point the way the page reads. scale composes with the prev arrow's rotation
   and the button hover nudge, so those keep their English values */
[dir="rtl"] :is(.arrow, .hero__arrow svg, .mission__view svg, .hero__badge-arrow, svg:has(> use[href="#i-arrow"])) {
  scale: -1 1;
}


/* SVG labels are placed for left-to-right drawings (leader lines, the patch ring), so they
   keep that anchoring; Arabic words still shape and read correctly inside them */
[dir="rtl"] :is(.lab__cartridge, .final__patch) svg {
  direction: ltr;
}
