/* --- POPUP ENGAGEMENT --- */
.popup-engagement-logo {
    display: block;
    width: 90px;
    height: 90px;
    object-fit: cover;
    margin: 0 auto 1.2rem auto;
    border-radius: 12px;
    box-shadow: 0 2px 10px 0 rgba(0,0,0,0.10);
}
.popup-engagement-titre {
    font-size: 1.45rem;
    font-weight: 700;
    padding: 0.4em 1.2em 0.3em 1.2em;
    margin: 0.5em 0 1.2em 0;
    border-radius: 0.7em 0.5em 1.1em 0.6em/1.2em 0.7em 0.8em 1.1em;
    box-decoration-break: clone;
    line-height: 1.2;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.07);
    position: relative;
    z-index: 1;
}

.popup-engagement-titre.impair {
    background: var(--secondary);
    color: #fff;
}
.popup-engagement-titre.pair {
    background: var(--primary);
    color: #111;
}
/* Toujours garder :root en haut */
:root {
    --primary: #89d566; /* Vert institutionnel */
    --secondary: #cc0000; /* Touche de rouge dynamique */
    --light: white;
    --dark: #333;
    --site-max-width: 1000px;
    --site-margin-bg: #f1f3f6; /* gris très clair pour les marges */
    --main-nav-bg: var(--primary); /* couleur du menu principal */
    --engagement-num-bg: var(--secondary); /* couleur numéro engagement */
}


/* Candidat 1 seul sur la première ligne */
.trombinoscope {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 2rem;
    max-width: var(--site-max-width);
    margin: auto;
}
.candidat-tete {
    grid-column: 1 / -1;
    justify-self: center;
}
.trombinoscope-ligne {
    grid-column: 1 / -1;
    height: 0;
}
/* Candidat 1 centré sur la première ligne */
.trombinoscope {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    padding: 2rem;
    max-width: var(--site-max-width);
    margin: auto;
}
/* Toutes les cases candidats sont identiques */
/* Intro équipe */
.intro-equipe {
    margin: 1.5rem auto 1.5rem auto;
    max-width: 700px;
    font-size: 1.25rem;
    color: var(--dark);
    text-align: center;
    line-height: 1.6;
}
/* Menu principal sous le header */
.main-nav {
    background: var(--primary);
    text-align: center;
}
.main-nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-nav ul li {
    margin: 0 18px;
}
.main-nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 1rem 0.5rem;
    display: inline-block;
    transition: color 0.2s;
}
.main-nav ul li a:hover {
    color: var(--secondary);
}

@media (max-width: 700px) {
    .main-nav ul {
        flex-direction: column;
    }
    .main-nav ul li {
        margin: 8px 0;
    }
    .main-nav ul li a {
        padding: 0.7rem 0;
        font-size: 1rem;
    }
}


body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    line-height: 1.6;
    color: var(--dark);
    background: var(--site-margin-bg);
}

/* Conteneur principal centré sur PC */
.container-site {
    max-width: var(--site-max-width);
    margin: 0 auto;
    background: var(--light);
    box-shadow: 0 0 8px 0 rgba(0,0,0,0.03);
    box-sizing: border-box;
    min-height: 100vh;
    padding: 0 20px;
}

header, footer {
    max-width: var(--site-max-width);
    margin: 0 auto;
    box-sizing: border-box;
    padding-left: 20px;
    padding-right: 20px;
}

header {
    background: var(--main-nav-bg);
    .header-texte {
        background: #fff;
        text-align: center;
        margin: 0 auto;
        padding: 2.5rem 2rem 2.5rem 2rem;
        font-size: 2.1rem;
        color: var(--primary);
        font-weight: 600;
        border-radius: 12px;
        max-width: 900px;
        box-shadow: 0 2px 12px 0 rgba(0,0,0,0.04);
        letter-spacing: 0.01em;
        line-height: 1.35;
    }
    color: white;
    padding: 0;
    position: static;
    z-index: 1000;
}

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

nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 1200px;
    margin: auto;
}

nav ul { display: flex; list-style: none; }
nav ul li { margin-left: 20px; }
nav ul li a { color: white; text-decoration: none; font-weight: bold; }

/* Trombinoscope */
.trombinoscope {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 2rem;
    max-width: 1200px;
    margin: auto;
}

.candidat {
    background: white;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.candidat:hover { transform: scale(1.05); }
.candidat img { width: 100%; border-radius: 5px; filter: grayscale(20%); }

/* Engagements */
.grille-engagements {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: var(--site-max-width);
    margin: 2rem auto;
}

.engagement-card {
    background: var(--primary);
    color: white;
    padding: 32px 18px 28px 18px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px 0 rgba(0,0,0,0.07);
    transition: transform 0.18s, box-shadow 0.18s;
    position: relative;
}
.engagement-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 24px 0 rgba(0,0,0,0.13);
}
.engagement-card .numero {
    position: absolute;
    top: 12px;
    left: 14px;
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--secondary);
    background: none;
    border-radius: 0;
    padding: 0;
    min-width: 0;
    text-align: left;
    box-shadow: none;
    margin-bottom: 0;
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-shadow: none;
}
.engagement-card h3 {
    font-size: 1.32rem;
    font-weight: 600;
    margin: 0;
    color: #222;
}
@media (max-width: 900px) {
    .grille-engagements {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 600px) {
    .grille-engagements {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .engagement-card {
        min-height: 120px;
        padding: 20px 8px 18px 8px;
    }
    .engagement-card .numero {
        font-size: 2rem;
    }
}

.engagement-card {
    background: var(--primary);
    color: white;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
}

/* Modale */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    position: relative;
}

.close {
    position: absolute;
    top: 10px; right: 20px;
    font-size: 30px;
    cursor: pointer;
}

footer { text-align: center; padding: 2rem; background: #ddd; margin-top: 2rem; }

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 900px) {
    .container-site, header, footer {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }
    .grille-engagements {
        grid-template-columns: repeat(2, 1fr);
    }
    .trombinoscope {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        padding: 1rem;
    }
    nav {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 1rem;
    }
    nav ul {
        margin-top: 10px;
    }
}

@media (max-width: 600px) {
    .container-site, header, footer {
        max-width: 100%;
        padding-left: 5px;
        padding-right: 5px;
    }
    .grille-engagements {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .trombinoscope {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0.5rem;
    }
    header {
        padding: 0.5rem 0;
    }
    nav {
        flex-direction: column;
        align-items: stretch;
        padding: 0 0.5rem;
    }
    nav ul {
        flex-direction: column;
        margin: 0;
        padding: 0;
    }
    nav ul li {
        margin: 10px 0 0 0;
    }
    .logo {
        font-size: 1.2rem;
        text-align: center;
        margin-bottom: 0.5rem;
    }
    .modal-content {
        max-width: 95vw;
        padding: 10px;
    }
    footer {
        padding: 1rem;
        font-size: 0.95rem;
    }
}
