/* fix font spacing and family for Arabic */
[lang="ar"] body,
[lang="ar"] h1,
[lang="ar"] h2,
[lang="ar"] h3,
[lang="ar"] h4,
[lang="ar"] h5,
[lang="ar"] h6,
[lang="ar"] p,
[lang="ar"] a,
[lang="ar"] span,
[lang="ar"] .btn,
[lang="ar"] div,
[lang="ar"] li {
    letter-spacing: normal !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Language Switcher */
/* Language Switcher */
/* Language Switcher */
a.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-inline-start: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-weight: 600;
    font-size: 16px;
    /* Increased slightly for visibility */
    color: #121a2c !important;
    text-decoration: none;
    padding: 0;
    /* Remove padding */
    border: none;
    /* Remove border */
    background: transparent;
    /* Remove background */
    transition: color 0.3s ease;
}

a.lang-switcher:hover {
    background-color: transparent;
    color: var(--tj-color-theme-primary) !important;
    /* Simple color change on hover */
    border-color: transparent;
}

.hamburger-infos .lang-switcher {
    display: flex;
    margin: 15px 0;
    margin-inline-start: 0;
}

/* RTL Specific Overrides */

/* Mirror directional icons */
[dir="rtl"] .tji-arrow-right,
[dir="rtl"] .tji-arrow-left,
[dir="rtl"] .fa-arrow-right,
[dir="rtl"] .fa-arrow-left,
[dir="rtl"] .fa-angle-right,
[dir="rtl"] .fa-angle-left,
[dir="rtl"] .fa-chevron-right,
[dir="rtl"] .fa-chevron-left,
[dir="rtl"] .btn_icon i {
    transform: scaleX(-1);
    display: inline-block;
}

/* Ensure Swiper arrows are flipped */
[dir="rtl"] .tj-btn-prev i,
[dir="rtl"] .tj-btn-next i {
    transform: scaleX(-1);
    display: inline-block;
}

/* Fix specific Swiper pagination if needed (usually flex handles this, but just in case) */
[dir="rtl"] .swiper-pagination-bullet {
    margin-inline-end: 0 !important;
    margin-inline-start: 0 !important;
}

/* Fix Project Accordion Alignment in RTL */
/* Context: inset-inline-start: 50% becomes right: 50%. 
   LTR used translateX(-50%) (move left) to center from left edge.
   RTL needs translateX(50%) (move right) to center from right edge.
*/

[dir="rtl"] .project-style-3 .project-thumb .project-default-content .title {
    /* Original LTR: translateX(57%) */
    /* Flip to negative for RTL */
    transform: translateX(-57%) rotate(180deg);
}

[dir="rtl"] .project-style-3 .project-thumb .project-default-content span {
    /* Original LTR: translateX(-50%) */
    /* Flip to positive for RTL */
    transform: translateX(50%) rotate(-45deg);
}

/* Fix Disconnected Arabic Letters */
:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3,
:lang(ar) h4,
:lang(ar) h5,
:lang(ar) h6,
:lang(ar) p,
:lang(ar) a,
:lang(ar) span,
:lang(ar) div,
:lang(ar) body {
    letter-spacing: normal !important;
}

/* Remove text stroke for Arabic as it breaks ligatures */
:lang(ar) .text.stroke {
    -webkit-text-stroke: 0 !important;
    -webkit-text-fill-color: inherit !important;
    color: var(--tj-color-heading-primary) !important;
}

/* Fix Marquee Cutoff and Alignment */
/* Fix Marquee Cutoff and Alignment - Exact Height Match */
:lang(ar) .h8-marquee-section {
    padding-top: 5px !important;
    /* Reduced from 30px */
    padding-bottom: 5px !important;
    /* Reduced from 25px */
}

:lang(ar) .h8-marquee-section .marquee-item .marquee-title .text {
    line-height: 1.3 !important;
    /* Adjusted from 1.5 to reduce height */
    padding-bottom: 5px;
    padding-top: 5px;
    display: inline-block;
    /* Ensure padding applies correctly */
}

/* Fix Second Marquee English Text Font & Spacing */
:lang(ar) .tj-marquee-section .marquee-item .marquee-title .text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    letter-spacing: normal !important;
}

/* Fix Hero Slider Overlay for RTL */
[dir="rtl"] .tj-slider-section::before {
    inset-inline-start: auto !important;
    left: auto !important;
    right: 0 !important;
    /* Mirror the gradient: Dark on Right (0%), Transparent on Left (100%) */
    background: -webkit-gradient(linear, right top, left top, from(var(--tj-color-theme-dark)), to(rgba(5, 18, 41, 0))) !important;
    background: -webkit-linear-gradient(right, var(--tj-color-theme-dark) 0%, rgba(5, 18, 41, 0) 100%) !important;
    background: linear-gradient(270deg, var(--tj-color-theme-dark) 0%, rgba(5, 18, 41, 0) 100%) !important;
}

/* Ensure any other potential overlays are also mirrored */
[dir="rtl"] .h7-hero-slider .tj-slider-section::before {
    inset-inline-start: auto !important;
    left: auto !important;
    right: 0 !important;
}

/* Fix Preloader Logo Centering in RTL */
[dir="rtl"] #loading-icon {
    left: 50% !important;
    right: auto !important;
    inset-inline-start: auto !important;
    transform: translate(-50%, -50%) !important;
    -webkit-transform: translate(-50%, -50%) !important;
}