/* =========================================================
   MON SÉLECTEUR DE LANGUES
   Version multi-langues
   Style minimaliste — Twenty Twenty-Five
   ========================================================= */


/* =========================================================
   CONTENEUR
   ========================================================= */

.msl-switcher {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0;

    box-sizing: border-box;
}


/* =========================================================
   BOUTON PRINCIPAL
   ========================================================= */

.msl-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    margin: 0;
    padding: 5px 8px;

    box-sizing: border-box;

    background: transparent;

    border: 1px solid transparent;
    border-radius: 999px;

    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.2px;

    color: inherit;

    cursor: pointer;
    white-space: nowrap;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}


/* =========================================================
   SURVOL DU BOUTON
   ========================================================= */

.msl-switcher:hover .msl-button {
    background: rgba(0, 0, 0, 0.045);
    border-color: rgba(0, 0, 0, 0.12);
}


/* =========================================================
   FOCUS ACCESSIBILITÉ
   ========================================================= */

.msl-button:focus {
    outline: none;
}

.msl-button:focus-visible {
    outline: 2px solid rgba(0, 0, 0, 0.25);
    outline-offset: 2px;
}


/* =========================================================
   FLÈCHE
   ========================================================= */

.msl-caret {
    width: 0;
    height: 0;

    margin-top: 2px;

    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor;

    transition: transform 0.2s ease;
}


/* Flèche vers le haut lorsque le menu est ouvert */

.msl-button[aria-expanded="true"] .msl-caret {
    transform: rotate(180deg);
}


/* =========================================================
   MENU DÉROULANT
   ========================================================= */

.msl-menu {
    position: absolute;

    top: calc(100% + 6px);
    left: 50%;

    /*
     * Pas de largeur fixe :
     * le menu s'adapte automatiquement au nombre
     * et à la longueur des langues.
     */
    min-width: 0;

    margin: 0;
    padding: 4px;

    list-style: none;

    box-sizing: border-box;

    background: #fff;

    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.04);

    z-index: 9999;

    /*
     * Centrage horizontal du menu
     * par rapport au switcher FR + flèche.
     */
    transform: translateX(-50%) translateY(-4px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.15s ease,
        transform 0.15s ease,
        visibility 0.15s ease;
}


/* =========================================================
   OUVERTURE AU SURVOL
   ========================================================= */

.msl-switcher:hover .msl-menu {
    opacity: 1;
    visibility: visible;

    transform: translateX(-50%) translateY(0);
}


/* =========================================================
   COMPATIBILITÉ AVEC LE JAVASCRIPT
   ========================================================= */

.msl-menu.is-open {
    opacity: 1;
    visibility: visible;

    transform: translateX(-50%) translateY(0);
}


/* =========================================================
   ÉLÉMENTS DU MENU
   ========================================================= */

.msl-item {
    margin: 0;
    padding: 0;
}


/* =========================================================
   LIENS DES LANGUES
   ========================================================= */

.msl-item a {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: auto;

    padding: 5px 8px;

    box-sizing: border-box;

    border-radius: 6px;

    /*
     * Même taille de texte que FR.
     */
    font-size: 0.75em;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.2px;

    text-align: center;
    text-decoration: none;

    color: inherit;

    white-space: nowrap;

    transition:
        background-color 0.15s ease;
}


/* =========================================================
   SURVOL D'UNE LANGUE
   ========================================================= */

.msl-item a:hover {
    background: rgba(0, 0, 0, 0.05);

    text-decoration: none;
}


/* =========================================================
   LANGUE ACTUELLEMENT SÉLECTIONNÉE
   ========================================================= */

.msl-item-current a {
    font-weight: 600;
    text-decoration: none;
}