/* ─── GoRoute.ai RTL Overrides ──────────────────────────────────
   Scoped to [dir="rtl"] — only active when Arabic (or other RTL) is selected.
   Tailwind handles most RTL via logical properties. These are edge cases.
   ──────────────────────────────────────────────────────────────── */

/* Arabic font — applied globally when RTL active. Driven per tenant by the
   font_ar_body / font_ar_display branding tokens (see js/brand-theme.js);
   Noto Sans Arabic remains the GoRoute default. */
[dir="rtl"] body {
    font-family: var(--brand-font-ar-body, 'Noto Sans Arabic'), 'Inter', system-ui, sans-serif;
}

/* Arabic needs its own display face — Latin display faces (condensed caps and
   the like) carry no Arabic glyphs, so this cannot reuse --brand-font-display. */
[dir="rtl"] h1,
[dir="rtl"] h2 {
    font-family: var(--brand-font-ar-display, var(--brand-font-ar-body, 'Noto Sans Arabic')), 'Inter', system-ui, sans-serif;
}

/* Tracking breaks Arabic — the glyphs must stay joined. This overrides any
   letter-spacing inherited from a Latin display style or a Tailwind
   `tracking-*` utility (specificity 0,1,1 beats a single class). */
[dir="rtl"] :is(body, h1, h2, h3, h4, h5, h6, p, a, span, li, button, label, th, td, input, textarea) {
    letter-spacing: 0;
}

/* Fix directional margins/paddings that Tailwind doesn't auto-flip */
[dir="rtl"] .ml-2 { margin-left: 0; margin-right: 0.5rem; }
[dir="rtl"] .mr-2 { margin-right: 0; margin-left: 0.5rem; }
[dir="rtl"] .ml-3 { margin-left: 0; margin-right: 0.75rem; }
[dir="rtl"] .mr-3 { margin-right: 0; margin-left: 0.75rem; }
[dir="rtl"] .ml-4 { margin-left: 0; margin-right: 1rem; }
[dir="rtl"] .mr-4 { margin-right: 0; margin-left: 1rem; }
[dir="rtl"] .pl-2 { padding-left: 0; padding-right: 0.5rem; }
[dir="rtl"] .pr-2 { padding-right: 0; padding-left: 0.5rem; }

/* Text alignment flips */
[dir="rtl"] .text-left { text-align: right; }
[dir="rtl"] .text-right { text-align: left; }

/* Flex / spacing — reverse horizontal gaps */
[dir="rtl"] .space-x-2 > :not(:first-child) { margin-left: 0; margin-right: 0.5rem; }
[dir="rtl"] .space-x-3 > :not(:first-child) { margin-left: 0; margin-right: 0.75rem; }
[dir="rtl"] .space-x-4 > :not(:first-child) { margin-left: 0; margin-right: 1rem; }

/* Dropdown menus — flip anchor */
[dir="rtl"] .group .absolute.left-0 { left: auto; right: 0; }

/* Navbar search/icons — flip order for RTL */
[dir="rtl"] .gap-8 { direction: rtl; }

/* Section dot — flip margin */
[dir="rtl"] .section-dot + span { direction: rtl; }

/* Badge and pill layout */
[dir="rtl"] .flex.items-center.gap-2 { direction: rtl; }

/* Mobile menu indentation */
[dir="rtl"] .pl-2 { padding-left: 0; padding-right: 0.5rem; }

/* Cookie consent banner RTL */
[dir="rtl"] #goroute-cookie-banner .cc-inner {
    direction: rtl;
}

/* intl-tel-input RTL adjustment */
[dir="rtl"] .iti { direction: ltr; }
[dir="rtl"] .iti__selected-country { border-radius: 0 0.5rem 0.5rem 0; }
