/* ==========================================================================
   ABRT — Page Pilotes
   Carrousel 3D + noms latéraux
   À charger APRÈS style.css (dépend des variables --c-*, --font-*)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Zone carrousel — grid 3 colonnes : nom gauche / carrousel / nom droite
   Les colonnes latérales en 1fr poussent les boutons vers les bords,
   la colonne centrale (bornée) garde le carrousel toujours centré.
   -------------------------------------------------------------------------- */
.carousel-zone {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) minmax(440px, 880px) minmax(110px, 1fr);
    align-items: center;
    gap: 24px;
    width: 100%;
}

.noms-lateraux {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 220px;
}

.noms-lateraux--gauche { justify-self: start; }
.noms-lateraux--droite { justify-self: end; align-items: flex-end; }

.btn-nom {
    background: transparent;
    border: 1px solid var(--c-border);
    color: var(--c-text);
    padding: 12px 18px;
    border-radius: 6px;
    font-family: var(--font-display);
    font-size: 13px;
    letter-spacing: .03em;
    text-transform: uppercase;
    width: 100%;
    transition: border-color .15s ease, color .15s ease;
}

.btn-nom:hover { border-color: var(--c-amber); color: var(--c-amber); }

/* --------------------------------------------------------------------------
   Carrousel
   -------------------------------------------------------------------------- */
.carousel {
    justify-self: center;
    position: relative;
    height: 500px;
    width: 100%;
    perspective: 1500px;
    overflow: hidden;
    touch-action: pan-y;
    user-select: none;
    cursor: grab;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel.is-dragging { cursor: grabbing; }

.pilote-carte {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 480px;
    padding: 36px 28px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform .45s cubic-bezier(.25,.8,.35,1), opacity .45s ease;
    will-change: transform, opacity;
    cursor: pointer;
}

.carousel.is-dragging .pilote-carte { transition: none; }

.pilote-carte.is-active {
    border-color: var(--c-amber);
    cursor: default;
}

.pilote-avatar {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--c-bg);
    border: 3px solid var(--c-amber);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 34px;
    color: var(--c-amber);
}

.pilote-avatar img { width: 100%; height: 100%; object-fit: cover; }

.pilote-nom {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
}

.pilote-role {
    font-size: 13px;
    color: var(--c-amber);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 16px;
}

.pilote-desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--c-text-muted);
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pilote-carte .btn--resultats {
    margin-top: auto;
}

/* --------------------------------------------------------------------------
   Contrôles (prev / next / hint)
   -------------------------------------------------------------------------- */
.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 28px;
}

.carousel-controls button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    color: var(--c-text);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-controls button:hover { border-color: var(--c-red); color: var(--c-red); }

.carousel-hint {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-text-muted);
    letter-spacing: .04em;
}

/* --------------------------------------------------------------------------
   Responsive 1460 — on repasse en pile verticale
   -------------------------------------------------------------------------- */
@media (max-width: 1460px) {
    .carousel-zone {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .noms-lateraux {
        flex-direction: row;
        flex-wrap: wrap;
        max-width: none;
        justify-self: unset;
    }
    .noms-lateraux--droite { align-items: stretch; }
    .btn-nom { width: auto; }
}

@media (max-width: 640px) {
    .carousel { height: 520px; }
    .pilote-carte { width: 300px; height: 420px; padding: 26px 18px; }
    .pilote-avatar { width: 150px; height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
    .pilote-carte { transition: none; }
}