/* ============================================================
   RTL layer — loaded only on the Arabic pages (dir="rtl").
   Arabic fonts + directional fixes on top of the FR/EN styles.
   ============================================================ */

:root {
  --font-display: 'Cairo', 'Tajawal', sans-serif;
  --font-sans: 'Tajawal', 'Cairo', sans-serif;
  --font-body: 'Tajawal', sans-serif;
}

body { font-family: var(--font-sans); }

/* Uppercase tracking is meaningless in Arabic and breaks shaping */
[dir="rtl"] * { letter-spacing: 0 !important; }

/* Headings need a touch more line-height in Arabic */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { line-height: 1.35; }

/* Directional icons */
[dir="rtl"] .chev,
[dir="rtl"] .programs-accordion-chevron,
[dir="rtl"] .btn svg,
[dir="rtl"] .hc-cta svg { transform: scaleX(-1); }

/* Mega panel + drawer: right-align groups */
[dir="rtl"] .site-header .mega-panel-inner { justify-content: start; }
[dir="rtl"] .mega-group a { justify-content: flex-start; }

/* Keep phone numbers / emails readable */
[dir="rtl"] a[href^="tel:"], [dir="rtl"] a[href^="mailto:"] { direction: ltr; unicode-bidi: embed; }

/* Language pair keeps latin order */
[dir="rtl"] .lang-pair { direction: ltr; }

/* Figures stay left-to-right inside RTL text */
[dir="rtl"] .num,
[dir="rtl"] .metric-number,
[dir="rtl"] .stat-number,
[dir="rtl"] .doc-size {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Metric dividers sit on the RIGHT in RTL (they are border-left in LTR) */
[dir="rtl"] .program-hero-metric {
  padding-left: 0;
  padding-right: 24px;
  border-left: none;
  border-right: 4px solid #FFF4F5;
}
[dir="rtl"] .program-hero-metric .label {
  padding-left: 0;
  padding-right: 12px;
  border-left: none;
  border-right: 2px solid #EEA1AE;
}
[dir="rtl"] .metric-item {
  border-left: none;
  border-right: 1px solid rgba(157, 13, 40, 0.15);
}
[dir="rtl"] .metric-item::before { left: auto; right: -1px; }
[dir="rtl"] .metric-item:first-child {
  padding-left: 24px;
  padding-right: 0;
  border-right: none;
}
[dir="rtl"] .metric-item:first-child::before { right: 0; }

/* LTR-embedded figures still align to the right edge of their cell */
[dir="rtl"] .metric-number,
[dir="rtl"] .num,
[dir="rtl"] .stat-number {
  text-align: right;
}

/* NORA mirrored for RTL: widget lives bottom-left */
[dir="rtl"] .faqbot-toggle { right: auto; left: 22px; }
[dir="rtl"] .faqbot-panel { right: auto; left: 22px; }
[dir="rtl"] .faqbot-teaser {
  right: auto;
  left: 22px;
  border-radius: 14px 14px 14px 4px;
}
[dir="rtl"] .faqbot-toggle::after { right: auto; left: -2px; }
[dir="rtl"] .faqbot-msg.bot,
[dir="rtl"] .faqbot-chips { margin-left: 0; margin-right: 34px; }
[dir="rtl"] .faqbot-msg.bot::before { left: auto; right: -34px; }
[dir="rtl"] .faqbot-msg.bot { border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
[dir="rtl"] .faqbot-msg.user { border-bottom-right-radius: 14px; border-bottom-left-radius: 4px; }
[dir="rtl"] .faqbot-face-teaser { float: right; margin: 2px 0 4px 10px; }
@media (max-width: 560px) {
  [dir="rtl"] .faqbot-toggle { left: 16px; }
  [dir="rtl"] .faqbot-panel { left: 8px; right: 8px; }
}

/* Same breathing room for the first metric in RTL */
[dir="rtl"] .metric-item:first-child { padding-right: 18px; padding-left: 24px; }
[dir="rtl"] .metric-item:first-child::before { right: 0; }

/* Footer v2 keeps clean alignment in RTL (text-align follows direction) */
[dir="rtl"] .footer-col a { direction: rtl; }
[dir="rtl"] .footer-col a[href^="tel:"],
[dir="rtl"] .footer-col a[href^="mailto:"] { direction: ltr; unicode-bidi: embed; }

/* All left-side accents & custom bullets flip to the right in RTL */
[dir="rtl"] .track-detail-block ul li { padding-left: 0; padding-right: 18px; }
[dir="rtl"] .track-detail-block ul li::before { left: auto; right: 2px; }
[dir="rtl"] .about-stat { border-left: none; border-right: 3px solid var(--color-primary, #870B22); }
[dir="rtl"] .programs-hub-stat { border-left: none; border-right: 3px solid var(--color-primary, #870B22); }
[dir="rtl"] .article-body blockquote { border-left: none; border-right: 4px solid var(--color-primary); }
[dir="rtl"] .drawer-sub li a {
  padding: 9px 16px 9px 0;
  border-left: none;
  border-right: 2px solid #F0D9DE;
}
[dir="rtl"] .drawer-sub li a:hover { border-right-color: var(--color-primary, #870B22); }
[dir="rtl"] .events-grid .event-list-item { border-left: none; border-right: 4px solid var(--color-primary, #870B22); }

/* Partner-logo marquee is language-neutral — run it LTR so it stays visible */
[dir="rtl"] .partners-marquee,
[dir="rtl"] .trusted-marquee,
[dir="rtl"] .partners-track { direction: ltr; }

/* Language dropdown opens to the correct side in RTL */
[dir="rtl"] .lang-menu-list { right: auto; left: 0; }
[dir="rtl"] .lang-menu-list a { text-align: right; }
