/* --- Variables Charte Graphique --- */
:root {
    --blue-primary: #1D4E89;
    --blue-dark: #153b6a;
    --green-eco: #46A14F;
    --orange-action: #FEA522;
    --orange-hover: #e59115;
    --yellow-highlight: #FEC537;
    
    --white: #ffffff;
    --off-white: #f8f9fa;
    --gray-light: #e9ecef;
    --text-dark: #1e293b;
    --text-gray: #64748b;

    --font-title: 'Bricolage Grotesque', sans-serif;
    --font-body: 'Inter', sans-serif;

    --shadow-card: 0 10px 30px rgba(29, 78, 137, 0.08);
    --radius-btn: 50px;
    --radius-card: 24px;
}

/* --- Reset & Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--text-dark); background-color: var(--off-white); line-height: 1.6; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--font-title); font-weight: 800; letter-spacing: -0.02em; }
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.section-padding { padding: 80px 0; }

/* --- Header & Navigation Desktop --- */
header {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
nav { display: flex; justify-content: space-between; align-items: center; height: 80px; transition: all 0.3s ease; }
.logo { display: flex; align-items: center; gap: 12px; font-family: var(--font-title); flex-shrink: 0; }
.logo-mark { width: 40px; height: 40px; background: var(--blue-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--white); font-weight: bold; font-size: 1.2rem; border: 3px solid var(--yellow-highlight); }
.logo-title { font-size: 1.5rem; color: var(--blue-primary); font-weight: 800; line-height: 1; }
.logo-title span { color: var(--orange-action); }

.desktop-nav { display: flex; gap: 32px; align-items: center; }
.nav-link { font-weight: 600; color: var(--blue-primary); position: relative; white-space: nowrap; }
.nav-link:hover, .nav-link.active { color: var(--orange-action); }

.nav-link::after {
    content: '';
    position: absolute;
    width: 0; height: 2px;
    bottom: -5px; left: 0;
    background-color: var(--orange-action);
    transition: width 0.3s;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 28px; border-radius: var(--radius-btn); font-family: var(--font-title); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; cursor: pointer; transition: 0.3s; white-space: nowrap; border: none; }
.btn-orange { background: var(--orange-action); color: var(--white); }
.btn-orange:hover { background: var(--orange-hover); transform: translateY(-2px); }
.btn-blue { background: var(--blue-primary); color: var(--white); }
.btn-vert { background: var(--green-eco); color: var(--white); }
.btn-white-outline { border: 2px solid var(--white); color: var(--white); background: transparent; }
.btn-white-outline:hover { background: var(--white); color: var(--blue-primary); }

/* --- Page Headers --- */
.page-header { background: var(--blue-primary); padding: 140px 0 60px; color: var(--white); text-align: center; }
.page-header h1 { font-size: 3.5rem; margin-bottom: 10px; }
.page-header p { font-size: 1.2rem; opacity: 0.8; max-width: 600px; margin: 0 auto; }

/* --- Cards & Grids --- */
.grid-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.feature-card { background: var(--white); padding: 40px 30px; border-radius: var(--radius-card); box-shadow: var(--shadow-card); transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); border-top: 5px solid var(--blue-primary); }
.feature-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(29, 78, 137, 0.15); }
.feature-icon { width: 60px; height: 60px; background: var(--off-white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 20px; color: var(--blue-primary); }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 30px; }
.team-member { background: var(--white); padding: 20px; border-radius: 20px; text-align: center; box-shadow: var(--shadow-card); transition: 0.3s; }
.team-member:hover { transform: translateY(-5px); }
.member-photo { width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 15px; object-fit: cover; border: 3px solid var(--yellow-highlight); }
.member-name { font-weight: 700; color: var(--blue-primary); font-size: 1.1rem; }
.member-role { color: var(--orange-action); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; margin-bottom: 5px; }
.member-job { font-size: 0.9rem; color: var(--text-gray); }
.member-quartier { display: inline-block; background: var(--off-white); padding: 4px 10px; border-radius: 10px; font-size: 0.75rem; color: var(--text-gray); margin-top: 10px; }

.social-card img { width: 100%; aspect-ratio: 1080 / 1350; object-fit: cover; object-position: center; border-radius: 15px; display: block;}

/* --- Carte & SEO Citoyen --- */
#map { border: 2px solid var(--gray-light); box-shadow: var(--shadow-card); z-index: 1; border-radius: 24px; }
.grid-features h3 { margin-bottom: 15px; color: var(--blue-primary); }

/* --- Footer --- */
footer { background: var(--blue-dark); color: #94a3b8; padding: 60px 0 20px; margin-top: 80px; }
.footer-content { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 30px; flex-wrap: wrap; gap: 20px; }
.social-links a { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--white); transition: 0.3s; }
.social-links a:hover { background: var(--orange-action); transform: translateY(-3px); }

/* --- SYSTEM BURGER MOBILE (BOTTOM RIGHT) --- */
.mobile-burger-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: var(--orange-action);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(254, 165, 34, 0.4);
    z-index: 2000;
    cursor: pointer;
    font-size: 1.5rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mobile-burger-btn:active { transform: scale(0.9); }

.mobile-menu-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--blue-primary);
    z-index: 2500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    transform: translateY(20px);
}

.mobile-menu-overlay.active {
    opacity: 0.98;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-links { text-align: center; }

.mobile-link {
    display: block;
    font-family: var(--font-title);
    font-size: 2rem;
    color: white;
    font-weight: 800;
    margin: 15px 0;
    transition: color 0.3s;
}

.mobile-link:hover { color: var(--yellow-highlight); }

.close-menu {
    position: absolute;
    top: 30px;
    right: 30px;
    background: transparent;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
}

.grid-reunions {
    position: relative; /* Pour positionner la liste par rapport à ce conteneur */
    display: block; /* On n'utilise plus grid ici */
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

#map {
    width: 100%;
    height: 600px; /* Augmenté pour un meilleur confort visuel */
    border: none; /* Inutile avec le conteneur parent */
    z-index: 1;
}

.leaflet-popup {
    margin-bottom: 20px;
}

#liste-reunions {
    position: absolute;
    top: 15px;
    left: 15px;
    bottom: 15px;
    width: 320px;
    z-index: 10; /* Doit être supérieur à celui de la map (1) */
    overflow-y: auto; /* Permet le scroll si la liste est longue */
    pointer-events: none; /* Permet de cliquer sur la carte à travers le conteneur vide */
}

.reunion-box {
    pointer-events: auto; /* Réactive les clics sur les boîtes elles-mêmes */
    background: rgba(255, 255, 255, 0.9) !important; /* Semi-transparent pour voir la carte derrière */
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 15px !important;
    border-radius: 15px;
    transition: transform 0.2s ease;
}

.reunion-item {
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.reunion-item:hover {
    background: var(--gray-light);
}

/* --- Responsive Adaptations --- */
@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .mobile-burger-btn { display: flex; align-items: center; justify-content: center; }
    
    header { height: 70px; }
    nav { justify-content: center; }
    .logo-title { font-size: 1.2rem; }
    .hero h1 { font-size: 2.2rem; }
    .page-header h1 { font-size: 2rem; }
    .section-padding { padding: 50px 0; }
    .team-hero { text-align: center; }
    .grid-reunions { grid-template-columns: 1fr !important; }
    #liste-reunions {
        position: relative;
        top: 0; left: 0;
        width: 100%;
        height: auto;
        padding: 10px 0;
    }
    #map {
        height: 400px;
    }
}

/* Layout Equipe */
.equipe-layout {
    display: flex;
    height: calc(100vh - 80px); /* Hauteur moins le header */
    overflow: hidden;
}

.map-container {
    flex: 1;
    height: 100%;
    z-index: 1;
}

.side-panel {
    width: 400px;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
    padding: 20px;
    z-index: 2;
}

.team-grid-panel {
    display: grid;
    grid-template-columns: 1fr; /* Une seule colonne dans le volet */
    gap: 20px;
}

/* --- MOBILE VERSION --- */
@media (max-width: 768px) {
    .equipe-layout {
        flex-direction: column;
        height: auto;
    }

    .map-container {
        height: 40vh; /* La carte prend le haut */
        position: sticky;
        top: 0;
    }

    .side-panel {
        width: 100%;
        height: 60vh;
        margin-top: -20px; /* Chevauchement stylé sur la carte */
        border-radius: 25px 25px 0 0;
        position: relative;
    }
    
    /* Petite barre de drag visuelle pour mobile */
    .side-panel::before {
        content: "";
        width: 40px;
        height: 5px;
        background: #ccc;
        display: block;
        margin: 0 auto 15px;
        border-radius: 10px;
    }
}