.team-section {
    background: #000;
    color: #fff;
    padding: 48px 0 54px;
    position: relative;
    overflow: hidden;
}

.team-section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255,255,255,.035), transparent 35%, rgba(242,146,0,.035));
}

.team-container {
    width: min(1120px, calc(100% - 96px));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.team-header {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 28px;
}

.team-eyebrow {
    display: inline-block;
    font-size: .72rem;
    letter-spacing: .22em;
    font-weight: 700;
    color: #f29200;
    margin-bottom: 12px;
}

.team-header h2 {
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 3.2vw, 2.35rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.team-header p {
    margin: 0;
    color: #a9a9a9;
    font-size: .88rem;
}

/* ---------------------------------------------------------
   GRILLE : Flexbox pour centrer les cards quel que soit
   leur nombre (1, 2, 3, 4 ou plus), avec retour à la ligne.
   --------------------------------------------------------- */
.team-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

.team-card {
    flex: 0 0 218px;
    width: 218px;
    background: #111;
    border: 1px solid #272727;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
    outline: none;
}

.team-card:hover,
.team-card:focus-visible {
    transform: translateY(-7px);
    border-color: #f29200;
    box-shadow: 0 18px 40px rgba(0,0,0,.45);
}

.team-photo-wrap {
    position: relative;
    aspect-ratio: 1 / 1.04;
    overflow: hidden;
    background: #171717;
}

.team-photo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
    transition: transform .45s ease;
}

.team-card:hover .team-photo,
.team-card:focus-visible .team-photo {
    transform: scale(1.035);
}

.team-photo-placeholder,
.team-modal-placeholder {
    display: grid;
    place-items: center;
    color: #555;
    font-size: 4rem;
}

.team-view-hint {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.45);
    background: rgba(0,0,0,.65);
    color: #fff;
    opacity: 0;
    transform: translateY(5px);
    transition: .25s ease;
}

.team-card:hover .team-view-hint,
.team-card:focus-visible .team-view-hint {
    opacity: 1;
    transform: translateY(0);
}

/* ---------------------------------------------------------
   INFOS DE LA CARD : nom + poste centrés (X et Y)
   --------------------------------------------------------- */
.team-card-info {
    padding: 13px 15px 14px;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
}

.team-card-info h3 {
    margin: 0;
    width: 100%;
    text-align: center;
    font-size: .96rem;
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
}

.team-card-info p {
    margin: 0;
    width: 100%;
    text-align: center;
    color: #a5a5a5;
    font-size: .76rem;
    line-height: 1.35;
}

/* ---------------------------------------------------------
   MODALE
   --------------------------------------------------------- */
.team-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    isolation: isolate;
}

.team-modal.is-open { display: flex; }

.team-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.84);
    backdrop-filter: blur(5px);
}

.team-modal-dialog {
    width: min(840px, 100%);
    height: min(600px, calc(100vh - 104px));
    max-height: calc(100vh - 104px);
    overflow: hidden;
    position: relative;
    background: #101010;
    border: 1px solid #303030;
    border-radius: 6px;
    box-shadow: 0 30px 90px rgba(0,0,0,.65);
    z-index: 3;
    animation: teamModalIn .25s ease both;
}

@keyframes teamModalIn {
    from { opacity: 0; transform: translateY(18px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.team-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    width: 38px;
    height: 38px;
    border: 1px solid #444;
    border-radius: 3px;
    background: rgba(0,0,0,.65);
    color: #fff;
    cursor: pointer;
}

.team-modal-close:hover { border-color: #f29200; color: #f29200; }

.team-modal-content {
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
    height: 100%;
    min-height: 0;
}

.team-modal-photo {
    min-height: 0;
    height: 100%;
    background: #171717;
}

.team-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.team-modal-details {
    min-height: 0;
    padding: 46px 42px 28px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.team-modal-scroll {
    min-height: 0;
    overflow-y: auto;
    padding-right: 12px;
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}

.team-modal-scroll::-webkit-scrollbar { width: 6px; }
.team-modal-scroll::-webkit-scrollbar-track { background: transparent; }
.team-modal-scroll::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
.team-modal-scroll::-webkit-scrollbar-thumb:hover { background: #f29200; }

.team-modal-label {
    color: #f29200;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.team-modal-details h2 {
    margin: 8px 0 6px;
    color: #fff;
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    line-height: 1.2;
    word-break: break-word;
}

.team-modal-position { margin: 0; color: #fff; font-weight: 700; }
.team-modal-function { margin: 4px 0 0; color: #999; }

.team-modal-block {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #2c2c2c;
}

.team-modal-block h3 {
    margin: 0 0 10px;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: #f29200;
}

.team-modal-block p { margin: 0; color: #c7c7c7; line-height: 1.7; }

.team-contact { display: grid; gap: 9px; }
.team-contact a { color: #c7c7c7; text-decoration: none; }
.team-contact a:hover { color: #f29200; }
.team-contact i { margin-right: 9px; }

.team-socials {
    display: flex;
    flex: 0 0 auto;
    gap: 9px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #2c2c2c;
}

.team-socials a {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: #fff;
    border: 1px solid #353535;
    text-decoration: none;
    transition: .2s ease;
}

.team-socials a:hover { color: #000; background: #f29200; border-color: #f29200; }

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

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */
@media (max-width: 900px) {
    .team-modal { padding-top: 76px; }
    .team-modal-dialog { height: min(600px, calc(100vh - 96px)); max-height: calc(100vh - 96px); }
    .team-modal-content { grid-template-columns: 1fr; grid-template-rows: 230px minmax(0, 1fr); }
    .team-modal-photo { min-height: 0; height: 230px; }
    .team-modal-photo img { min-height: 0; height: 230px; }
}

@media (max-width: 560px) {
    .team-section { padding: 46px 0 52px; }
    .team-container { width: min(100% - 32px, 480px); }

    .team-grid { gap: 14px; }

    .team-card {
        flex: 0 0 min(200px, calc(50% - 7px));
        width: min(200px, calc(50% - 7px));
    }

    .team-card-info { padding: 11px 12px 12px; min-height: 0; }
    .team-card-info h3 { font-size: .85rem; }
    .team-card-info p { font-size: .72rem; }
    .team-view-hint { width: 28px; height: 28px; right: 8px; bottom: 8px; }

    .team-modal { padding: 12px; align-items: center; }
    .team-modal-dialog { height: calc(100vh - 24px); max-height: calc(100vh - 24px); }
    .team-modal-content { grid-template-rows: 190px minmax(0, 1fr); }
    .team-modal-photo, .team-modal-photo img { height: 190px; }
    .team-modal-details { padding: 34px 20px 18px; }
    .team-socials { margin-top: 14px; padding-top: 12px; }
}

@media (max-width: 380px) {
    .team-container { width: calc(100% - 24px); }
    .team-grid { gap: 10px; }
    .team-card-info { padding: 9px 10px 10px; }
    .team-card-info h3 { font-size: .8rem; }
    .team-card-info p { font-size: .68rem; }

    .team-modal-details { padding: 30px 16px 16px; }
    .team-modal-details h2 { font-size: 1.2rem; }
    .team-socials a { width: 36px; height: 36px; }
}