/* ==========================================================================
   1. VARIABLES, RESET & BASE
   ========================================================================== */
:root {
    --primary-blue: #0056b3;
    --primary-hover: #004494;
    --accent-gold: #ffcc00;
    --text-dark: #333333;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --radius: 12px;
    --header-height: 160px;
    --nav-height: 75px;
    --total-sticky-height: 235px;
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8f9fa linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)), 
                url('fdmairie.jpeg') center top / cover no-repeat fixed;
}

img { max-width: 100%; height: auto; display: block; }

main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: calc(var(--total-sticky-height) - 20px) auto 0; 
    padding: 20px 20px 60px;
}

/* ==========================================================================
   2. HEADER & NAVIGATION (DESKTOP)
   ========================================================================== */
.bandeau-bleu {
    background-color: var(--primary-blue);
    height: var(--header-height);
    width: 100%;
    position: fixed;
    top: 0;
    z-index: 2000;
    display: flex;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.header-container {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo { max-height: 130px; }

.btn-newsletter {
    background-color: var(--white);
    color: var(--primary-blue);
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.btn-newsletter:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }

.navigation {
    background-color: rgba(255, 255, 255, 0.98);
    height: var(--nav-height);
    width: 100%;
    position: fixed;
    top: var(--header-height);
    z-index: 1999;
    display: flex;
    justify-content: center;
    box-shadow: var(--shadow-soft);
}

.navigation ul { list-style: none; display: flex; height: 100%; }

.navigation a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 700;
    padding: 0 25px;
    display: flex;
    align-items: center;
    height: 100%;
    transition: var(--transition);
    text-transform: uppercase;
}

.menu-toggle { display: none; } /* Caché sur PC */

/* ==========================================================================
   3. ZONE NEWSLETTER & FOOTER
   ========================================================================== */
.elan-newsletter-bar {
    background-color: var(--bg-light);
    padding: 25px 0;
    border-top: 3px solid var(--accent-gold);
    width: 100%;
}

.newsletter-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    gap: 50px;
}

.newsletter-text h3 { color: var(--primary-blue); font-size: 1.4rem; margin-bottom: 5px; }
.newsletter-text p { font-size: 0.95rem; opacity: 0.8; }
.newsletter-form-container { flex: 0 1 400px; }
.newsletter-form-container iframe { height: 160px !important; border: none; background: transparent; }

.bandeau-bleu-footer { background-color: var(--primary-blue); color: var(--white); padding: 40px 0; width: 100%; }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 0 20px; gap: 30px; }
.footer-logo-zone, .footer-text-zone, .footer-legal-zone, .footer-links-zone { flex: 1; min-width: 200px; }
.logo-mini { filter:none !important; max-height:  80px; width: auto; display: block; filter: brightness(0) invert(1); border-radius: 0%; }
.footer-text-zone { text-align: center; }
.footer-legal-zone { text-align: right; font-size: 0.9rem; }
.footer-legal-zone a { color: var(--white); text-decoration: none; font-weight: 700; }
.footer-links { list-style: none; display: flex; justify-content: center; gap: 20px; padding: 0; }
.footer-links li a { color: rgba(255, 255, 255, 0.8); text-decoration: none; font-size: 0.85rem; }

/* ==========================================================================
   4. PAGE ÉQUIPE & BOUTONS ANCRES
   ========================================================================== */
.equipe-nav { margin: 20px 0 40px 0; text-align: center; background: var(--white); padding: 25px; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.nav-label { display: block; font-weight: 700; margin-bottom: 15px; color: var(--primary-blue); text-transform: uppercase; font-size: 0.85rem; letter-spacing: 1px; }
.nav-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn-anchor { text-decoration: none; background-color: var(--white); color: var(--primary-blue); padding: 10px 20px; border-radius: 50px; font-size: 0.9rem; font-weight: 600; border: 2px solid var(--primary-blue); transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.btn-anchor:hover { background-color: var(--primary-blue); color: var(--white); transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0, 86, 179, 0.25); }

.equipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }
.membre-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-soft); transition: var(--transition); scroll-margin-top: calc(var(--total-sticky-height) + 40px); }
.head-of-list { grid-column: 1 / -1; display: flex; background: linear-gradient(to right, #ffffff, #f0f7ff); }
.head-of-list .membre-photo { flex: 0 0 400px; }
.membre-photo img { width: 100%; height: 350px; object-fit: cover; }
.membre-infos { padding: 25px; }
.membre-role { font-weight: 700; color: var(--accent-gold); text-transform: uppercase; font-size: 0.9rem; }

/* ==========================================================================
   5. RESPONSIVE MOBILE (GLOBAL) - VERSION CORRIGÉE
   ========================================================================== */
@media (max-width: 768px) {
    :root { --nav-height: 60px; }
    
    main { margin-top: 0; padding: 20px 15px; }

    /* Header & Logo */
    .bandeau-bleu { position: relative; height: auto; padding: 20px 0; }
    .header-container { flex-direction: column; gap: 15px; }
    .logo { max-height: 80px; }

    /* Barre de Navigation */
    .navigation { 
        position: sticky; 
        top: 0; 
        height: var(--nav-height); 
        display: flex;
        justify-content: flex-end; 
        align-items: center; 
        background: white;
        z-index: 2000;
        overflow: visible !important; /* Important pour laisser sortir le menu */
    }
    
    /* Bouton Hamburger */
    .menu-toggle { 
        display: flex; 
        flex-direction: column; 
        justify-content: space-between; 
        width: 30px; 
        height: 21px; 
        margin-right: 20px; 
        background: none; 
        border: none; 
        cursor: pointer; 
        z-index: 2001; 
    }
    
    .menu-toggle .bar { 
        width: 100%; 
        height: 3px; 
        background-color: var(--primary-blue); 
        border-radius: 10px; 
        transition: 0.3s; 
    }

    /* Animation du hamburger en X */
    .navigation.mobile-open .menu-toggle .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .navigation.mobile-open .menu-toggle .bar:nth-child(2) { opacity: 0; }
    .navigation.mobile-open .menu-toggle .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    /* LISTE DU MENU (ul#nav-list) */
    #nav-list {
        display: none !important; /* Cache par défaut */
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background-color: #ffffff !important;
        margin: 0;
        padding: 0;
        list-style: none;
        z-index: 9999;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }

    /* OUVERTURE DU MENU */
    .navigation.mobile-open #nav-list {
        display: flex !important; /* S'affiche au clic */
    }

    /* Liens du menu */
    #nav-list li { 
        width: 100%; 
        border-bottom: 1px 
        solid #eeeeee; 
    background-color: #ffffff;
    }
    #nav-list li a { 
        display: block !important; 
        padding: 18px 20px !important; 
        color: #0056b3 !important; 
        text-align: center; 
        text-decoration: none; 
        font-weight: 800;
        font-size: 1.1rem;
        background-color: #ffffff !important; 
        
    }

/* Effet au clic sur mobile */
    #nav-list li a:active {
        background-color: #f8f9fa !important;
        color: #004494 !important;
    }
    #nav-list li.current-menu-item a {
    background-color: var(--primary-blue) !important;
    color: white !important;
}
    /* Autres ajustements */
    .newsletter-grid { flex-direction: column; text-align: center; gap: 15px; }
    .footer-content { flex-direction: column; text-align: center; }
    .footer-legal-zone { text-align: center; }
    .head-of-list { flex-direction: column; }
    .head-of-list .membre-photo { flex: none; }
    .equipe-grid { grid-template-columns: 1fr; }
    .btn-anchor { width: 100%; max-width: 250px; }
}
/* ==========================================================================
   OPTIMISATION BOUTONS ÉQUIPE MOBILE
   ========================================================================== */
@media (max-width: 768px) {
    .equipe-nav {
        padding: 15px 10px;
        margin-bottom: 25px;
    }

    .nav-buttons {
        display: grid; /* On passe en grille pour un alignement parfait */
        grid-template-columns: 1fr 1fr; /* 2 boutons par ligne */
        gap: 10px;
    }

    .btn-anchor {
        width: 100%;
        max-width: none;
        padding: 12px 5px; /* Plus haut pour faciliter le clic */
        font-size: 0.85rem;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: 1.2;
        min-height: 50px; /* Taille minimale recommandée pour l'accessibilité tactile */
    }

    /* Si vous avez un nombre impair de boutons, le dernier prend toute la largeur */
    .btn-anchor:last-child:nth-child(odd) {
        grid-column: 1 / span 2;
    }
}

/* Container principal du menu équipe */
.equipe-nav-container {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 50px;
    border-left: 5px solid var(--primary-blue);
}

.equipe-nav-title {
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Grille des noms */
.equipe-badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

/* Style individuel des badges */
.badge-item {
    display: inline-block;
    padding: 8px 18px;
    background-color: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.badge-item:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 86, 179, 0.2);
}

/* Optimisation Mobile (2 colonnes propres) */
@media (max-width: 768px) {
    .equipe-nav-container {
        padding: 20px 15px;
    }
    
    .equipe-badges-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 2 colonnes sur mobile */
        gap: 8px;
    }

    .badge-item {
        padding: 12px 5px;
        text-align: center;
        font-size: 0.8rem;
    }
}

/* Container Newsletter */
.elan-newsletter-bar {
    background-color: #f4f7fa; /* Gris bleuté très doux */
    padding: 60px 0;
    border-top: 4px solid var(--accent-gold);
    width: 100%;
}

.newsletter-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Deux colonnes sur PC */
    align-items: center;
    padding: 0 20px;
    gap: 40px;
}

/* Texte à gauche */
.badge-news {
    background: var(--primary-blue);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 15px;
    display: inline-block;
}

.newsletter-text h3 {
    color: var(--primary-blue);
    font-size: 2rem;
    margin-bottom: 15px;
}

.newsletter-text p {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.privacy-note {
    margin-top: 20px;
    font-size: 0.85rem !important;
    opacity: 0.7;
    font-style: italic;
}

/* On simplifie le container maintenant qu'il n'y a plus d'iframe */
.newsletter-form-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Version Mobile */
@media (max-width: 768px) {
    .elan-newsletter-bar { padding: 40px 0; }
    .newsletter-grid { 
        grid-template-columns: 1fr; /* Une seule colonne sur mobile */
        text-align: center; 
        gap: 30px;
    }
    .newsletter-text h3 { font-size: 1.6rem; }
    .badge-news { margin: 0 auto 15px; }
}

/* Style du nouveau bouton Newsletter */
.cta-newsletter-box {
    display: flex;
    align-items: center;
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-dark);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    gap: 20px;
}

.cta-newsletter-box:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 86, 179, 0.15);
}

.cta-icon {
    background: var(--primary-blue);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.cta-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.cta-text strong {
    font-size: 1.2rem;
    color: var(--primary-blue);
}

.cta-text span {
    font-size: 0.9rem;
    opacity: 0.7;
}

.cta-newsletter-box .arrow {
    color: var(--primary-blue);
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.cta-newsletter-box:hover .arrow {
    transform: translateX(5px);
    opacity: 1;
}

/* Ajustement mobile */
@media (max-width: 768px) {
    .cta-newsletter-box {
        padding: 15px;
    }
    .cta-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Supprime le titre automatique des pages */
.page .entry-title, 
.page h1.title,
.post-title {
    display: none !important;
}

/* Suppression ultra-large des titres de page */
.page .entry-title, 
.page .post-title, 
.page .page-title, 
.page .entry-header,
.page header h1,
#main h1.title,
.page .entry-content h1:first-of-type {
    display: none !important;
}

.hero-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.hero-card {
    padding-top: 10px !important;
}

/* page 404 */

.error-404-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
    text-align: center;
}

.error-card {
    background: var(--white);
    padding: 50px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    max-width: 600px;
    width: 100%;
}

.error-icon {
    font-size: 4rem;
    color: var(--accent-gold);
    margin-bottom: 20px;
}

.error-card h1 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.error-card p {
    margin-bottom: 30px;
    color: #666;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}