/* ════════════════════════════════════════════════════════════════════
   MEGA-MENU DESTINATIONS — Desktop + Mobile
   À placer dans : assets/css/menu.css
   ════════════════════════════════════════════════════════════════════ */

/* ─── Élément parent (li avec sous-menu) ─── */
.has-megamenu {
    position: relative;
}

/* Chevron à côté du libellé */
.nav-chevron {
    margin-left: 0.3rem;
    opacity: 0.6;
    transition: transform 0.25s ease;
    vertical-align: middle;
}
.has-megamenu:hover .nav-chevron,
.has-megamenu.is-open .nav-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

/* ════════════════════════════════════════════════════════════════════
   DESKTOP : Mega-menu au hover
   ════════════════════════════════════════════════════════════════════ */
.megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 720px;
    max-width: 880px;
    background: var(--color-cream);
    border: 1px solid var(--color-line);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(20, 48, 37, 0.15);
    padding: 1.75rem;
    margin-top: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 10000;
}

/* Affichage au hover */
.has-megamenu:hover .megamenu,
.has-megamenu:focus-within .megamenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Bridge invisible (évite que le menu se ferme entre le bouton et le panneau) */
.megamenu::before {
    content: '';
    position: absolute;
    top: -0.75rem;
    left: 0;
    right: 0;
    height: 0.75rem;
}

/* Structure interne */
.megamenu-inner {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr 1.4fr;
    gap: 2rem;
}

.megamenu-col {
    min-width: 0;
}

.megamenu-title {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-mute);
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--color-line);
}

.megamenu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.megamenu-list li + li {
    margin-top: 0.15rem;
}

/* Liens simples (villes) */
.megamenu-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-ink);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.18s ease;
}
.megamenu-list a:hover {
    background: var(--color-sand-100);
    color: var(--color-emerald-800);
    padding-left: 0.9rem;
}

.mm-tag {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-terracotta-500);
    opacity: 0.85;
}

/* Liste sites historiques (avec icônes et 2 lignes) */
.megamenu-list--sites a {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0.65rem;
}
.megamenu-list--sites .mm-ic {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 0.1rem;
}
.megamenu-list--sites .mm-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.megamenu-list--sites strong {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1rem;
    color: var(--color-ink);
}
.megamenu-list--sites em {
    font-style: normal;
    font-family: var(--font-body);
    font-size: 0.78rem;
    color: var(--color-mute);
}
.mm-soon {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* ─── Sites historiques : fiche (liste) au-dessus, pastille (carte) en dessous ─── */
.megamenu-list--sites li {
    display: block;
}
/* La fiche garde sa disposition icône + texte, pleine largeur */
.megamenu-list--sites .mm-site-main {
    justify-content: flex-start;
}
.megamenu-list--sites .mm-text {
    min-width: 0;
}
/* Pastille « Carte » : sous le texte, alignée avec le texte (pas sous l'icône) */
.mm-map-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0.1rem 0 0.3rem 2.85rem;
    padding: 0.4rem 0.7rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--color-emerald-800);
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid var(--color-line);
    border-radius: 8px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.mm-map-pill svg {
    flex-shrink: 0;
    opacity: 0.85;
}
.mm-map-pill:hover {
    background: var(--color-emerald-800);
    border-color: var(--color-emerald-800);
    color: var(--color-cream);
}
.mm-map-pill:hover svg {
    opacity: 1;
}

/* Colonne featured (mise en avant) */
.megamenu-col--feature {
    background: linear-gradient(135deg, var(--color-emerald-800) 0%, var(--color-emerald-900) 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin: -0.25rem;
    color: var(--color-cream);
}
.mm-feature {
    display: block;
    text-decoration: none;
    color: inherit;
}
.mm-feature-eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-terracotta-400);
    margin-bottom: 0.5rem;
}
.mm-feature-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.25rem;
    line-height: 1.25;
    color: var(--color-cream);
    margin: 0 0 0.6rem;
    letter-spacing: -0.01em;
}
.mm-feature-text {
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(253, 250, 243, 0.8);
    margin: 0 0 1rem;
}
.mm-feature-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-terracotta-400);
    transition: gap 0.2s;
}
.mm-feature:hover .mm-feature-link {
    gap: 0.65rem;
    color: var(--color-cream);
}

/* ════════════════════════════════════════════════════════════════════
   MOBILE : Accordéon dans le menu burger (≤ 720px)
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {

    /* Réorganise le li parent en bloc vertical */
    .has-megamenu {
        width: 100%;
    }

    .has-megamenu > .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        cursor: pointer;
    }

    /* Masque par défaut */
    .megamenu {
        position: static;
        opacity: 1;
        visibility: hidden;
        transform: none;
        min-width: 0;
        max-width: 100%;
        width: 100%;
        background: transparent;
        border: 0;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease, visibility 0.35s;
    }

    /* Affichage quand parent est .is-open (toggle JS) */
    .has-megamenu.is-open .megamenu {
        visibility: visible;
        max-height: 1500px;
        padding: 0.5rem 0 0.75rem;
    }

    /* Bridge inutile sur mobile */
    .megamenu::before { display: none; }

    /* Disposition verticale */
    .megamenu-inner {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .megamenu-title {
        font-size: 0.65rem;
        margin: 0.5rem 0 0.4rem;
        padding-bottom: 0.4rem;
    }

    /* Liens plus compacts en mobile */
    .megamenu-list a {
        font-size: 1rem;
        padding: 0.6rem 0.5rem;
    }

    .megamenu-list--sites a {
        padding: 0.7rem 0.5rem;
    }
    .megamenu-list--sites strong { font-size: 0.95rem; }
    .megamenu-list--sites em { font-size: 0.75rem; }

    /* Pastille carte sous le texte, alignée avec le texte */
    .mm-map-pill {
        margin: 0 0 0.4rem 2.65rem;
        padding: 0.4rem 0.65rem;
        font-size: 0.7rem;
    }

    /* Bloc featured plus discret en mobile */
    .megamenu-col--feature {
        padding: 1.1rem;
        margin: 0;
    }
    .mm-feature-title { font-size: 1.05rem; }
    .mm-feature-text { font-size: 0.8rem; }

    /* Désactivation du hover sur tactile */
    .has-megamenu:hover .megamenu {
        opacity: 1;
        visibility: hidden;
        transform: none;
    }
    .has-megamenu.is-open:hover .megamenu {
        visibility: visible;
    }

    /* Chevron qui pivote au click */
    .has-megamenu.is-open .nav-chevron {
        transform: rotate(180deg);
    }
}

/* ════════════════════════════════════════════════════════════════════
   Tablettes intermédiaires : réduire la largeur du mega-menu
   ════════════════════════════════════════════════════════════════════ */
@media (min-width: 721px) and (max-width: 1100px) {
    .megamenu {
        min-width: 580px;
        max-width: 680px;
    }
    .megamenu-inner {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    .megamenu-col--feature {
        grid-column: 1 / -1;
    }
}

/* Header collant en haut, et au-dessus de la carte Leaflet et du contenu */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
}
/* ════════════════════════════════════════════════════════════════════
   DROPDOWN SIMPLE (Infos pratiques)
   ════════════════════════════════════════════════════════════════════ */
.has-dropdown { position: relative; }
.has-dropdown:hover .nav-chevron,
.has-dropdown.is-open .nav-chevron { transform: rotate(180deg); opacity: 1; }
.dropdown {
    position: absolute; top: 100%; left: 0; min-width: 300px;
    background: var(--color-cream); border: 1px solid var(--color-line);
    border-radius: 14px; box-shadow: 0 20px 60px rgba(20, 48, 37, 0.15);
    padding: 0.6rem; margin-top: 0.75rem;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 10000;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown::before { content: ''; position: absolute; top: -0.75rem; left: 0; right: 0; height: 0.75rem; }
.dropdown-list { list-style: none; margin: 0; padding: 0; }
.dropdown-list li + li { border-top: 1px solid var(--color-line); }
.dropdown-list a {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.7rem 0.65rem; border-radius: 8px; text-decoration: none;
    transition: background 0.18s ease;
}
.dropdown-list a:hover { background: var(--color-sand-100); }
.dropdown-list .dd-ic { font-size: 1.4rem; flex-shrink: 0; line-height: 1; margin-top: 0.1rem; }
.dropdown-list .dd-text { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.dropdown-list strong { font-family: var(--font-display); font-weight: 500; font-size: 1rem; color: var(--color-ink); }
.dropdown-list em { font-style: normal; font-family: var(--font-body); font-size: 0.78rem; color: var(--color-mute); }

/* Lien Live avec point rouge pulsant */
.nav-link--live { display: inline-flex; align-items: center; gap: 0.4rem; }
.live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #dc2626; flex-shrink: 0; animation: navLivePulse 1.4s infinite;
}
@keyframes navLivePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
    50% { opacity: 0.5; box-shadow: 0 0 0 4px rgba(220, 38, 38, 0); }
}

/* Mobile accordéon */
@media (max-width: 720px) {
    .has-dropdown { width: 100%; }
    .has-dropdown > .nav-link {
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; cursor: pointer;
    }
    .dropdown {
        position: static; opacity: 1; visibility: hidden; transform: none;
        min-width: 0; width: 100%; background: transparent; border: 0;
        box-shadow: none; border-radius: 0; padding: 0; margin: 0;
        max-height: 0; overflow: hidden;
        transition: max-height 0.35s ease, visibility 0.35s;
    }
    .has-dropdown.is-open .dropdown {
        visibility: visible; max-height: 600px; padding: 0.25rem 0 0.5rem;
    }
    .dropdown::before { display: none; }
    .has-dropdown.is-open .nav-chevron { transform: rotate(180deg); }
    .dropdown-list li + li { border-top: none; }
}

/* Header collant en haut, au-dessus de la carte Leaflet */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9999;
}