/* ===== Méga-menu de l'en-tête (maquette « V5 – fun mais tranquille ») ===== */
/* Préfixe « hmm- » : Henrri Méga Menu. Les règles « header.hmm-entete » priment sur les anciens
   styles du menu du thème (css/styles.css et style.css). */

/* Barre bleue de l'en-tête */
header.hmm-entete {
    background: #167db8;
    box-shadow: 0 4px 14px rgba(7, 43, 63, 0.30);
    display: block;
    padding: 0 !important;
}

/* Contenu centré de la barre */
header.hmm-entete .hmm-barre {
    align-items: center;
    box-sizing: border-box;
    display: flex;
    gap: 4px;
    height: 84px;
    margin: 0 auto;
    max-width: 1300px;
    padding: 0 30px;
}

/* Logo */
header.hmm-entete .hmm-logo {
    display: flex;
    flex: none;
    margin-right: 22px;
}

header.hmm-entete .hmm-logo img {
    display: block;
    height: 58px;
    width: auto;
}

/* Écriture manuscrite (police Kalam déjà embarquée par le thème) */
header.hmm-entete .hmm-manuscrit {
    font-family: kalambold, cursive;
}

/* Pastilles rondes de l'équipe */
header.hmm-entete .hmm-avatars {
    display: flex;
}

/* Photo ronde d'un membre de l'équipe, cerclée de blanc */
header.hmm-entete .hmm-avatar {
    background: #daebf5;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-sizing: border-box;
    display: inline-block;
    flex: none;
    height: 28px;
    object-fit: cover;
    width: 28px;
}

header.hmm-entete .hmm-avatars .hmm-avatar + .hmm-avatar {
    margin-left: -8px;
}

header.hmm-entete .hmm-avatars--grands {
    gap: 6px;
    margin: 6px 0 8px;
}

header.hmm-entete .hmm-avatars--grands .hmm-avatar {
    height: 36px;
    width: 36px;
}

header.hmm-entete .hmm-avatars--grands .hmm-avatar + .hmm-avatar {
    margin-left: 0;
}

/* Petit badge « Bientôt » */
header.hmm-entete .hmm-badge {
    background: #ff9100;
    border-radius: 999px;
    color: #ffffff;
    font-family: nunitobold, Arial, sans-serif;
    font-size: 10px;
    line-height: 16px;
    margin-left: 6px;
    padding: 0 6px;
    white-space: nowrap;
}


/* ===== Ordinateur ===== */
@media screen and (min-width: 1049px) {
    /* Navigation : neutralise les anciens styles de #menu */
    header.hmm-entete #menu.hmm-nav {
        align-items: center;
        align-self: stretch;
        display: flex;
        flex: 1;
        float: none;
        gap: 2px;
        justify-content: flex-start;
        position: static;
        text-align: left;
        top: 0;
    }

    /* Boutons du menu mobile masqués sur ordinateur */
    header.hmm-entete .hmm-mobile-boutons {
        display: none;
    }

    /* Entrée qui porte un panneau */
    header.hmm-entete .hmm-entree {
        align-self: stretch;
        display: flex;
    }

    /* « On est là ! » est poussé à droite, juste avant Connexion */
    header.hmm-entete .hmm-entree--on-est-la {
        margin-left: auto;
    }

    header.hmm-entete .hmm-entree--on-est-la .hmm-onglet {
        gap: 10px;
    }

    /* Onglet du menu (lien ou bouton) */
    header.hmm-entete .hmm-onglet {
        align-items: center;
        background: none;
        border: 0;
        border-bottom: 3px solid transparent;
        border-top: 3px solid transparent;
        box-sizing: border-box;
        color: #ffffff;
        cursor: pointer;
        display: flex;
        font-family: nunitosemibold, Arial, sans-serif;
        font-size: 16px;
        gap: 7px;
        height: 84px;
        padding: 0 18px;
        transition: background .3s, border-color .3s;
        white-space: nowrap;
    }

    header.hmm-entete .hmm-onglet:hover,
    header.hmm-entete .hmm-onglet:focus-visible {
        background: rgba(255, 255, 255, 0.10);
        color: #ffffff;
    }

    /* Onglet dont le panneau est ouvert */
    header.hmm-entete .hmm-entree.est-ouverte > .hmm-onglet {
        background: rgba(255, 255, 255, 0.10);
        border-bottom-color: #ff9100;
    }

    /* Connexion et inscription */
    header.hmm-entete .hmm-actions {
        align-items: center;
        display: flex;
        flex: none;
    }

    header.hmm-entete .hmm-connexion {
        color: #ffffff;
        font-family: nunitosemibold, Arial, sans-serif;
        font-size: 16px;
        padding: 10px 12px;
    }

    header.hmm-entete .hmm-inscription {
        background: #ff9100;
        border-radius: 5px;
        box-shadow: 0 5px 15px rgba(255, 145, 0, 0.40);
        color: #ffffff;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 16px;
        padding: 14px 18px;
        white-space: nowrap;
    }

    header.hmm-entete .hmm-inscription:hover {
        background: #e68300;
        color: #ffffff;
    }

    /* Burger masqué sur ordinateur */
    header.hmm-entete .menu-trigger {
        display: none;
    }

    /* Panneau déroulant, sur toute la largeur sous la barre */
    header.hmm-entete .hmm-panneau {
        background: #ffffff;
        box-shadow: 0 15px 45px rgba(38, 50, 56, 0.20);
        color: #455a64;
        cursor: default;
        display: none;
        font-family: nunitoregular, Arial, sans-serif;
        left: 0;
        max-height: calc(100vh - 84px);
        overflow-x: hidden;
        overflow-y: auto;
        position: absolute;
        right: 0;
        text-align: left;
        top: 100%;
    }

    header.hmm-entete .hmm-entree.est-ouverte .hmm-panneau {
        display: block;
    }

    /* Liens à gauche, encart à droite */
    header.hmm-entete .hmm-panneau-grille {
        box-sizing: border-box;
        display: grid;
        gap: 30px;
        grid-template-columns: minmax(0, 1fr) 340px;
        margin: 0 auto;
        max-width: 1220px;
        padding: 22px 30px 0;
    }

    /* Phrase manuscrite d'accueil et sa flèche */
    header.hmm-entete .hmm-bonjour {
        align-items: center;
        color: #167db8;
        display: flex;
        font-size: 22px;
        gap: 10px;
        line-height: 30px;
        margin: 0 0 10px 12px;
    }

    /* Grille de 3 colonnes de liens */
    header.hmm-entete .hmm-grille-liens {
        display: grid;
        gap: 4px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* Un lien : icône + titre + description */
    header.hmm-entete .hmm-ligne {
        align-items: center;
        border-radius: 8px;
        display: flex;
        gap: 14px;
        padding: 12px;
        transition: background .3s;
    }

    header.hmm-entete a.hmm-ligne:hover,
    header.hmm-entete a.hmm-ligne:focus-visible {
        background: #f1f4f5;
    }

    header.hmm-entete .hmm-ligne--bientot {
        cursor: default;
    }

    header.hmm-entete .hmm-icone {
        align-items: center;
        background: #daebf5;
        border-radius: 8px;
        color: #167db8;
        display: flex;
        flex: none;
        height: 44px;
        justify-content: center;
        width: 44px;
    }

    header.hmm-entete .hmm-ligne-titre {
        color: #072b3f;
        display: block;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 15px;
        line-height: 20px;
    }

    header.hmm-entete a.hmm-ligne:hover .hmm-ligne-titre {
        color: #167db8;
    }

    header.hmm-entete .hmm-ligne-description {
        color: #455a64;
        display: block;
        font-size: 13px;
        line-height: 17px;
    }

    /* Liste complète des métiers, dépliée par « Voir tous les métiers » */
    header.hmm-entete .hmm-tous-metiers:not([hidden]) {
        border-top: 1px solid #eeeeee;
        display: grid;
        gap: 30px;
        grid-template-columns: 3fr 1fr;
        margin: 12px 12px 0;
        padding-top: 18px;
    }

    /* Titre de groupe (« Votre activité », « Votre profil ») */
    header.hmm-entete .hmm-metiers-titre {
        color: #455a64;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 11px;
        letter-spacing: .06em;
        margin: 0 0 8px;
        text-transform: uppercase;
    }

    /* Liens des métiers : 3 colonnes pour les activités, 1 pour les profils */
    header.hmm-entete .hmm-metiers-liste {
        column-gap: 24px;
        columns: 3;
    }

    header.hmm-entete .hmm-metiers-groupe:last-child .hmm-metiers-liste {
        columns: 1;
    }

    /* Un métier : texte simple précédé d'un petit chevron bleu */
    header.hmm-entete .hmm-metier {
        break-inside: avoid;
        color: #455a64;
        display: block;
        font-size: 14px;
        line-height: 20px;
        padding: 3px 0;
        transition: color .3s;
    }

    header.hmm-entete .hmm-metier::before {
        color: #167db8;
        content: "›";
        font-family: nunitobold, Arial, sans-serif;
        margin-right: 6px;
    }

    header.hmm-entete .hmm-metier:hover {
        color: #167db8;
    }

    /* Bouton « Voir / Masquer les métiers » : chevron qui se retourne une fois déplié */
    header.hmm-entete .hmm-plus--bouton {
        align-items: center;
        display: inline-flex;
        gap: 6px;
    }

    header.hmm-entete .hmm-plus-chevron {
        transition: transform .3s;
    }

    header.hmm-entete .hmm-plus--bouton[aria-expanded="true"] .hmm-plus-chevron {
        transform: rotate(180deg);
    }

    /* Colonne de l'encart */
    header.hmm-entete .hmm-panneau-encart {
        padding-top: 6px;
    }

    /* Encart illustré avec un robot */
    header.hmm-entete .hmm-encart {
        border-radius: 12px;
        box-sizing: border-box;
        color: #ffffff;
        display: block;
        min-height: 236px;
        overflow: hidden;
        padding: 22px;
        position: relative;
    }

    header.hmm-entete .hmm-encart--nuit {
        background: #072b3f;
    }

    header.hmm-entete .hmm-encart--bleu {
        background: #167db8;
    }

    header.hmm-entete .hmm-encart--creme {
        background: #fff8e6;
        color: #263238;
    }

    header.hmm-entete .hmm-encart-robot {
        pointer-events: none;
        position: absolute;
        width: auto;
    }

    /* Petit logo officiel sur une pastille blanche, posé aux pieds du robot (il passe un peu par-dessus) */
    header.hmm-entete .hmm-encart-logo {
        background: #ffffff;
        border-radius: 6px;
        bottom: 14px;
        box-shadow: 0 4px 12px rgba(7, 43, 63, 0.35);
        height: auto;
        padding: 3px 5px;
        position: absolute;
        right: 22px;
        width: 84px;
        z-index: 1;
    }

    header.hmm-entete .hmm-encart-surtitre {
        display: block;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 11px;
        letter-spacing: .06em;
        margin-bottom: 8px;
        position: relative;
        text-transform: uppercase;
    }

    header.hmm-entete .hmm-encart-titre {
        color: #ffffff;
        display: block;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 20px;
        line-height: 25px;
        margin-bottom: 8px;
        max-width: 200px;
        position: relative;
    }

    header.hmm-entete .hmm-encart-titre .hmm-manuscrit {
        color: #ffd100;
        font-size: 25px;
    }

    header.hmm-entete .hmm-encart-texte {
        color: #ffffff;
        display: block;
        font-size: 13px;
        line-height: 18px;
        max-width: 190px;
        opacity: .9;
        position: relative;
    }

    header.hmm-entete .hmm-encart-action {
        color: #ff9100;
        display: inline-flex;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 14px;
        margin-top: 12px;
        position: relative;
    }

    /* Titre de la blague */
    header.hmm-entete .hmm-blague-entete {
        color: #8a4b00;
    }

    /* Question dans une bulle de BD dont la pointe va vers le robot, à droite */
    header.hmm-entete .hmm-blague-bulle {
        background: #ffffff;
        border-radius: 14px;
        box-shadow: 0 4px 14px rgba(138, 75, 0, 0.12);
        color: #072b3f;
        display: block;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 16px;
        line-height: 21px;
        margin-top: 4px;
        max-width: 190px;
        padding: 12px 14px;
        position: relative;
        z-index: 1;
    }

    header.hmm-entete .hmm-blague-bulle::after {
        border-bottom: 9px solid transparent;
        border-left: 14px solid #ffffff;
        border-top: 9px solid transparent;
        content: "";
        position: absolute;
        right: -13px;
        top: 50%;
        transform: translateY(-50%);
    }

    /* Réponse manuscrite, qui apparaît en glissant */
    header.hmm-entete .hmm-blague-reponse:not([hidden]) {
        animation: hmm-apparition .4s ease-out;
        color: #167db8;
        display: block;
        font-size: 16px;
        line-height: 20px;
        margin-top: 14px;
        max-width: 185px;
        position: relative;
        transform: rotate(-2deg);
        z-index: 1;
    }

    @keyframes hmm-apparition {
        from {
            opacity: 0;
            transform: translateY(6px) rotate(-2deg);
        }

        to {
            opacity: 1;
            transform: translateY(0) rotate(-2deg);
        }
    }

    /* Bouton plein bleu à petit arrondi, comme les autres boutons de Henrri */
    header.hmm-entete .hmm-bouton-blague {
        background: #167db8;
        border: 0;
        border-radius: 5px;
        color: #ffffff;
        cursor: pointer;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 13px;
        margin-top: 16px;
        padding: 9px 14px;
        position: relative;
        transition: background .3s;
        z-index: 1;
    }

    header.hmm-entete .hmm-bouton-blague:hover,
    header.hmm-entete .hmm-bouton-blague:focus-visible {
        background: #0f547b;
    }

    /* Si le visiteur limite les animations, la réponse apparaît sans mouvement */
    @media (prefers-reduced-motion: reduce) {
        header.hmm-entete .hmm-blague-reponse:not([hidden]) {
            animation: none;
        }
    }

    /* Pied du panneau */
    header.hmm-entete .hmm-pied {
        align-items: center;
        border-top: 1px solid #eeeeee;
        box-sizing: border-box;
        display: flex;
        justify-content: space-between;
        margin: 14px auto 0;
        max-width: 1220px;
        padding: 12px 42px 16px;
    }

    header.hmm-entete .hmm-plus {
        background: none;
        border: 0;
        color: #167db8;
        cursor: pointer;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 14px;
        padding: 0;
    }

    header.hmm-entete .hmm-plus:hover {
        color: #0f547b;
    }
}

/* Écrans d'ordinateur étroits : on resserre les onglets pour que tout tienne sur une ligne */
@media screen and (min-width: 1049px) and (max-width: 1320px) {
    header.hmm-entete .hmm-barre {
        padding: 0 15px;
    }

    header.hmm-entete .hmm-logo {
        margin-right: 8px;
    }

    header.hmm-entete .hmm-onglet {
        font-size: 15px;
        padding: 0 9px;
    }

    header.hmm-entete .hmm-connexion {
        font-size: 15px;
        padding: 10px 8px;
    }

    header.hmm-entete .hmm-inscription {
        font-size: 15px;
        padding: 12px 12px;
    }
}

@media screen and (min-width: 1049px) and (max-width: 1180px) {
    /* Les pastilles de l'équipe disparaissent pour gagner de la place */
    header.hmm-entete .hmm-entree--on-est-la > .hmm-onglet .hmm-avatars {
        display: none;
    }

    header.hmm-entete .hmm-logo img {
        height: 48px;
    }
}


/* ===== Tablette et mobile : menu burger ===== */
@media screen and (max-width: 1048px) {
    header.hmm-entete .hmm-barre {
        height: 80px;
        padding: 0 25px;
    }

    header.hmm-entete .hmm-logo img {
        height: 50px;
    }

    /* Connexion et inscription passent dans le menu déplié */
    header.hmm-entete .hmm-actions {
        display: none;
    }

    /* Menu déplié : liste verticale sur fond bleu */
    header.hmm-entete .hmm-nav {
        text-align: left;
    }

    header.hmm-entete .hmm-mobile-boutons {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-bottom: 10px;
    }

    header.hmm-entete .hmm-mobile-bouton {
        border: #78c4ef solid 1px;
        border-radius: 6px;
        color: #78c4ef;
        font-size: 18px;
        margin: 0 25px;
        padding: 8px;
        text-align: center;
    }

    header.hmm-entete .hmm-mobile-bouton--important {
        background-color: #ff9100;
        border-color: #ff9100;
        color: #ffffff;
    }

    /* Onglet : ligne pleine largeur */
    header.hmm-entete .hmm-onglet {
        align-items: center;
        background: none;
        border: 0;
        border-bottom: #78c4ef solid 1px;
        box-sizing: border-box;
        color: #ffffff;
        cursor: pointer;
        display: flex;
        font-family: nunitosemibold, Arial, sans-serif;
        font-size: 18px;
        gap: 10px;
        padding: 20px 25px 12px;
        text-align: left;
        width: 100%;
    }

    header.hmm-entete .hmm-onglet .hmm-chevron {
        margin-left: auto;
        transition: transform .3s;
    }

    header.hmm-entete .hmm-entree.est-ouverte .hmm-chevron {
        transform: rotate(180deg);
    }

    /* Panneau : accordéon sous l'onglet */
    header.hmm-entete .hmm-panneau {
        background: rgba(255, 255, 255, 0.08);
        display: none;
        padding: 8px 0 16px;
    }

    header.hmm-entete .hmm-entree.est-ouverte .hmm-panneau {
        display: block;
    }

    /* Sur mobile, on garde seulement les liens et le lien « voir plus » */
    header.hmm-entete .hmm-bonjour,
    header.hmm-entete .hmm-panneau-encart,
    header.hmm-entete .hmm-ligne-description,
    header.hmm-entete .hmm-avatars {
        display: none;
    }

    header.hmm-entete .hmm-ligne {
        align-items: center;
        color: #ffffff;
        display: flex;
        font-size: 17px;
        gap: 12px;
        padding: 12px 25px 12px 40px;
    }

    header.hmm-entete .hmm-ligne--bientot {
        opacity: .7;
    }

    header.hmm-entete .hmm-icone {
        color: #ffffff;
        display: flex;
    }

    header.hmm-entete .hmm-tous-metiers:not([hidden]) {
        display: block;
        padding: 6px 0;
    }

    header.hmm-entete .hmm-metiers-titre {
        color: #78c4ef;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 13px;
        letter-spacing: .06em;
        margin: 14px 25px 4px 40px;
        text-transform: uppercase;
    }

    header.hmm-entete .hmm-metier {
        color: #ffffff;
        display: block;
        font-size: 16px;
        padding: 8px 25px 8px 40px;
    }

    header.hmm-entete .hmm-plus--bouton .hmm-plus-chevron {
        display: none;
    }

    header.hmm-entete .hmm-plus {
        background: none;
        border: 0;
        color: #78c4ef;
        cursor: pointer;
        display: block;
        font-family: nunitobold, Arial, sans-serif;
        font-size: 16px;
        padding: 12px 25px 0 40px;
    }
}
