/* ============================================================
   PAGE "NOTRE ÉQUIPE" — CREAI-VBG
   Sous-page de « Qui sommes-nous » : elle réutilise le style
   d'apropos.css (hero, cartes membres, CTA) et ajoute la
   navigation par pôle.
   ============================================================ */


/* --- Navigation par pôle (ancres) --- */

.team-nav {
    position: sticky;
    top: 64px;
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
}

.team-nav-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    max-width: 1100px;
}

.team-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background: var(--surface);
    color: var(--accent-800);
    border: 1.5px solid var(--accent-200);
    border-radius: 999px;
    font-size: 15.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.team-nav-link:hover {
    background: var(--accent-600);
    color: #ffffff;
    border-color: var(--accent-600);
}

.team-nav-link:focus-visible {
    outline: 2px solid var(--accent-600);
    outline-offset: 2px;
}

/* --- Sections de pôle --- */

.pole-section {
    scroll-margin-top: 140px;
    padding: 60px 0;
}

.apropos-page .pole-title {
    position: relative;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--accent-800);
    margin: 0 0 36px;
    padding-bottom: 14px;
}

.apropos-page .pole-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-600);
    border-radius: 2px;
}

/* --- Mobile --- */

@media (max-width: 600px) {
    .team-nav {
        position: static;
        padding: 12px 20px;
    }

    .team-nav-list {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .team-nav-list::-webkit-scrollbar {
        display: none;
    }

    .pole-section {
        padding: 44px 0;
        scroll-margin-top: 20px;
    }

    .apropos-page .pole-title {
        font-size: 24px;
        margin-bottom: 28px;
    }
}

/* Message « bientôt présentés » lisible aussi sur fond gris */
.apropos-section--alt .equipe-empty {
    background: var(--surface);
}

/* --- Popup : fiche complète d'un membre --- */

.membre-modal {
    border: none;
    padding: 0;
    background: transparent;
    max-width: 100vw;
    max-height: 100vh;
    margin: auto;
    overflow: visible;
}

.membre-modal::backdrop {
    background: rgba(51, 20, 58, 0.72);
    backdrop-filter: blur(4px);
}

.membre-modal[open] .membre-modal-panel {
    animation: membreModalIn 0.25s var(--ease);
}

@keyframes membreModalIn {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

.membre-modal-panel {
    position: relative;
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 40px clamp(24px, 5vw, 44px) 36px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.membre-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.membre-modal-close:hover { background: var(--brand-100); }

.membre-modal-photo {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--surface);
    box-shadow: 0 0 0 2px var(--accent-200), 0 8px 20px rgba(76, 68, 148, 0.16);
}

.membre-modal-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.membre-modal-pole {
    display: inline-block;
    margin: 0 0 12px;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--accent-50);
    color: var(--accent-800);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.membre-modal-nom {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 800;
    color: var(--brand-800);
}

.membre-modal-poste {
    margin: 0 0 4px;
    font-size: 15.5px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--accent-600);
}

.membre-modal-profession {
    margin: 0;
    font-style: italic;
    color: var(--text-secondary);
}

.membre-modal-profil {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    font-size: 17.5px;
    line-height: 1.75;
    text-align: left;
    white-space: pre-line;
    color: var(--text-secondary);
}

body.membre-modal-open { overflow: hidden; }

.membre-modal [hidden] { display: none; }

/* --- Membres d'un pôle : toujours sur une seule ligne ---
   Les cartes se partagent la largeur disponible ; en dessous de leur
   largeur minimale la ligne défile horizontalement au lieu de passer à la ligne. */
.pole-section .membres-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 24px;
    max-width: 1200px;
    overflow-x: auto;
    padding: 8px 4px 16px;
}

.pole-section .membre-card {
    flex: 1 1 0;
    min-width: 150px;
    max-width: 240px;
    width: auto;
}

@media (max-width: 600px) {
    .pole-section .membres-grid { justify-content: flex-start; gap: 16px; }
    .pole-section .membre-card  { flex: 0 0 140px; min-width: 0; }
}

/* --- Fiches incomplètes : la carte reste lisible et alignée --- */
.membre-body {
    overflow-wrap: anywhere;
}

.membre-card .membre-photo img {
    background: var(--accent-50);
}

/* Sans nom, le poste devient le titre de la carte */
.membre-card--sans-nom .membre-poste {
    margin-top: 0;
    font-size: 17.5px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-primary);
}
