/* ==========================================================
   GRENOBLE POKER PONTOIS
   COMPOSANT : BANDEAU DES PARTENAIRES

   Organisation :
   1. Conteneur principal
   2. Titre
   3. Partenaires mis en avant
   4. Carrousel
   5. Cartes partenaires
   6. Navigation
   7. Bouton tous les partenaires
   8. Responsive tablette
   9. Responsive mobile
   ========================================================== */


/* ==========================================================
   1. CONTENEUR PRINCIPAL
   ========================================================== */

.gp-partners {
    width: 100%;
    background: #ffffff;
    border-bottom: 1px solid var(--gp-border);
    font-family: var(--gp-font-primary);
}

.gp-partners-container {
    display: flex;
    align-items: center;
    gap: 22px;

    padding-top: 16px;
    padding-bottom: 16px;
}


/* ==========================================================
   2. TITRE DU BANDEAU
   ========================================================== */

.gp-partners-heading {
    display: flex;
    align-items: center;
    gap: 12px;

    flex: 0 0 190px;
}

.gp-partners-heading > .glyphicon {
    color: var(--gp-red);
    font-size: 25px;
}

.gp-partners-heading h2 {
    margin: 0 0 4px;

    color: var(--gp-text);
    font-size: 16px;
    font-weight: 800;
}

.gp-partners-heading p {
    margin: 0;

    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
}


/* ==========================================================
   3. PARTENAIRES MIS EN AVANT

   Partenaires toujours visibles :
   - Winamax
   - Ville de Pont de Claix

   Les partenaires sont définis dans le template Twig.
   ========================================================== */

.gp-partners-featured {
    display: flex;
    align-items: center;
    gap: 12px;

    flex-shrink: 0;
}

.gp-partners-featured-item {
    flex: 0 0 110px;

    width: 110px;
    height: 80px;
    padding: 10px;

    background: #ffffff;

    border: 2px solid var(--gp-red);
    border-radius: 8px;

    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.gp-partners-featured-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


/* ==========================================================
   4. CARROUSEL DES PARTENAIRES

   Le déplacement est géré par :
   public/assets/js/components/partner-carousel.js

   Animation :
   transform: translate3d()

   Le JavaScript gère :
   - Le défilement automatique
   - Les flèches de navigation
   - La boucle infinie
   ========================================================== */

/* Conteneur du carrousel */

.gp-partners-carousel {
    display: flex;
    align-items: center;
    gap: 10px;

    flex: 1 1 0;
    min-width: 0;
}

/* Fenêtre visible */

.gp-partners-viewport {
    position: relative;

    flex: 1;
    min-width: 0;

    overflow: hidden;
}

/* Piste contenant les partenaires */

.gp-partners-track {
    display: flex;
    gap: 8px;

    width: max-content;

    transform: translate3d(0, 0, 0);
    transition: transform 350ms ease;

    will-change: transform;
}


/* ==========================================================
   5. CARTES DES PARTENAIRES
   ========================================================== */

.gp-partners-item {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 90px;

    width: 90px;
    height: 76px;
    padding: 9px;

    background: #ffffff;

    border: 1px solid var(--gp-border);
    border-radius: 7px;

    text-decoration: none;

    transition:
        border-color 200ms ease,
        box-shadow 200ms ease;
}

/* Interaction avec les cartes */

.gp-partners-item:hover,
.gp-partners-item:focus {
    border-color: var(--gp-red);

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);

    text-decoration: none;
}

/* Logos */

.gp-partners-item img {
    display: block;

    max-width: 100%;
    max-height: 100%;

    width: auto;
    height: auto;

    object-fit: contain;
}

/* Nom du partenaire si aucun logo n'est disponible */

.gp-partners-item span {
    color: var(--gp-text);
    font-size: 11px;
    text-align: center;
}


/* ==========================================================
   5.1. SPÉCIFICITÉS DES PARTENAIRES MIS EN AVANT

   Ces règles sont placées après les cartes génériques
   pour conserver leurs dimensions et leur bordure rouge.
   ========================================================== */

.gp-partners-featured-item {
    flex: 0 0 110px;

    width: 110px;
    height: 80px;
    padding: 10px;

    border: 2px solid var(--gp-red);
    border-radius: 8px;
}

.gp-partners-featured-item:hover,
.gp-partners-featured-item:focus {
    border-color: var(--gp-red);
}


/* ==========================================================
   6. FLÈCHES DE NAVIGATION
   ========================================================== */

.gp-partners-arrow {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 25px;

    width: 25px;
    height: 40px;
    padding: 0;

    background: transparent;
    border: 0;

    color: var(--gp-text);
    font-size: 19px;

    cursor: pointer;
}

.gp-partners-arrow:hover,
.gp-partners-arrow:focus {
    color: var(--gp-red);
}


/* ==========================================================
   7. BOUTON : TOUS NOS PARTENAIRES

   Route Symfony :
   partner -> /partner/index
   ========================================================== */

.gp-partners-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    flex-shrink: 0;

    padding: 11px 13px;

    background: var(--gp-red);
    border-radius: 5px;

    color: #ffffff;

    font-size: 12px;
    font-weight: 700;
    text-decoration: none;

    white-space: nowrap;
}

.gp-partners-all:hover,
.gp-partners-all:focus {
    background: var(--gp-red-hover);
    color: #ffffff;
    text-decoration: none;
}


/* ==========================================================
   8. RESPONSIVE — TABLETTE

   Largeur : 768px à 1199px

   Organisation :
   - Titre
   - Partenaires mis en avant
   - Carrousel
   - Bouton tous les partenaires
   ========================================================== */

@media (min-width: 768px) and (max-width: 1199px) {

    /* Conteneur principal */

    .gp-partners-container {
        flex-wrap: wrap;
        gap: 15px;
    }

    /* Titre sur toute la largeur */

    .gp-partners-heading {
        flex: 1 0 100%;
    }

    /* Partenaires prioritaires centrés */

    .gp-partners-featured {
        flex: 0 0 100%;

        width: 100%;
        justify-content: center;
    }

    /* Carrousel sur toute la largeur */

    .gp-partners-carousel {
        flex: 1 1 100%;
    }


    /* Lien vers tous les partenaires — tablette */

.gp-partners-all {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;

    width: auto;
    margin-left: auto;
    padding: 0;

    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;

    color: var(--gp-red);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.gp-partners-all:hover,
.gp-partners-all:focus {
    background: transparent;
    color: var(--gp-red-hover);
    text-decoration: underline;
}
}

/* ==========================================================
   10. MOBILE — RÉORGANISATION DES PARTENAIRES

   Les partenaires prioritaires encadrent le carrousel.

   Desktop et tablette : aucune modification.
   ========================================================== */

@media (max-width: 767px) {

    .gp-partners-container > .gp-partners-heading {
        display: none;
    }


    /* Trois colonnes : gauche, carrousel, droite */

    .gp-partners-container {
        display: grid;
        grid-template-columns: 76px minmax(0, 1fr) 76px;
        column-gap: 6px;
        align-items: center;
    }

    /* Le conteneur des partenaires prioritaires
       ne participe plus directement à la grille. */

    .gp-partners-featured {
        display: contents;
    }

    /* Les partenaires prioritaires deviennent
       des éléments de la grille. */

    .gp-partners-featured-left {
        grid-column: 1;
        grid-row: 1;
    }

    .gp-partners-featured-right {
        grid-column: 3;
        grid-row: 1;
    }

    /* Dimensions des logos prioritaires */

    .gp-partners-featured-item {
        width: 76px;
        height: 66px;
        padding: 5px;
        min-width: 0;
    }

    /* Carrousel dans la colonne centrale */

    .gp-partners-carousel {
        grid-column: 2;
        grid-row: 1;
        width: 100%;
        min-width: 0;
        gap: 2px;
    }

    /* Cartes du carrousel */

    .gp-partners-carousel .gp-partners-item {
        flex: 0 0 62px;
        width: 62px;
        height: 62px;
        padding: 5px;
    }

    /* Flèches plus compactes */

    .gp-partners-arrow {
        flex: 0 0 14px;
        width: 14px;
        font-size: 14px;
    }

    /* Lien sur une deuxième ligne */

    .gp-partners-all {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-end;
    }


      .gp-partners-carousel .gp-partners-arrow {
        position: relative;
        z-index: 2;

        /* Dimensions visuelles conservées */
        flex: 0 0 14px;
        width: 14px;
        height: 36px;

        padding: 0;
        font-size: 14px;

        /* Facilite les interactions tactiles */
        touch-action: manipulation;
    }

    /* Agrandissement invisible de la zone tactile */

    .gp-partners-carousel .gp-partners-arrow::before {
        content: "";

        position: absolute;

        top: 50%;
        left: 50%;

        width: 30px;
        height: 44px;

        transform: translate(-50%, -50%);
    }


    /* ==========================================================
   MOBILE — GESTION DES GESTES TACTILES

   pan-y :
   - Autorise le défilement vertical de la page.
   - Réserve les gestes horizontaux au JavaScript.

   La règle est appliquée au viewport et à ses enfants
   pour éviter les conflits avec les liens des partenaires.
   ========================================================== */

  .gp-partners-viewport,
    .gp-partners-track,
    .gp-partners-track .gp-partners-item {
        touch-action: pan-y;
    }


    /* ==========================================================
   13. MOBILE — OPTIMISATION DES ESPACEMENTS VERTICAUX

   Objectifs :
   - Réduire la hauteur totale du bandeau.
   - Conserver les dimensions des logos.
   - Rapprocher le lien des partenaires du carrousel.
   - Ne pas modifier la tablette ni le desktop.
   ========================================================== */

     .gp-partners-container {
        row-gap: 8px;

        padding-top: 10px;
        padding-bottom: 10px;
    }

    .gp-partners-all {
        margin-top: 0;
    }

    /* ==========================================================
   14. MOBILE — OPTIMISATION DU BOUTON PARTENAIRES

   Objectifs :
   - Réduire légèrement la hauteur du bouton.
   - Conserver sa largeur actuelle.
   - Préserver une zone tactile confortable.
   - Ne pas modifier la tablette ni le desktop.
   ========================================================== */
     .gp-partners-all {
        min-height: 40px;

        padding: 8px 12px;

        font-size: 11px;
        line-height: 1.4;
    }

}
