/* =========================================================
   iCanDeal — Bascule bilingue EN/FR statique
   Le contenu des deux langues est présent dans le HTML
   (<el lang="en">…</el><el lang="fr">…</el>). Cette feuille
   masque la langue qui n'est pas la langue courante du
   document, portée par l'attribut lang de <html>.
   Défaut : anglais (aucun attribut requis). FR si html[lang=fr].
   ========================================================= */

/* EN actif : masquer le FR ; FR actif : masquer l'EN.
   Les attributs prennent le pas sur l'héritage : chaque bloc
   porte sa langue explicitement (span, div, p, li, td, h*, a…). */
html:not([lang="fr"]) [lang="fr"],
html:not([lang="fr"]) [lang="fr"][hidden] { display: none !important; }

html[lang="fr"] [lang="en"],
html[lang="fr"] [lang="en"][hidden] { display: none !important; }

/* Le sélecteur de langue */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full, 999px);
    padding: 2px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}
.lang-switch a {
    color: var(--gray-500);
    text-decoration: none;
    padding: 2px 10px;
    border-radius: var(--radius-full, 999px);
    transition: background 0.15s, color 0.15s;
}
.lang-switch a:hover { color: var(--primary); }
.lang-switch a[aria-current="true"] {
    background: var(--primary);
    color: var(--white);
}

/* Position : dans la barre de navigation légale, repoussé à droite */
.legal-nav { position: relative; }
.legal-nav .lang-switch {
    position: absolute;
    right: var(--space-xl);
    top: 50%;
    transform: translateY(-50%);
}
@media (max-width: 768px) {
    .legal-nav { padding-right: calc(var(--space-md) + 70px); }
    .legal-nav .lang-switch { right: var(--space-md); }
}

/* Occurrences hors nav (CTA hero etc.) */
.lp-hero .lang-switch { position: static; transform: none; }

/* Accessibilité clavier */
.lang-switch a:focus-visible {
    outline: 3px solid #7ac3f0;
    outline-offset: 1px;
}
