/* ================================================================
   EduNova — Arabic / RTL overrides
   Loaded only when the visitor selects AR (html[dir="rtl"]).
   ================================================================ */

/* ── Typography ────────────────────────────────────────────────── */
html[dir="rtl"] {
    --en-font-heading: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
    --en-font-body:    'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}

html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    font-family: var(--en-font-body);
}

/* Letter-spacing breaks Arabic letter joining */
html[dir="rtl"] body *:not(.en-lang-btn):not(code):not(.en-cert-code) {
    letter-spacing: normal !important;
}

html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] button {
    font-family: var(--en-font-body);
    text-align: right;
}

/* Emails / phones / IDs stay left-to-right */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] .en-topbar-contact,
html[dir="rtl"] .en-cert-code,
html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href^="mailto:"] {
    direction: ltr;
    unicode-bidi: isolate;
}
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="url"] {
    text-align: right;
}

/* ── Header & navigation ───────────────────────────────────────── */
html[dir="rtl"] .en-nav-menu > li > a {
    font-size: 15px;
    font-weight: 600;
}

html[dir="rtl"] .en-nav-menu .sub-menu {
    left: auto;
    right: 0;
    text-align: right;
}

html[dir="rtl"] .en-header-login-btn {
    font-weight: 700;
}

/* ── Mobile drawer (slides in from the left in RTL) ────────────── */
html[dir="rtl"] .en-mobile-nav {
    transform: translateX(-100%);
}
html[dir="rtl"] .en-mobile-nav.open {
    transform: translateX(0);
}
html[dir="rtl"] .en-mobile-menu .sub-menu {
    padding: 0 20px 0 0;
}

/* ── Directional arrow icons (→ becomes ←) ─────────────────────── */
html[dir="rtl"] svg:has(polyline[points="12 5 19 12 12 19"]),
html[dir="rtl"] svg:has(polyline[points="9 18 15 12 9 6"]),
html[dir="rtl"] svg:has(polyline[points="15 18 9 12 15 6"]) {
    transform: scaleX(-1);
}

/* ── Hero ──────────────────────────────────────────────────────── */
html[dir="rtl"] .en-hero-stat {
    text-align: right;
}
html[dir="rtl"] .en-hero-float.top-left {
    left: auto;
    right: -30px;
}
html[dir="rtl"] .en-hero-float.bottom-right {
    right: auto;
    left: -30px;
}

/* ── Course cards ──────────────────────────────────────────────── */
html[dir="rtl"] .en-cch-badge {
    left: auto;
    right: 12px;
}
html[dir="rtl"] .en-cch-price del {
    margin-left: 0;
    margin-right: 6px;
}
html[dir="rtl"] .en-course-cat-tag {
    left: auto;
    right: 12px;
}
html[dir="rtl"] .en-course-price-badge {
    right: auto;
    left: 12px;
}

/* ── Decorative shapes ─────────────────────────────────────────── */
html[dir="rtl"] .en-cta-section::before {
    right: auto;
    left: -20%;
}
html[dir="rtl"] .en-mission-card-badge {
    right: auto;
    left: 24px;
}
html[dir="rtl"] .en-verified-badge {
    right: auto;
    left: 2px;
}

/* ── Footer newsletter (input + button joined) ─────────────────── */
html[dir="rtl"] .en-newsletter-form input {
    border-right: 1px solid rgba(255,255,255,0.15);
    border-left: none;
    border-radius: 0 var(--en-radius-sm) var(--en-radius-sm) 0;
}
html[dir="rtl"] .en-newsletter-form input:focus {
    border-color: var(--en-primary-theme);
}
html[dir="rtl"] .en-newsletter-form button {
    border-radius: var(--en-radius-sm) 0 0 var(--en-radius-sm);
}

/* ── Content / legal / tables ──────────────────────────────────── */
html[dir="rtl"] .en-legal-card ul,
html[dir="rtl"] .entry-content ul,
html[dir="rtl"] .entry-content ol {
    padding-left: 0;
    padding-right: 20px;
}
html[dir="rtl"] .en-cert-table,
html[dir="rtl"] .en-cert-table th,
html[dir="rtl"] .en-cert-table td {
    text-align: right;
}
html[dir="rtl"] blockquote {
    border-left: 0;
    border-right: 4px solid var(--en-primary-theme);
    padding-left: 0;
    padding-right: 20px;
}

/* ── Centered sections stay centered ───────────────────────────── */
html[dir="rtl"] .en-text-center,
html[dir="rtl"] .en-section-header,
html[dir="rtl"] .en-dash-empty-box {
    text-align: center;
}

@media (max-width: 1024px) {
    html[dir="rtl"] .en-hero .en-container { text-align: center; }
}

/* ── Admin bar keeps its own direction ─────────────────────────── */
html[dir="rtl"] #wpadminbar { direction: rtl; }
