/*----------------carroussel-------------*/

.grid-container {
    display: grid;
    grid-gap: 5px;
}

.grid-item {
    width: 100%;
    padding-top: 120%; /* Pour garder un aspect carré */
    background-size: cover;
    background-position: center;
}

.grid-item:hover{
    opacity: 1;
    padding-top: 100%; /* Pour garder un aspect carré */
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.date-container {
    max-width: 92.5%;
    margin-left: auto;
    margin-right: auto;
    padding-top: 2%;
    padding-bottom: 0.5%;
}

/*-------------fullscreenviewer-------------*/

#image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none; /* caché par défaut */
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* assure que l'image est entièrement visible */
}

#image-viewer button {
    position: absolute;
    cursor: pointer;
    padding: 15px 23px;
    z-index: 1001;
}


#close-viewer {
    position: absolute;
    top: 20px;
    right: 2%;
    font-size: 30px;
    text-align: center;
    color: white;
    cursor: pointer;
}

#close-viewer:after {
    content: '⟵'; /* Contenu par défaut (exemple : flèche) */
    /* autres styles nécessaires */
}

#left-button {
    left: 2%;

}

#right-button {
    right: 2%;
}





@media (min-width: 769px) {


    .grid-container {
        margin-left: auto;
        margin-right: auto;
        max-width: 95%;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .grid-item.special {
        grid-column: span 2; /* S'étend sur 2 colonnes */
        grid-row: span 2; /* S'étend sur 2 lignes */
    }

    .grid-item {
        opacity: 0.6;
    }

    .grid-item:hover {
        opacity: 1;
    }

    #image-viewer img {
        max-width: 80%;
        max-height: auto;
        transition: transform 0.2s ease-in-out;
    }

    #image-viewer button {
        justify-content: center;
    }

    #close-viewer {
        content: 'X';
        top: 3%;
        right: 2%;
        font-size: 30px;      
    }
    
    #close-viewer:after {
        content: '✖'; /* Contenu pour les écrans de bureau (exemple : croix) */
    }

    #info-viewer {
        display: none;
    }

    #right-button {
        top: 50%;
    }

    #left-button {
        top: 50%;
    }

    

}


/* Pour les écrans mobiles */
@media (max-width: 768px) {

    .grid-container {
        max-width: 92.5%;
        align-items: center;
        margin-left: auto;
        margin-right: auto;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .grid-item {
        width: 100%;
        padding-top: 100%; /* Pour garder un aspect carré */
    }

    #image-viewer img {
        opacity: 1;
        padding-bottom: 10%;
        max-width: 100%;
        max-height: auto;
        transition: transform 0.2s ease-in-out;
    }

    #image-viewer button {
        padding: 2.5% 2%;
    }

    #close-viewer {
        left: 2%;
        top: 1.5%;
        font-size: 5vw;
        max-width: 10%;
    }

    #close-viewer:after {
        content: '\003c'; /* Contenu pour les écrans de bureau (exemple : croix) */
    }

    #info-viewer {
        opacity: 0.6;
        padding: 1% 2%;
        top: 87%;
        font-size: 5vw;
        width: 95%;    
    }

    #left-button {
        display: none;
    
    }
    
    #right-button {
        display: none;
    }

    .date-container {
        margin-bottom: 1%;
    }
 
}