/**
 * Driven Theme - RTL (Right-to-Left) Styles
 * Full Arabic language and RTL direction support
 *
 * @package Driven
 * @since 1.0.0
 */

/* ========================================
   BASE RTL OVERRIDES
   ======================================== */

html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body {
    text-align: right;
    font-family: 'AA00BusinessSystem', 'Tahoma', 'Arial', sans-serif;
}

/* ========================================
   HEADER RTL
   ======================================== */

/* Reverse the flex direction for nav items */
html[dir="rtl"] .driven-header nav.flex {
    direction: rtl;
}

/* Flip nav item link layout */
html[dir="rtl"] .driven-nav-item a,
html[dir="rtl"] .driven-nav-item > div > div > a {
    flex-direction: row-reverse;
}

/* Logo alignment */
html[dir="rtl"] .driven-nav-item .flex-1.relative {
    text-align: right;
}

/* End image should be on the left in RTL */
html[dir="rtl"] .driven-nav-item .flex-1.flex.justify-end {
    justify-content: flex-start;
}

/* ========================================
   MOBILE HEADER RTL
   ======================================== */

html[dir="rtl"] .driven-header .container.py-\[10px\] {
    flex-direction: row-reverse;
}

html[dir="rtl"] .driven-mobile-page-title {
    text-align: left;
}

html[dir="rtl"] #nav-mobile li > div {
    flex-direction: row-reverse;
}

html[dir="rtl"] #nav-mobile li a {
    text-align: right;
}

/* ========================================
   CONTAINER RTL
   ======================================== */

html[dir="rtl"] .container {
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   TEXT ALIGNMENT RTL
   ======================================== */

html[dir="rtl"] .text-right {
    text-align: left;
}

html[dir="rtl"] .text-left {
    text-align: right;
}

/* ========================================
   FLEX RTL OVERRIDES
   ======================================== */

html[dir="rtl"] .justify-start {
    justify-content: flex-end;
}

html[dir="rtl"] .justify-end {
    justify-content: flex-start;
}

/* ========================================
   MARGIN & PADDING RTL OVERRIDES
   ======================================== */

html[dir="rtl"] .ml-auto {
    margin-left: 0;
    margin-right: auto;
}

html[dir="rtl"] .mr-auto {
    margin-right: 0;
    margin-left: auto;
}

/* ========================================
   BUTTON RTL
   ======================================== */

html[dir="rtl"] .btn-dash {
    flex-direction: row-reverse;
}

html[dir="rtl"] .btn-dash__insert {
    transform: scaleX(-1);
}

/* ========================================
   MARQUEE RTL
   ======================================== */

/* Force LTR on marquee tracks so the translateX(-50%) loop stays seamless.
   The content is images, so text direction is irrelevant. */
html[dir="rtl"] .image-marquee-track,
html[dir="rtl"] .marquee-track,
html[dir="rtl"] .driven-marquee-track {
    direction: ltr;
}

html[dir="rtl"] .image-marquee-container,
html[dir="rtl"] .marquee-container,
html[dir="rtl"] .driven-marquee-container {
    direction: ltr;
}

html[dir="rtl"] .marquee-image {
    margin-right: 0;
    margin-left: 20px;
}

/* ========================================
   SLIDE NAVIGATION RTL
   ======================================== */

html[dir="rtl"] #horizontal-sections,
html[dir="rtl"] .driven-slide-container {
    direction: rtl;
}

html[dir="rtl"] .horizontal-section {
    direction: rtl;
}

/* ========================================
   STICKY BAR RTL
   ======================================== */

html[dir="rtl"] .driven-sticky-bar .absolute.top-0.left-1\/2 {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* ========================================
   PAGE GRID RTL
   ======================================== */

html[dir="rtl"] .page-grid {
    direction: rtl;
}

/* ========================================
   FOOTER RTL
   ======================================== */

html[dir="rtl"] .driven-footer-inner {
    flex-direction: row-reverse;
}

html[dir="rtl"] .driven-footer-menu {
    flex-direction: row-reverse;
}

/* ========================================
   POST NAVIGATION RTL
   ======================================== */

html[dir="rtl"] .post-navigation .nav-previous {
    float: right;
}

html[dir="rtl"] .post-navigation .nav-next {
    float: left;
}

/* ========================================
   SEARCH FORM RTL
   ======================================== */

html[dir="rtl"] .driven-search-form {
    flex-direction: row-reverse;
}

html[dir="rtl"] .driven-search-input {
    text-align: right;
}

/* ========================================
   SCROLLBAR RTL
   ======================================== */

html[dir="rtl"] .overflow-y-auto {
    direction: rtl;
}

/* ========================================
   TRUNCATE RTL
   ======================================== */

html[dir="rtl"] .truncate {
    text-align: right;
    direction: rtl;
}

/* ========================================
   ELEMENTOR RTL
   ======================================== */

html[dir="rtl"] .elementor-widget-container {
    text-align: right;
}

/* ========================================
   ARABIC FONT ADJUSTMENTS
   ======================================== */

html[dir="rtl"] .text-headline,
html[dir="rtl"] .text-headline-sm,
html[dir="rtl"] .text-headline-xs,
html[dir="rtl"] .text-headline-base {
    letter-spacing: 0;
    line-height: 1.4;
}

/* ========================================
   ADMIN BAR RTL
   ======================================== */

html[dir="rtl"] .admin-bar .driven-header {
    left: 0;
    right: 0;
}
