/*
 Theme Name: TT4 Enfant
 Theme URI: https://votresite.com/
 Description: Thème enfant pour Twenty Twenty-Four.
 Author: Votre Nom
 Author URI: https://votresite.com/
 Template: twentytwentyfour
 Version: 1.0.0
 Text Domain: tt4-enfant
*/


/*
 * Styles pour le Sélecteur de Langue Déroulant
 */

/* Conteneur principal du menu déroulant */
.tt4-lang-switcher-dropdown {
    position: relative;
    display: inline-block;
    font-size: 0.9em;
    margin-left: 15px;
    z-index: 100;
}

/* Bouton qui déclenche le menu déroulant (la langue active) */
.tt4-lang-switcher-dropdown .lang-dropdown-toggle {
    background-color: transparent;
    color: #fff;
    border: 1px solid #555;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.tt4-lang-switcher-dropdown .lang-dropdown-toggle:hover {
    background-color: #333;
    border-color: #777;
}

/* Flèche du menu déroulant */
.tt4-lang-switcher-dropdown .dropdown-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #fff;
    margin-left: 8px;
    transition: transform 0.2s ease-in-out;
}

/* Rotation de la flèche quand le menu est ouvert */
.tt4-lang-switcher-dropdown .lang-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Le menu déroulant lui-même */
.tt4-lang-switcher-dropdown .lang-dropdown-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 6px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.5);
    min-width: 160px;
    max-height: 250px;
    overflow-y: auto;

    /* NOUVELLES RÈGLES DE CACHAGE/AFFICHAGE */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out, visibility 0.2s ease-in-out;
    pointer-events: none; /* Empêche les clics quand le menu est caché */
}

/* Afficher le menu quand la classe 'is-open' est présente */
.tt4-lang-switcher-dropdown .lang-dropdown-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto; /* Permet les clics quand le menu est ouvert */
}


/* Éléments de la liste du menu déroulant */
.tt4-lang-switcher-dropdown .lang-dropdown-menu li {
    margin: 0;
    padding: 0;
}

.tt4-lang-switcher-dropdown .lang-dropdown-menu a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #eee;
    padding: 8px 12px;
    transition: background-color 0.2s ease-in-out;
    border-radius: 4px;
}

.tt4-lang-switcher-dropdown .lang-dropdown-menu a:hover {
    background-color: #444;
    color: #fff;
}

/* Langue active dans le menu déroulant */
.tt4-lang-switcher-dropdown .lang-dropdown-menu li.active a {
    background-color: #005680;
    color: #fff;
    font-weight: bold;
}

/* Styles pour les emojis de drapeaux */
.lang-emoji {
    font-size: 1.5em;
    line-height: 1;
    margin-right: 8px;
}

/* Optionnel : Masquer le nom de la langue sur petits écrans si le bouton est trop grand */
@media (max-width: 768px) {
    .tt4-lang-switcher-dropdown .lang-name {
        display: none;
    }
    .tt4-lang-switcher-dropdown .lang-dropdown-toggle {
        padding: 8px;
    }
    .tt4-lang-switcher-dropdown .dropdown-arrow {
        margin-left: 0;
    }
}


/* Styles généraux pour le menu */
.tt4-custom-menu-wrapper {
    position: relative; /* Pour positionner le bouton hamburger */
    display: flex;
    justify-content: flex-end; /* Aligner à droite par défaut */
    align-items: center;
    width: 100%;
}

.tt4-custom-navigation-menu {
    /* Styles pour la navigation complète */
    display: flex; /* Utiliser flex pour aligner les éléments du menu */
    align-items: center;
    justify-content: flex-end; /* Aligner les liens à droite */
    flex-grow: 1; /* Permet à la nav de prendre l'espace disponible */
}

.tt4-navigation-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex; /* Affichage horizontal des liens */
}

.tt4-navigation-list li {
    margin: 0 15px; /* Espacement entre les liens */
    position: relative;
}

.tt4-navigation-list li a {
    text-decoration: none;
    color: #eee; /* Couleur de lien par défaut */
    font-weight: bold;
    padding: 10px 0;
    display: block;
    white-space: nowrap; /* Empêche le retour à la ligne */
}

/* Styles pour le bouton hamburger (visible sur mobile) */
.tt4-hamburger-menu {
    display: none; /* Caché par défaut sur grand écran */
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 100; /* Assure qu'il est au-dessus du reste */
}

.tt4-hamburger-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #eee; /* Couleur de l'icône */
    position: relative;
}

.tt4-hamburger-icon::before,
.tt4-hamburger-icon::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background-color: #eee;
    position: absolute;
    left: 0;
    transition: transform 0.3s ease;
}

.tt4-hamburger-icon::before {
    top: -7px;
}

.tt4-hamburger-icon::after {
    top: 7px;
}

/* Styles pour le bouton de fermeture (visible sur mobile) */
.tt4-close-menu {
    display: none; /* Caché par défaut sur grand écran */
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    position: absolute;
    top: 10px;
    right: 15px;
    color: #fff; /* Couleur pour le menu ouvert */
    z-index: 110;
}

/* ===========================
   Styles Responsives pour Mobile (ex: max-width: 768px)
   =========================== */
@media (max-width: 768px) {
    .tt4-custom-menu-wrapper {
        justify-content: flex-end; /* Aligner le hamburger à droite */
    }

    .tt4-hamburger-menu {
        display: block; /* Affiche le bouton hamburger sur mobile */
    }

    .tt4-custom-navigation-menu {
        /* Le menu devient une superposition sur mobile */
        position: fixed;
        top: 0;
        right: -100%; /* Cache le menu hors écran */
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.9); /* Fond sombre semi-transparent */
        flex-direction: column; /* Les liens s'empilent verticalement */
        justify-content: center;
        align-items: center;
        transition: right 0.3s ease; /* Animation d'ouverture/fermeture */
        z-index: 99;
    }

    .tt4-custom-navigation-menu.is-open {
        right: 0; /* Affiche le menu quand il est ouvert */
    }

    .tt4-navigation-list {
        flex-direction: column; /* Les liens s'empilent */
        text-align: center;
        width: 100%;
    }

    .tt4-navigation-list li {
        margin: 15px 0;
    }

    .tt4-navigation-list li a {
        color: #fff; /* Couleur des liens sur fond sombre */
        font-size: 24px;
        padding: 15px 0;
    }

    .tt4-close-menu {
        display: block; /* Affiche le bouton de fermeture sur mobile */
    }
}
