/* QNL — Arabic, right-to-left adjustments for both pages.
   Flexbox and grid flip on their own with dir="rtl"; these rules handle the
   pieces placed with left/right, arrow glyphs, slide-in nudges and type. */

/* ---- Type ------------------------------------------------------------------ */
html[lang="ar"] body,
html[lang="ar"] :is(.nav, .mnav, .search, button, input, .title, .lede, .body) {
  font-family: "IBM Plex Sans Arabic", "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* Letter-spacing pulls Arabic letters apart, and capitals don't exist */
html[lang="ar"] * { letter-spacing: 0 !important; text-transform: none !important; }
/* Arabic needs more line height than the tight Latin display settings */
html[lang="ar"] :is(h1, h2, h3, h4, .title, .statement, .about-text, .age-title, .blog-title, .phase h3, .post-title, .hero-copy h1) {
  line-height: 1.32 !important;
}
html[lang="ar"] .hero-copy h1 { font-size: clamp(40px, 7.4vw, 124px); }
html[lang="ar"] :is(.lede, .body, p) { line-height: 1.7; }
/* Latin bits inside Arabic (dates, "G then W", "QNL Engage") keep their order */
html[lang="ar"] :is(kbd, .lang-opt[data-lang="en"]) { direction: ltr; }

/* ---- Option two ------------------------------------------------------------ */
[dir="rtl"] .hero-copy .ar { text-align: right !important; }
[dir="rtl"] .spot { right: auto; left: var(--gutter); }
[dir="rtl"] .spot-line i { transform-origin: right; }
[dir="rtl"] .spot-arrows button { transform: scaleX(-1); }
[dir="rtl"] .spot-arrows button:hover { transform: scaleX(-1) translateX(2px); }
[dir="rtl"] #spot-prev:hover { transform: scaleX(-1) translateX(-2px); }

[dir="rtl"] .phase.is-active .phase-label { text-align: right; }
[dir="rtl"] .phase.is-active .phase-art { left: 30%; }
[dir="rtl"] .age-pic-label { left: auto; right: 16px; }
[dir="rtl"] .post-tag { left: auto; right: 12px; }
[dir="rtl"] .cta-band::before {
  background: linear-gradient(270deg, rgba(10, 6, 4, 0.72), rgba(10, 6, 4, 0.25) 60%, rgba(10, 6, 4, 0.35)),
              linear-gradient(to bottom, rgba(10, 6, 4, 0) 60%, #0f0c0a);
}

/* Diagonal "open" arrows point up-left in Arabic */
[dir="rtl"] :is(.stat-cta span, .post-more i, .ft-btn span, .blog-all span) { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .stat-cta:hover span,
[dir="rtl"] .post:hover .post-more i { transform: scaleX(-1) translate(3px, -3px); }

/* Navbar dropdowns: links nudge toward the reading direction */
[dir="rtl"] :is(.mg a, .ng a):hover { transform: translateX(-3px); }
[dir="rtl"] .mn-top { text-align: right; }

/* Search palette scope menu opens from the right */
[dir="rtl"] .scope-menu { left: auto; right: 0; transform-origin: top right; }

/* ---- Option one ------------------------------------------------------------ */
[dir="rtl"] .card[data-pos="left"] { left: auto; right: var(--gutter); }
[dir="rtl"] .card[data-pos="right"] { right: auto; left: var(--gutter); }
[dir="rtl"] .hud { left: auto; right: var(--gutter); }
[dir="rtl"] .hud-bar i, [dir="rtl"] .loader-bar i { transform-origin: right; }
[dir="rtl"] .scroll-hint { right: auto; left: var(--gutter); }
[dir="rtl"] .btn span[aria-hidden="true"] { display: inline-block; }
@media (max-width: 720px) {
  [dir="rtl"] .card[data-pos="left"],
  [dir="rtl"] .card[data-pos="right"] { left: var(--gutter); right: var(--gutter); }
}

/* ---- Children page ---- */
[dir="rtl"] .offer-art { right: auto; left: clamp(18px, 2vw, 30px); }
[dir="rtl"] .act:hover { padding-left: 14px; padding-right: 14px; }
[dir="rtl"] .kb-arrows { direction: ltr; }
[dir="rtl"] :is(.kbooks-count, .offer-card.is-big h3) { direction: ltr; unicode-bidi: isolate; text-align: right; }
