/* ========================================
   Arabic Text Fix - Prevent Letter Separation
   ======================================== */

/* Apply Tajawal font to text elements only */
html[lang="ar"] body,
html[lang="ar"] p,
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] span:not([class*="fa-"]):not([class*="flaticon"]),
html[lang="ar"] a:not([class*="fa-"]):not([class*="flaticon"]),
html[lang="ar"] div:not([class*="fa-"]):not([class*="flaticon"]),
html[lang="ar"] li:not([class*="fa-"]):not([class*="flaticon"]),
html[lang="ar"] button:not([class*="fa-"]):not([class*="flaticon"]),
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] label,
html[lang="ar"] .title,
html[lang="ar"] .sec-title,
html[lang="ar"] .sub-title,
html[lang="ar"] .sub-title-2,
html[lang="ar"] .text {
    font-family: 'Tajawal', sans-serif !important;
}

/* CRITICAL FIX: Remove ALL letter spacing for Arabic and enable ligatures */
html[lang="ar"],
html[lang="ar"] *,
html[lang="ar"] *::before,
html[lang="ar"] *::after {
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    font-variant: normal !important;
    text-transform: none !important;
    font-feature-settings: "liga" 1, "calt" 1, "clig" 1 !important;
    -webkit-font-feature-settings: "liga" 1, "calt" 1, "clig" 1 !important;
    -moz-font-feature-settings: "liga" 1, "calt" 1, "clig" 1 !important;
    font-kerning: auto !important;
    text-rendering: optimizeLegibility !important;
}

/* Extra fix for section titles - they often have letter-spacing in the theme */
html[lang="ar"] .sec-title,
html[lang="ar"] .sec-title *,
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6,
html[lang="ar"] .title,
html[lang="ar"] .sub-title,
html[lang="ar"] .sub-title-2 {
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    font-feature-settings: "liga" 1, "calt" 1, "clig" 1 !important;
    -webkit-font-feature-settings: "liga" 1, "calt" 1, "clig" 1 !important;
    -moz-font-feature-settings: "liga" 1, "calt" 1, "clig" 1 !important;
    text-transform: none !important;
}

/* Center all section titles in both Arabic and English */
.sec-title,
.title-wrap {
    text-align: center !important;
}

/* Ensure Arabic text renders properly with ligatures enabled */
html[lang="ar"] {
    font-feature-settings: "liga" 1, "calt" 1, "clig" 1 !important;
    -webkit-font-feature-settings: "liga" 1, "calt" 1, "clig" 1 !important;
    -moz-font-feature-settings: "liga" 1, "calt" 1, "clig" 1 !important;
    font-kerning: auto !important;
    text-rendering: optimizeLegibility !important;
}

/* Force remove letter spacing on all headings */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] h4,
html[lang="ar"] h5,
html[lang="ar"] h6 {
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    font-variant: normal !important;
    text-transform: none !important;
}

/* Force remove on all common classes */
html[lang="ar"] .title,
html[lang="ar"] .sec-title,
html[lang="ar"] .sub-title,
html[lang="ar"] .sub-title-2,
html[lang="ar"] .hero-title,
html[lang="ar"] .btn-title,
html[lang="ar"] .menu-follow_title {
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    font-variant: normal !important;
    text-transform: none !important;
}

/* Force remove on all text elements */
html[lang="ar"] span,
html[lang="ar"] p,
html[lang="ar"] a,
html[lang="ar"] li,
html[lang="ar"] div,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] textarea {
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    font-variant: normal !important;
}

/* Ensure proper Arabic font rendering */
html[lang="ar"] body {
    font-feature-settings: "liga" 1, "calt" 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
}

/*========================================
  Mobile Responsive Arabic Fixes
==========================================*/

/* Tablet and Below (max-width: 991px) */
@media (max-width: 991px) {
    /* Ensure proper text alignment on mobile */
    html[lang="ar"] .hero-content,
    html[lang="ar"] .about-content,
    html[lang="ar"] .location-item,
    html[lang="ar"] .feature-item {
        text-align: right !important;
    }

    /* Mobile menu text alignment */
    html[lang="ar"] .mobile-menu ul li a {
        text-align: right !important;
    }

    /* Ensure proper font rendering on mobile */
    html[lang="ar"] h1,
    html[lang="ar"] h2,
    html[lang="ar"] h3 {
        letter-spacing: 0 !important;
        word-spacing: 0 !important;
        line-height: 1.3 !important;
    }
}

/* Mobile (max-width: 767px) */
@media (max-width: 767px) {
    /* Section titles on mobile */
    html[lang="ar"] .sec-title {
        text-align: center !important;
        font-size: 28px !important;
        line-height: 1.3 !important;
    }

    /* Hero content on mobile */
    html[lang="ar"] .hero-content h1,
    html[lang="ar"] .hero-content h2 {
        font-size: 32px !important;
        line-height: 1.3 !important;
        text-align: right !important;
    }

    html[lang="ar"] .hero-content p {
        font-size: 16px !important;
        line-height: 1.6 !important;
        text-align: right !important;
    }

    /* Footer on mobile */
    html[lang="ar"] .footer-section .footer-widget {
        text-align: right !important;
    }

    html[lang="ar"] .footer-section ul li {
        text-align: right !important;
    }

    /* About section on mobile */
    html[lang="ar"] .tv-about-section .about-content {
        text-align: right !important;
        padding: 0 15px !important;
    }
}

/* Small Mobile (max-width: 575px) */
@media (max-width: 575px) {
    /* Reduce font sizes for small screens */
    html[lang="ar"] .sec-title {
        font-size: 24px !important;
    }

    html[lang="ar"] .hero-content h1,
    html[lang="ar"] .hero-content h2 {
        font-size: 28px !important;
    }

    html[lang="ar"] .hero-content p {
        font-size: 15px !important;
    }

    /* Mobile menu font size */
    html[lang="ar"] .mobile-menu ul li a {
        font-size: 16px !important;
    }

    /* Ensure proper spacing */
    html[lang="ar"] .theme-btn {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }
}

/* Extra Small Mobile (max-width: 430px) */
@media (max-width: 430px) {
    html[lang="ar"] .sec-title {
        font-size: 22px !important;
    }

    html[lang="ar"] .hero-content h1,
    html[lang="ar"] .hero-content h2 {
        font-size: 24px !important;
    }

    html[lang="ar"] .hero-content p {
        font-size: 14px !important;
    }

    html[lang="ar"] .mobile-menu ul li a {
        font-size: 15px !important;
    }
}

/* Very Small Mobile (max-width: 390px) */
@media (max-width: 390px) {
    html[lang="ar"] .sec-title {
        font-size: 20px !important;
    }

    html[lang="ar"] .hero-content h1,
    html[lang="ar"] .hero-content h2 {
        font-size: 22px !important;
    }

    html[lang="ar"] .hero-content p {
        font-size: 13px !important;
    }
}

/* Smallest Mobile (max-width: 360px) */
@media (max-width: 360px) {
    html[lang="ar"] .sec-title {
        font-size: 18px !important;
    }

    html[lang="ar"] .hero-content h1,
    html[lang="ar"] .hero-content h2 {
        font-size: 20px !important;
    }

    html[lang="ar"] .hero-content p {
        font-size: 13px !important;
    }

    html[lang="ar"] .mobile-menu ul li a {
        font-size: 14px !important;
    }

    html[lang="ar"] .theme-btn {
        padding: 10px 20px !important;
        font-size: 13px !important;
    }
}

/* Marquee Section - Keep Arabic text on one line */
html[lang="ar"] .marquee__group .m-item {
    white-space: nowrap !important;
    display: inline-block !important;
}

html[lang="ar"] .marquee__group .m-item span {
    white-space: nowrap !important;
    display: inline-block !important;
}

/* Process Section - Fix text being cut off in Arabic */
html[lang="ar"] .process-title h2 {
    line-height: 1.5 !important;
    overflow: visible !important;
    padding-top: 20px !important;
}

html[lang="ar"] .tv-process-item .process-box .title {
    line-height: 1.6 !important;
    overflow: visible !important;
    padding-top: 10px !important;
}

html[lang="ar"] .tv-process-item .process-box p {
    line-height: 2 !important;
    overflow: visible !important;
}

/* Newsletter Section - Mobile Responsive */
@media (max-width: 767px) {
    .newsletter {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        align-items: center !important;
        padding: 20px 15px !important;
        gap: 10px !important;
    }

    .newsletter .thumb {
        position: static !important;
        display: block !important;
        order: 1 !important;
    }

    .newsletter .thumb i {
        font-size: 40px !important;
    }

    .newsletter .image-text {
        padding-left: 0 !important;
        order: 2 !important;
        flex: 1 !important;
    }

    .newsletter .image-text .title {
        font-size: 14px !important;
        line-height: 1.3 !important;
        text-align: left !important;
        margin: 0 !important;
    }

    .newsletter .image-text .title br {
        display: none !important;
    }

    .newsletter-form {
        max-width: 200px !important;
        order: 3 !important;
    }

    .newsletter-form .form-group input[type="email"] {
        height: 45px !important;
        font-size: 12px !important;
        padding: 8px 45px 8px 15px !important;
    }

    .newsletter-form .form-group button[type="submit"] {
        width: 32px !important;
        height: 32px !important;
        font-size: 13px !important;
    }
}

@media (max-width: 575px) {
    .newsletter {
        padding: 18px 12px !important;
        gap: 8px !important;
    }

    .newsletter .thumb i {
        font-size: 35px !important;
    }

    .newsletter .image-text .title {
        font-size: 13px !important;
    }

    .newsletter-form {
        max-width: 180px !important;
    }

    .newsletter-form .form-group input[type="email"] {
        height: 42px !important;
        font-size: 11px !important;
        padding: 8px 42px 8px 12px !important;
    }

    .newsletter-form .form-group button[type="submit"] {
        width: 30px !important;
        height: 30px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 430px) {
    .newsletter {
        padding: 15px 10px !important;
        gap: 6px !important;
    }

    .newsletter .thumb i {
        font-size: 30px !important;
    }

    .newsletter .image-text .title {
        font-size: 12px !important;
    }

    .newsletter-form {
        max-width: 160px !important;
    }

    .newsletter-form .form-group input[type="email"] {
        height: 40px !important;
        font-size: 10px !important;
        padding: 6px 40px 6px 10px !important;
    }

    .newsletter-form .form-group button[type="submit"] {
        width: 28px !important;
        height: 28px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 390px) {
    .newsletter .thumb i {
        font-size: 28px !important;
    }

    .newsletter .image-text .title {
        font-size: 11px !important;
    }

    .newsletter-form {
        max-width: 150px !important;
    }
}

@media (max-width: 360px) {
    .newsletter {
        padding: 12px 8px !important;
        gap: 5px !important;
    }

    .newsletter .thumb i {
        font-size: 26px !important;
    }

    .newsletter .image-text .title {
        font-size: 10px !important;
    }

    .newsletter-form {
        max-width: 140px !important;
    }

    .newsletter-form .form-group input[type="email"] {
        height: 38px !important;
        font-size: 9px !important;
        padding: 5px 38px 5px 8px !important;
    }

    .newsletter-form .form-group button[type="submit"] {
        width: 26px !important;
        height: 26px !important;
        font-size: 10px !important;
    }
}

