/*
 * RTL Stylesheet — FXDetails Child Theme
 * Auto-loaded by WordPress when an RTL language is active.
 * Covers text alignment, direction flips, and component mirroring.
 */

body {
    direction: rtl;
    unicode-bidi: embed;
}

/* Text alignment */
.entry-content,
.fxd-comment-text,
.fxd-panel-body,
.fx-panel-body {
    text-align: right;
}

/* Lists */
.entry-content ul,
.entry-content ol,
.fxd-panel-body ul,
.fxd-panel-body ol {
    padding-right: 1.5em;
    padding-left: 0;
}

/* (The breadcrumb here uses literal " / " separators + .fxd-breadcrumb-current,
   which bidi reverses correctly under direction:rtl — no pseudo-separator rule
   is needed, so the old .fxd-breadcrumb-item rule that targeted nonexistent
   markup has been removed.) */

/* Desktop nav-bar mirroring — scoped to >960 so the mobile drawer (which uses
   bottom dividers + in-flow submenus) is never given stray vertical borders. */
@media (min-width: 961px) {
    .main-navigation .main-nav > ul > li > a {
        border-right: none !important;
        border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .main-navigation .main-nav > ul > li:first-child > a {
        border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .main-navigation .main-nav ul ul {
        right: 0;
        left: auto;
    }

    .fxd-user-trigger,
    .fxd-login-btn {
        border-left: none;
        border-right: 1px solid rgba(255, 255, 255, 0.15);
    }

    .fxd-lang-menu > a,
    .fxd-lang-menu > a.fxd-lang-trigger {
        border-left: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.15) !important;
    }
}

/* Footer */
.fxd-footer-copyright {
    text-align: center;
}

/* Broker/VPS review panels */
.fxd-broker-specs dt {
    text-align: right;
}

.fxd-broker-specs dd {
    text-align: left;
}

/* Score bars */
.fxd-score-fill {
    transform-origin: right center;
}

/* FAQ accordion arrow */
.fxd-faq-toggle::after {
    margin-left: 0;
    margin-right: auto;
}

/* Search form */
.fxd-search-form input[type="text"] {
    padding-right: 12px;
    padding-left: 40px;
}

.fxd-search-form button {
    right: auto;
    left: 0;
}

/* ══════════════════════════════════════
   MOBILE RTL PARITY (Phase 6)
   ══════════════════════════════════════ */
@media (max-width: 960px) {
    /* Content-first stacking on RTL phones — the desktop 3-col RTL order leaked
       in and pushed Search / Rates / Recent / Trending above the article. */
    html[dir="rtl"] .fxd-main-col { order: 1; }
    html[dir="rtl"] .fxd-right-sidebar { order: 2; }

    /* Mirror the mobile-drawer accents to the right (start) edge. */
    html[dir="rtl"] .main-navigation .main-nav > ul > li.current-menu-item > a,
    html[dir="rtl"] .main-navigation .main-nav > ul > li.current-menu-parent > a,
    html[dir="rtl"] .main-navigation .main-nav > ul > li.current-menu-ancestor > a {
        box-shadow: inset -3px 0 0 var(--fx-accent) !important;
    }
    html[dir="rtl"] .main-navigation .main-nav > ul > li:has(.sub-menu.toggled-on) > a {
        box-shadow: inset -3px 0 0 rgba(125, 187, 66, 0.5) !important;
    }
    html[dir="rtl"] .main-navigation .main-nav ul ul {
        border-left: none !important;
        border-right: 3px solid rgba(125, 187, 66, 0.25) !important;
    }
    /* Language grid + drawer scrim already work off logical/centered layout. */
}
