/* =========================================================
   TOUR DE LA GUADELOUPE 2026
   EQUIPES ET COUREURS
   ========================================================= */

.vpx-tour-teams-section {
    max-width: 1240px;
    margin: 30px auto;
    padding: 24px;
    overflow: visible;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

/* =========================================================
   EN-TETE
   ========================================================= */

.vpx-tour-teams-header {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eeeeee;
}

.vpx-tour-teams-kicker {
    display: inline-block;
    margin-bottom: 7px;
    color: #e30613;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.vpx-tour-teams-title {
    margin: 0;
    color: #111111;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.vpx-tour-teams-description {
    margin: 9px 0 0;
    color: #666666;
    font-size: 14px;
    line-height: 1.5;
}

/* =========================================================
   GRILLE DES EQUIPES
   ========================================================= */

.vpx-tour-teams-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    overflow: visible;
}

.vpx-tour-teams-loading,
.vpx-tour-teams-error,
.vpx-tour-teams-empty {
    grid-column: 1 / -1;
    padding: 35px 15px;
    color: #666666;
    font-size: 15px;
    text-align: center;
}

.vpx-tour-teams-error {
    color: #b00020;
}

/* =========================================================
   CARTE D'UNE EQUIPE
   ========================================================= */

.vpx-tour-team-card {
    position: relative;
    min-width: 0;
    min-height: 380px;
    padding: 14px 10px 18px;
    overflow: visible;
    background: #fafafa;
    border: 1px solid #ebebeb;
    border-radius: 12px;
    box-sizing: border-box;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.vpx-tour-team-card:hover,
.vpx-tour-team-card.is-open {
    z-index: 20;
    overflow: visible;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

/* =========================================================
   SCENE CIRCULAIRE
   ========================================================= */

.vpx-tour-team-scene {
    position: relative;
    width: 330px;
    max-width: 100%;
    height: 310px;
    margin: 0 auto;
    overflow: visible;
}

/* =========================================================
   BLASON CENTRAL
   ========================================================= */

.vpx-tour-team-badge {
    position: absolute;
    z-index: 10;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    padding: 6px;
    overflow: hidden;
    background: #ffffff;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow:
        0 0 0 2px #e30613,
        0 6px 15px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
    box-sizing: border-box;
}
.vpx-tour-team-badge:hover,
.vpx-tour-team-badge:focus,
.vpx-tour-team-card.is-open .vpx-tour-team-badge {
    outline: none;
    transform:
        translate(-50%, -50%)
        scale(1.06);
    box-shadow:
        0 0 0 3px #e30613,
        0 10px 24px rgba(0, 0, 0, 0.24);
}

.vpx-tour-team-badge-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vpx-tour-team-badge-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(
            135deg,
            #171717 0%,
            #2b2b2b 100%
        );
    color: #ffffff;
    border-radius: 50%;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
}

/* =========================================================
   COUREURS AUTOUR DU BLASON
   ========================================================= */

.vpx-tour-team-riders {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.vpx-tour-team-rider {
    position: absolute;
    z-index: 5;
    top: 50%;
    left: 50%;
    width: 104px;
    height: 104px;
    margin-top: -52px;
    margin-left: -52px;
    opacity: 0;
    pointer-events: none;
    transform:
        rotate(var(--vpx-rider-angle))
        translateY(-112px)
        rotate(calc(-1 * var(--vpx-rider-angle)))
        scale(0.65);
    transition:
        opacity 0.25s ease,
        transform 0.32s ease;
}

.vpx-tour-team-card:hover .vpx-tour-team-rider,
.vpx-tour-team-card.is-open .vpx-tour-team-rider {
    opacity: 1;
    pointer-events: auto;
    transform:
        rotate(var(--vpx-rider-angle))
        translateY(-118px)
        rotate(calc(-1 * var(--vpx-rider-angle)))
        scale(1);
}

.vpx-tour-team-rider-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 104px;
    height: 104px;
    padding: 8px;
    overflow: hidden;
    background:
        linear-gradient(
            145deg,
            #ffffff 0%,
            #f3f3f3 100%
        );
    color: #222222;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow:
        0 0 0 2px #d8d8d8,
        0 5px 13px rgba(0, 0, 0, 0.18);
    text-align: center;
    box-sizing: border-box;
}

.vpx-tour-team-rider-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    height: 25px;
    margin-bottom: 4px;
    padding: 0 5px;
    background: #e30613;
    color: #ffffff;
    border-radius: 13px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-sizing: border-box;
}

.vpx-tour-team-rider-name {
    display: block;
    max-width: 86px;
    max-height: 42px;
    overflow: hidden;
    color: #222222;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
}

/* =========================================================
   NOM DE L'EQUIPE
   ========================================================= */

.vpx-tour-team-name {
    position: relative;
    z-index: 12;
    min-height: 44px;
    margin: 4px 6px 0;
    color: #111111;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
    text-transform: uppercase;
}

/* =========================================================
   TABLETTE
   ========================================================= */

@media screen and (max-width: 1100px) {
    .vpx-tour-teams-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media screen and (max-width: 767px) {
    .vpx-tour-teams-section {
        margin: 20px auto;
        padding: 15px 12px;
        border-radius: 10px;
    }

    .vpx-tour-teams-header {
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    .vpx-tour-teams-title {
        font-size: 21px;
    }

    .vpx-tour-teams-description {
        font-size: 13px;
    }

    .vpx-tour-teams-grid {
        display: block;
    }

    .vpx-tour-team-card {
        min-height: 0;
        margin-bottom: 14px;
        padding: 14px 10px;
    }

    .vpx-tour-team-card:last-child {
        margin-bottom: 0;
    }

    .vpx-tour-team-card:hover {
        transform: none;
    }

    .vpx-tour-team-scene {
        display: flex;
        align-items: center;
        flex-direction: column;
        width: 100%;
        height: auto;
        min-height: 150px;
    }

    .vpx-tour-team-badge {
        position: relative;
        top: auto;
        left: auto;
        width: 116px;
        height: 116px;
        margin: 4px auto 10px;
        transform: none;
    }

    .vpx-tour-team-badge:hover,
    .vpx-tour-team-badge:focus,
    .vpx-tour-team-card.is-open .vpx-tour-team-badge {
        transform: scale(1.04);
    }

    .vpx-tour-team-riders {
        position: relative;
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        margin-top: 10px;
        padding-top: 12px;
        border-top: 1px solid #e4e4e4;
        box-sizing: border-box;
    }

    .vpx-tour-team-card.is-open
    .vpx-tour-team-riders {
        display: grid;
    }

    .vpx-tour-team-rider {
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        height: auto;
        margin: 0;
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }

    .vpx-tour-team-card:hover
    .vpx-tour-team-rider,
    .vpx-tour-team-card.is-open
    .vpx-tour-team-rider {
        transform: none;
    }

    .vpx-tour-team-rider-circle {
        width: 100%;
        height: auto;
        min-height: 70px;
        padding: 8px;
        border-radius: 8px;
    }

    .vpx-tour-team-rider-name {
        max-width: none;
        max-height: none;
        font-size: 10px;
    }

    .vpx-tour-team-name {
        order: -1;
        min-height: 0;
        margin: 0 0 10px;
        font-size: 14px;
    }
}

/* =========================================================
   PETITS MOBILES
   ========================================================= */

@media screen and (max-width: 380px) {
    .vpx-tour-team-riders {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   AJUSTEMENTS DESIGN VIP CROSSING
   ========================================================= */

/* Bloc principal plus compact */
.vpx-tour-teams-section {
    margin: 22px auto;
    padding: 20px;
    background:
        linear-gradient(
            180deg,
            #ffffff 0%,
            #fafafa 100%
        );
    border-top: 5px solid #e30613;
}

/* Réduction de l’espace au-dessus du titre */
.vpx-tour-teams-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
}

.vpx-tour-teams-title {
    margin-top: 0;
    font-size: 26px;
    letter-spacing: -0.3px;
}

.vpx-tour-teams-description {
    margin-top: 6px;
}

/* Le petit surtitre est supprimé */
.vpx-tour-teams-kicker {
    display: none;
}

/* Quatre équipes par ligne sur grand écran */
.vpx-tour-teams-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

/* Cartes plus compactes */
.vpx-tour-team-card {
    min-height: 330px;
    padding: 10px 8px 14px;
    background: #ffffff;
    border-color: #e3e3e3;
}

/* Réduction de la zone circulaire */
.vpx-tour-team-scene {
    width: 285px;
    height: 265px;
}

/* Blason central légèrement plus petit */
.vpx-tour-team-badge {
    width: 108px;
    height: 108px;
    padding: 8px;
}

/* Cercles des coureurs plus petits */
.vpx-tour-team-rider {
    width: 88px;
    height: 88px;
    margin-top: -44px;
    margin-left: -44px;

    transform:
        rotate(var(--vpx-rider-angle))
        translateY(-95px)
        rotate(calc(-1 * var(--vpx-rider-angle)))
        scale(0.65);
}

.vpx-tour-team-card:hover .vpx-tour-team-rider,
.vpx-tour-team-card.is-open .vpx-tour-team-rider {
    transform:
        rotate(var(--vpx-rider-angle))
        translateY(-100px)
        rotate(calc(-1 * var(--vpx-rider-angle)))
        scale(1);
}

.vpx-tour-team-rider-circle {
    width: 88px;
    height: 88px;
    padding: 6px;
}

.vpx-tour-team-rider-number {
    min-width: 22px;
    height: 22px;
    margin-bottom: 3px;
    font-size: 10px;
}

.vpx-tour-team-rider-name {
    max-width: 74px;
    max-height: 36px;
    font-size: 9px;
}

/* Nom de l’équipe */
.vpx-tour-team-name {
    min-height: 38px;
    margin-top: 2px;
    font-size: 13px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media screen and (max-width: 1180px) {
    .vpx-tour-teams-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media screen and (max-width: 900px) {
    .vpx-tour-teams-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .vpx-tour-team-card {
        min-height: 350px;
    }
}

@media screen and (max-width: 767px) {
    .vpx-tour-teams-section {
        margin: 16px auto;
        padding: 14px 10px;
        border-top-width: 4px;
    }

    .vpx-tour-teams-title {
        font-size: 20px;
    }

    .vpx-tour-teams-grid {
        display: block;
    }

    .vpx-tour-team-card {
        min-height: 0;
        margin-bottom: 12px;
    }

    .vpx-tour-team-scene {
        width: 100%;
        height: auto;
    }

    .vpx-tour-team-badge {
        width: 104px;
        height: 104px;
    }
}

/* =========================================================
   CORRECTIF V7 - LIENS, SURVOL ET MOBILE
   ========================================================= */

/* Le cercle central conserve les dimensions validées */
.vpx-tour-team-badge {
    width: 88px;
    height: 88px;
    padding: 6px;
}

/* Le grand cadre de l'équipe disparaît pendant l'ouverture */
.vpx-tour-team-card:hover,
.vpx-tour-team-card.is-open {
    z-index: 20;
    overflow: visible;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

/* Le lien occupe tout le cercle du coureur */
.vpx-tour-team-rider-link {
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    border-radius: 50%;
    text-decoration: none;
    cursor: pointer;
}

/* Transitions réelles sur les éléments visibles */
.vpx-tour-team-rider-circle {
    transition:
        transform 0.22s ease,
        background 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.22s ease;
    transform-origin: center center;
}

.vpx-tour-team-rider-number {
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.vpx-tour-team-rider-name {
    transition: color 0.2s ease;
}

/* Survol d'un coureur disposant d'un lien */
.vpx-tour-team-rider-link:not(.has-no-link):hover
.vpx-tour-team-rider-circle,
.vpx-tour-team-rider-link:not(.has-no-link):focus
.vpx-tour-team-rider-circle {
    background: #ffffff;
    border-color: #e30613;
    box-shadow:
        0 0 0 3px rgba(227, 6, 19, 0.18),
        0 12px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-6px) scale(1.08);
}

.vpx-tour-team-rider-link:not(.has-no-link):hover
.vpx-tour-team-rider-name,
.vpx-tour-team-rider-link:not(.has-no-link):focus
.vpx-tour-team-rider-name {
    color: #e30613;
}

.vpx-tour-team-rider-link:not(.has-no-link):hover
.vpx-tour-team-rider-number,
.vpx-tour-team-rider-link:not(.has-no-link):focus
.vpx-tour-team-rider-number {
    background-color: #111111;
    transform: scale(1.1);
}

.vpx-tour-team-rider-link:focus-visible {
    outline: 2px solid #e30613;
    outline-offset: 4px;
}

/* Aspect spécifique lorsqu'aucune URL n'est disponible */
.vpx-tour-team-rider-link.has-no-link {
    cursor: default;
    opacity: 0.72;
}

.vpx-tour-team-rider-link.has-no-link
.vpx-tour-team-rider-circle {
    background: #f3f3f3;
    border-color: #eeeeee;
    box-shadow:
        0 0 0 2px #dddddd,
        0 3px 8px rgba(0, 0, 0, 0.10);
}

.vpx-tour-team-rider-link.has-no-link
.vpx-tour-team-rider-number {
    background-color: #8a8a8a;
}

.vpx-tour-team-rider-link.has-no-link:hover
.vpx-tour-team-rider-circle,
.vpx-tour-team-rider-link.has-no-link:focus
.vpx-tour-team-rider-circle {
    transform: none;
}

/* Mobile : ouverture au toucher et affichage en grille */
@media screen and (max-width: 767px) {
    .vpx-tour-team-badge {
        width: 86px;
        height: 86px;
        padding: 6px;
    }

    .vpx-tour-team-card:hover {
        background: #ffffff;
        border-color: #e3e3e3;
    }

    .vpx-tour-team-card.is-open {
        background: transparent;
        border-color: transparent;
        box-shadow: none;
    }

    .vpx-tour-team-riders {
        position: relative;
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        margin-top: 10px;
        padding-top: 12px;
        border-top: 1px solid #e4e4e4;
        pointer-events: auto;
    }

    .vpx-tour-team-card.is-open .vpx-tour-team-riders {
        display: grid;
    }

    .vpx-tour-team-rider {
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        height: auto;
        margin: 0;
        opacity: 1;
        pointer-events: auto;
        transform: none !important;
    }

    .vpx-tour-team-rider-link {
        border-radius: 8px;
    }

    .vpx-tour-team-rider-circle {
        width: 100%;
        height: auto;
        min-height: 72px;
        border-radius: 8px;
    }

    .vpx-tour-team-rider-link:not(.has-no-link):hover
    .vpx-tour-team-rider-circle,
    .vpx-tour-team-rider-link:not(.has-no-link):focus
    .vpx-tour-team-rider-circle {
        transform: translateY(-2px) scale(1.02);
    }
}

@media screen and (max-width: 380px) {
    .vpx-tour-team-riders {
        grid-template-columns: 1fr;
    }
}