/* --------------------------------------------
----                                       ----
----  EN MODE DE FONCTIONNEMENT TELEPHONE  ----
----                                       ----
-----------------------------------------------
*/

@media screen and (max-width: 767.98px) {
    .titre h1 {
        font-size: 1.8em;
        text-align: center;
        color: #213c54;
        margin-bottom: 20px;
    }

    .affichage {
        width: 100%;
        padding: 0;
    }

    .carousel-wrapper {
        position: relative;
        width: 100%;
        height: 250px;
        /* Hauteur fixe pour le carrousel */
        display: flex;
        align-items: center;
        overflow: hidden;
    }

    .carousel {
        display: flex;
        align-items: center;
        /* Aligne verticalement les slides */
        gap: 15px;
        list-style: none;
        padding: 0 30px;
        /* Espace sur les côtés pour voir les images adjacentes */
        margin: 0;
        transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
        height: 100%;
    }

    .slide {
        flex-shrink: 0;
        width: 180px;
        /* Largeur des slides */
        height: 180px;
        /* Hauteur des slides */
        border-radius: 10px;
        overflow: hidden;
        transition: transform 0.5s ease, opacity 0.5s ease;
        transform: scale(0.8);
        /* Les slides non actives sont plus petites */
        opacity: 0.6;
    }

    .slide.active {
        transform: scale(1);
        /* La slide active est à sa taille normale */
        opacity: 1;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    }

    .slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        cursor: pointer;
    }

    .carousel-control {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background-color: rgba(0, 0, 0, 0.5);
        border: none;
        cursor: pointer;
        z-index: 10;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: background-color 0.3s;
    }

    .carousel-control:hover {
        background-color: rgba(0, 0, 0, 0.8);
    }

    .carousel-control img {
        width: 40px;
        height: 30px;
        filter: invert(1);
    }

    .prev {
        left: 10px;
        padding-right: 3px;
    }

    .next {
        right: 10px;
        padding-left: 3px;
    }

    /* Styles de la Lightbox (inchangés) */
    .lightbox {
        display: none;
        position: fixed;
        z-index: 1000;
        padding-top: 60px;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0, 0, 0, 0.9);
        text-align: center;
    }

    .lightbox-content {
        margin: auto;
        display: block;
        max-width: 90%;
        max-height: 80vh;
        object-fit: contain;
    }

    .lightbox-caption {
        margin: 15px auto;
        width: 80%;
        max-width: 700px;
        text-align: center;
        color: #ccc;
        padding: 10px 0;
        font-size: 1.2em;
    }

    .close-lightbox {
        position: absolute;
        top: 15px;
        right: 35px;
        color: #f1f1f1;
        font-size: 40px;
        font-weight: bold;
        transition: 0.3s;
        cursor: pointer;
    }

    .close-lightbox:hover,
    .close-lightbox:focus {
        color: #bbb;
        text-decoration: none;
        cursor: pointer;
    }
}

/* -----------------------------------------
----                                    ----
----  EN MODE DE FONCTIONNEMENT PC      ----
----                                    ----
--------------------------------------------
*/

@media screen and (min-width: 768px) {
    .titre h1 {
        font-size: 2.5em;
        text-align: center;
        color: #213c54;
        margin-bottom: 40px;
    }

    .affichage {
        width: 100%;
        max-width: 900px;
        /* Le carrousel ne prend plus tout l'écran */
        padding: 0 20px;
    }

    .carousel-wrapper {
        position: relative;
        width: 100%;
        height: 400px;
        /* Hauteur fixe pour le carrousel */
        display: flex;
        align-items: center;
        overflow: hidden;
    }

    .carousel {
        display: flex;
        align-items: center;
        gap: 20px;
        /* Espace entre les images */
        list-style: none;
        padding: 0;
        margin: 0;
        height: 100%;
        /* Le padding sera calculé par le JS pour le centrage */
        transition: transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    }

    .slide {
        flex-shrink: 0;
        width: 300px;
        /* Largeur des slides */
        height: 300px;
        /* Hauteur des slides */
        border-radius: 15px;
        overflow: hidden;
        transition: transform 0.5s ease, opacity 0.5s ease;
        transform: scale(0.8);
        /* Les slides non actives sont plus petites */
        opacity: 0.7;
    }

    .slide.active {
        transform: scale(1.1);
        /* La slide active est plus grande */
        opacity: 1;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    }

    .slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        cursor: pointer;
    }

    .carousel-control {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background-color: rgba(0, 0, 0, 0.5);
        border: none;
        cursor: pointer;
        z-index: 10;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: background-color 0.3s;
    }

    .carousel-control:hover {
        background-color: rgba(0, 0, 0, 0.8);
    }

    .carousel-control img {
        width: 40px;
        height: 30px;
        filter: invert(1);
    }

    .prev {
        left: 30px;
        padding-right: 3px;
    }

    .next {
        right: 30px;
        padding-left: 3px;
    }

    /* Styles de la Lightbox (inchangés) */
    .lightbox {
        display: none;
        position: fixed;
        z-index: 1000;
        padding-top: 60px;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0, 0, 0, 0.9);
        text-align: center;
    }

    .lightbox-content {
        margin: auto;
        display: block;
        max-width: 90%;
        max-height: 85vh;
        object-fit: contain;
    }

    .lightbox-caption {
        margin: 15px auto;
        width: 80%;
        max-width: 700px;
        text-align: center;
        color: #ccc;
        padding: 10px 0;
        font-size: 1.5em;
    }

    .close-lightbox {
        position: absolute;
        top: 15px;
        right: 35px;
        color: #f1f1f1;
        font-size: 40px;
        font-weight: bold;
        transition: 0.3s;
        cursor: pointer;
    }

    .close-lightbox:hover,
    .close-lightbox:focus {
        color: #bbb;
        text-decoration: none;
        cursor: pointer;
    }
}