/* =========================================================================
   Version arabe — police Cairo (auto-hébergée) et réglages typographiques.
   Chargée uniquement sur les pages /ar, après les feuilles droite-à-gauche.
   Objectif : des blocs de même taille qu'en français (mêmes hauteurs de
   lignes, mêmes gabarits), avec une police lisible pour l'arabe.
   ========================================================================= */
@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/cairo-arabic.woff2') format('woff2');
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
    font-family: 'Cairo';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/cairo-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

html[lang="ar"] body,
html[lang="ar"] .alt-font,
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"] .btn,
html[lang="ar"] .navbar .navbar-nav .nav-link,
html[lang="ar"] input, html[lang="ar"] select, html[lang="ar"] textarea, html[lang="ar"] button {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

/* L'arabe ne supporte pas l'espacement négatif des lettres (il casse la liaison des caractères). */
html[lang="ar"] *,
html[lang="ar"] .ls-minus-1px, html[lang="ar"] .ls-minus-2px, html[lang="ar"] .ls-minus-05px,
html[lang="ar"] .ls-05px, html[lang="ar"] .ls-1px, html[lang="ar"] .ls-2px {
    letter-spacing: 0 !important;
}
html[lang="ar"] .text-uppercase {
    text-transform: none !important;
}

/* Titres : Marcellus (fin, large) est remplacé par Cairo demi-gras, légèrement réduit pour garder
   les mêmes hauteurs de blocs qu'en français. */
html[lang="ar"] .alt-font {
    font-weight: 600;
}
html[lang="ar"] h1, html[lang="ar"] .h1 { font-size: 3.2rem; line-height: 4rem; }
html[lang="ar"] h2, html[lang="ar"] .h2 { font-size: 2.45rem; line-height: 3.1rem; }
html[lang="ar"] h3, html[lang="ar"] .h3 { font-size: 1.95rem; line-height: 2.6rem; }
html[lang="ar"] h4, html[lang="ar"] .h4 { font-size: 1.6rem; line-height: 2.2rem; }
html[lang="ar"] .page-title-extra-large h1 { font-size: 2.9rem; line-height: 3.6rem; }
html[lang="ar"] .page-title-extra-large .article-title { font-size: 2.5rem; line-height: 3.25rem; }
html[lang="ar"] .rich-content h2 { font-size: 1.85rem; line-height: 2.5rem; }
html[lang="ar"] .rich-content h3 { font-size: 1.45rem; line-height: 2.1rem; }
@media (max-width: 1199px) {
    html[lang="ar"] h1, html[lang="ar"] .h1 { font-size: 2.8rem; line-height: 3.5rem; }
    html[lang="ar"] h2, html[lang="ar"] .h2 { font-size: 2.2rem; line-height: 2.85rem; }
    html[lang="ar"] h3, html[lang="ar"] .h3 { font-size: 1.75rem; line-height: 2.4rem; }
    html[lang="ar"] .page-title-extra-large h1 { font-size: 2.5rem; line-height: 3.2rem; }
}
@media (max-width: 767px) {
    html[lang="ar"] h1, html[lang="ar"] .h1 { font-size: 2.2rem; line-height: 2.9rem; }
    html[lang="ar"] h2, html[lang="ar"] .h2 { font-size: 1.85rem; line-height: 2.45rem; }
    html[lang="ar"] h3, html[lang="ar"] .h3 { font-size: 1.55rem; line-height: 2.15rem; }
    html[lang="ar"] .page-title-extra-large h1 { font-size: 2.1rem; line-height: 2.75rem; }
    html[lang="ar"] .page-title-extra-large .article-title { font-size: 1.75rem; line-height: 2.4rem; }
}

/* Corps de texte : même corps qu'en français (l'arabe occupe un peu moins de lignes, les blocs restent
   de même hauteur grâce aux grilles et aux cartes de hauteur égale). */
html[lang="ar"] body { font-size: 17px; }

/* Chiffres et numéros de téléphone : toujours de gauche à droite. */
html[lang="ar"] .ltr, html[lang="ar"] a[href^="tel:"], html[lang="ar"] a[href^="mailto:"], html[lang="ar"] .vertical-counter {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
}

/* Flèches directionnelles : retournées en miroir en lecture droite-à-gauche (mêmes glyphes qu'en français). */
html[lang="ar"] .icon-feather-arrow-right,
html[lang="ar"] .icon-feather-arrow-left,
html[lang="ar"] .icon-feather-chevron-right,
html[lang="ar"] .icon-feather-chevron-left,
html[lang="ar"] .bi-arrow-right,
html[lang="ar"] .bi-arrow-left {
    display: inline-block;
    transform: scaleX(-1);
}
html[lang="ar"] .btn.left-icon i,
html[lang="ar"] .btn.left-icon span > span:first-child { margin-left: 10px; margin-right: 0; }

/* Bandeaux de titre : quand il n'existe pas de version droite-à-gauche de la photo, le bandeau est
   retourné (photo à gauche, zone claire à droite pour le titre) et son contenu remis à l'endroit. */
html[lang="ar"] .page-title-mirror { transform: scaleX(-1); }
html[lang="ar"] .page-title-mirror > .container { transform: scaleX(-1); }

/* Colonne « Prendre rendez-vous » et flèche « Haut » : repositionnées du côté gauche. */
html[lang="ar"] .sticky-wrap.shadow-in { left: auto; right: 50px; }
html[lang="ar"] .scroll-progress { left: 30px; right: auto; }

/* Sélecteur de langue du pied de page : menu déroulant avec drapeaux (bouton = langue en cours). */
.lang-switch { position: relative; display: inline-block; text-align: left; }
.lang-switch summary { list-style: none; }
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-current {
    display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none;
    border: 1px solid rgba(0, 0, 0, .12); border-radius: 6px; background: #fff;
    padding: 6px 14px; line-height: 22px; font-weight: 600; color: var(--dark-gray); min-width: 150px;
}
.lang-current:hover, .lang-switch[open] .lang-current { border-color: var(--base-color); }
.lang-switch .lang-flag svg { width: 22px; height: 15px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); display: block; }
.lang-switch .lang-name { flex: 1 1 auto; }
.lang-caret { width: 10px; height: 6px; transition: transform .2s; }
.lang-switch[open] .lang-caret { transform: rotate(180deg); }
.lang-options {
    position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 20; margin: 0; padding: 6px; list-style: none;
    min-width: 100%; background: #fff; border: 1px solid rgba(0, 0, 0, .1); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
}
.lang-options a { display: flex; align-items: center; gap: 10px; text-align: start; padding: 8px 10px; border-radius: 6px; color: var(--dark-gray); font-weight: 600; white-space: nowrap; }
.lang-options a:hover { background: rgba(108, 192, 103, .12); color: var(--dark-gray); }
.lang-options a.is-active { color: var(--base-color); }
.lang-options a.is-active::after { content: "✓"; margin-left: auto; font-size: 13px; }
html[dir="rtl"] .lang-switch { text-align: right; }
html[dir="rtl"] .lang-options { left: auto; right: 0; }
html[dir="rtl"] .lang-options a.is-active::after { margin-left: 0; margin-right: auto; }
