/* Keep both selectors independent from Arabic RTL header rules. */
.ylt-switcher-isolate {
    display: inline-flex;
    width: max-content;
    max-width: 100%;
    flex: 0 0 auto;
    direction: ltr !important;
    unicode-bidi: isolate !important;
    writing-mode: horizontal-tb !important;
    text-align: left !important;
    line-height: normal;
    vertical-align: middle;
    overflow: visible !important;
}

.ylt-switcher-isolate .ylt-language-switcher,
.ylt-switcher-isolate .ylt-lang-link {
    direction: ltr !important;
    unicode-bidi: isolate !important;
    writing-mode: horizontal-tb !important;
}

html[dir="rtl"] .elementor-shortcode > .ylt-switcher-isolate,
html[dir="rtl"] .elementor-location-header .ylt-switcher-isolate,
html[dir="rtl"] header .ylt-switcher-isolate {
    direction: ltr !important;
    unicode-bidi: isolate !important;
}

@supports selector(.elementor-shortcode:has(.ylt-language-switcher)) {
    .elementor-shortcode:has(.ylt-language-switcher),
    .elementor-widget-shortcode:has(.ylt-language-switcher),
    .elementor-widget-container:has(.ylt-language-switcher) {
        overflow: visible !important;
    }

    html[dir="rtl"] .elementor-shortcode:has(.ylt-language-switcher) {
        direction: ltr !important;
        unicode-bidi: isolate !important;
        width: max-content;
        max-width: 100%;
    }
}


/* Les campagnes restent masquées jusqu'au rendu final du redesign CX et à
   l'application de la langue active. Cela évite d'afficher le design GiveWP
   initial pendant quelques instants. */
html.ylt-campaign-loading {
    background: #ffffff !important;
}

html.ylt-campaign-loading body {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

html.ylt-campaign-loading::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: #ffffff;
}

html.ylt-campaign-loading::after {
    content: "";
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 2147483647;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 3px solid rgba(193, 39, 45, .18);
    border-top-color: #C1272D;
    border-radius: 50%;
    animation: ylt-campaign-spin .75s linear infinite;
}

html.ylt-campaign-ready body,
body.ylt-campaign-page.ylt-campaign-ready-body {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

@keyframes ylt-campaign-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    html.ylt-campaign-loading::after { animation-duration: 1.5s; }
}

html.ylt-manual-loading body,
html.ylt-manual-ready body {
    visibility: visible !important;
}

.ylt-language-switcher {
    box-sizing: border-box;
    direction: ltr;
    z-index: 99998;
}

.ylt-language-options {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    direction: ltr !important;
}

.ylt-lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    color: #252525;
    font: 700 12px/1 Arial, Helvetica, sans-serif;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.ylt-lang-link:hover {
    transform: translateY(-1px);
    background: rgba(235, 32, 39, .10);
    color: #EB2027;
}

.ylt-lang-link.is-active {
    background: #EB2027 !important;
    color: #fff !important;
}

/* Original horizontal shortcode: [yalla_language_switcher]. */
.ylt-language-switcher--horizontal {
    display: inline-flex;
    flex-direction: row !important;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    box-shadow: none !important;
    margin: 0;
}

.ylt-floating-switcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14) !important;
}

html[dir="rtl"] .ylt-floating-switcher {
    right: auto;
    left: 18px;
}

/* Separate native mobile dropdown: [yalla_language_switcher_mobile]. */
.ylt-switcher-isolate--dropdown {
    display: none;
}

.ylt-language-switcher--dropdown {
    position: relative;
    min-width: 68px;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none !important;
}

.ylt-language-switcher--dropdown > summary {
    list-style: none;
}

.ylt-language-switcher--dropdown > summary::-webkit-details-marker {
    display: none;
}

.ylt-language-dropdown-summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-width: 68px;
    height: 36px;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid #EB2027;
    border-radius: 18px;
    background: #EB2027;
    color: #fff;
    font: 700 12px/1 Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    box-shadow: none !important;
}

.ylt-language-dropdown-summary:focus-visible {
    outline: 2px solid #EB2027;
    outline-offset: 2px;
}

.ylt-mobile-chevron {
    flex: 0 0 auto;
    transition: transform .2s ease;
}

.ylt-language-switcher--dropdown[open] .ylt-mobile-chevron {
    transform: rotate(180deg);
}

.ylt-language-switcher--dropdown .ylt-language-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    min-width: 68px;
    padding: 4px;
    box-sizing: border-box;
    border: 1px solid rgba(0, 0, 0, .14);
    border-radius: 14px;
    background: #fff;
    box-shadow: none !important;
    z-index: 100000;
}

.ylt-language-switcher--dropdown .ylt-lang-link {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    box-sizing: border-box;
    border-radius: 10px;
    background: transparent !important;
    color: #252525 !important;
    transform: none !important;
}

.ylt-language-switcher--dropdown .ylt-lang-link:hover,
.ylt-language-switcher--dropdown .ylt-lang-link:focus-visible {
    background: rgba(235, 32, 39, .10) !important;
    color: #EB2027 !important;
    outline: none;
}

.ylt-language-switcher--dropdown .ylt-lang-link.is-active {
    display: none;
}

html[dir="rtl"] body.ylt-rtl {
    direction: rtl;
}

html[dir="rtl"] body.ylt-rtl input,
html[dir="rtl"] body.ylt-rtl textarea,
html[dir="rtl"] body.ylt-rtl select {
    text-align: right;
}

@media (max-width: 767px) {
    .ylt-switcher-isolate--dropdown {
        display: inline-flex;
    }

    .ylt-floating-switcher {
        right: 10px;
        bottom: 10px;
    }

    html[dir="rtl"] .ylt-floating-switcher {
        left: 10px;
        right: auto;
    }
}

/* Typographie de toute la version arabe.
   Les classes d'icônes sont exclues afin de ne pas remplacer leurs glyphes. */
html.ylt-lang-ar body.ylt-rtl,
html[dir="rtl"] body.ylt-rtl {
    font-family: "El Messiri", Arial, sans-serif !important;
}

/* Le sélecteur conserve sa typographie compacte EN / FR / AR. */
html.ylt-lang-ar .ylt-language-switcher,
html.ylt-lang-ar .ylt-language-switcher * {
    font-family: Arial, Helvetica, sans-serif !important;
}

html.ylt-lang-ar body.ylt-rtl :where(
    h1, h2, h3, h4, h5, h6, p, a, button, label, input, textarea, select, option,
    li, td, th, blockquote, figcaption, strong, em, small, span,
    .elementor-heading-title, .elementor-button-text, .elementor-widget-text-editor,
    .trx-addons-counter-title, .givewp-donation-form, .cx-givewp-footer-links
):not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.eicon):not(.material-icons):not([class^="eicon-"]):not([class*=" eicon-"]):not([class^="icon-"]):not([class*=" icon-"]) {
    font-family: "El Messiri", Arial, sans-serif !important;
    font-style: normal;
}

/* Titres arabes : poids renforcé pour retrouver la présence visuelle
   des titres français et anglais, sans alourdir les paragraphes. */
html.ylt-lang-ar body.ylt-rtl :where(
    h1, h2, h3, h4, h5, h6,
    .elementor-heading-title,
    .entry-title, .page-title, .widget-title,
    .sc_item_title, .sc_title_title,
    .trx-addons-counter-title,
    .givewp-donation-form h1, .givewp-donation-form h2,
    .givewp-donation-form h3, .givewp-donation-form h4,
    .givewp-donation-form h5, .givewp-donation-form h6,
    .cx-givewp-popup h1, .cx-givewp-popup h2, .cx-givewp-popup h3,
    .cx-givewp-popup h4, .cx-givewp-popup h5, .cx-givewp-popup h6
):not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(.eicon):not(.material-icons) {
    font-family: "El Messiri", Arial, sans-serif !important;
    font-weight: 700 !important;
}


/* GiveWP / formulaires React : les champs restent entièrement interactifs.
   Cette règle défensive évite qu’un style de traduction ou de direction
   intercepte les clics, le focus ou la sélection de texte. */
.givewp-donation-form :where(input, textarea, select),
[class*="givewp-"] :where(input, textarea, select),
#give-next-gen :where(input, textarea, select) {
    pointer-events: auto !important;
    touch-action: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
}


/* GiveWP : les montants prédéfinis doivent rester au-dessus de tout calque
   décoratif et recevoir directement les interactions tactiles/souris. */
.givewp-fields-amount__levels-container,
.givewp-fields-amount__level-container,
.givewp-fields-amount__level {
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

.givewp-fields-amount__level {
    position: relative;
    z-index: 2;
    cursor: pointer;
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* ==========================================================================
   Home arabe — correctifs isolés sans toucher aux animations ThemeREX
   ========================================================================== */

/* Bloc des deux CTA : même position physique à droite et même espacement que
   sur les versions anglaise et française. */
html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="4619fb2"] {
    direction: ltr !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: var(--gap, 20px) !important;
    width: 100% !important;
}

html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="4619fb2"] > .elementor-element {
    flex: 0 0 auto !important;
}

html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="4619fb2"] .elementor-button,
html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="4619fb2"] .elementor-button-content-wrapper,
html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="4619fb2"] .elementor-button-text {
    direction: rtl !important;
    unicode-bidi: isolate !important;
}

/* Home arabe — sous-titre d’introduction uniquement.
   Le décalage n’est plus une valeur fixe : front.js mesure le bord droit
   visible du texte et celui du bouton le plus à droite, puis applique ici le
   décalage exact. Aucun HTML, span ou attribut d’animation n’est modifié. */
@media (min-width: 768px) {
    html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="ac2ecd4"] {
        margin-left: auto !important;
        margin-right: 0 !important;
        align-self: flex-end !important;
        align-items: flex-end !important;
        position: relative !important;
        left: var(--ylt-ar-hero-intro-shift, 0px) !important;
    }

    html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="ac2ecd4"]
        > .elementor-element[data-id="f47792a"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
        align-self: flex-end !important;
    }
}

html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="f47792a"]
    h4.trx-addons-advanced-title[data-ylt-advanced-title-source="Committed to humanitarian action, community support, and lasting impact."] {
    direction: rtl !important;
    text-align: right !important;
}

/* Uniquement le titre exact « بناء الأمل. ». La classe est ajoutée après la
   fin de l’animation. Aucun style de visibilité, d’opacité, de transform, de
   position, de marge ou d’alignement n’est imposé. */
html[dir="rtl"] body.ylt-rtl .ylt-building-hope-one-line {
    white-space: nowrap !important;
    letter-spacing: normal !important;
}

html[dir="rtl"] body.ylt-rtl .ylt-building-hope-one-line > .sc_item_word {
    display: inline !important;
    width: auto !important;
    white-space: nowrap !important;
    letter-spacing: normal !important;
}

html[dir="rtl"] body.ylt-rtl .ylt-building-hope-one-line .sc_item_animated_block {
    display: inline !important;
    letter-spacing: normal !important;
}

/* ==========================================================================
   Home arabe — marquee TRX Addons « العناية. التضامن. العمل. »
   ========================================================================== */

/* Le moteur du marquee calcule ses déplacements comme un flux LTR. On isole
   uniquement le widget 8874947 de la direction RTL globale, tout en gardant le
   texte arabe lui-même en RTL. Le contenu reste strictement décoratif et ne
   peut plus déborder sur la section suivante pendant l'initialisation. */
html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="8874947"] {
    direction: ltr !important;
    overflow: hidden !important;
    isolation: isolate;
}

html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="8874947"] .trx_addons_bg_text,
html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="8874947"] .trx_addons_marquee_wrap,
html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="8874947"] .trx_addons_bg_text_inner {
    direction: ltr !important;
    pointer-events: none !important;
}

html[dir="rtl"] body.ylt-rtl .elementor-element[data-id="8874947"] .trx_addons_bg_text_item {
    direction: rtl !important;
    unicode-bidi: isolate !important;
}

