/* ========================================
   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;
}

