/* viewer.css */

body {
    font-family: Arial, sans-serif;
    background-color: #f1f1f1;
    margin: 0;
    padding: 0;
}

.gallery-container {
    padding: 20px;
}

.gallery-header {
    text-align: center;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Pour un espacement équitable entre les images */
    gap: 20px;
}

.image-item {
    width: 400px; /* Chaque image occupe environ la moitié de la ligne */
    margin: 10px 0; /* Ajoute un peu d'espace vertical entre les images */
}

.gallery-image {
    width: 400px;
    height: 300px; /* Hauteur fixe pour garantir une taille uniforme */
    object-fit: cover; /* Garantit que l'image couvre l'espace sans distorsion */
    cursor: pointer;
    transition: transform 0.2s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
}

.fullscreen-container {
    display: none;
    position: fixed;
    top: 0;
    left: 200px;
    width: 70%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#fullscreen-image {
    width: 90vw !important;  /* 90% de la largeur de l’écran */
    height: 90vh !important; /* Hauteur ajustée automatiquement */
    max-width: 100vw !important; /* Pour éviter qu’elle dépasse l’écran */
    max-height: 100vh !important; /* Pour éviter qu’elle dépasse l’écran */
    object-fit: contain !important; /* Évite toute déformation */
    display: block;
    margin: auto;
}

.fullscreen-container.active {
    display: flex !important; /* Assure que le conteneur apparaît */
}

#fullscreen-image.active {
    width: 90vw !important;
    height: auto !important;
}



.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}


.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: white;
    cursor: pointer;
    user-select: none;
    z-index: 10000;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.left-btn {
    left: 30px;
}

.right-btn {
    right: 30px;
}


/* Ajustements pour les écrans moyens et petits */
@media (max-width: 1200px) {
    .fullscreen-container {
        left: 50px;
        width: 90%;
    }
    
    #fullscreen-image {
        width: 80vw !important;
        height: 80vh !important;
    }

    .nav-btn {
        font-size: 40px;
        padding: 8px;
    }
    
    .close-btn {
        font-size: 25px;
    }
}

@media (max-width: 768px) {
    .fullscreen-container {
        left: 0;
        width: 100%;
    }

    #fullscreen-image {
        width: 95vw !important;
        height: auto !important;
    }

    .nav-btn {
        font-size: 30px;
        padding: 5px;
    }

    .close-btn {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .nav-btn {
        font-size: 25px;
        padding: 5px;
    }

    .close-btn {
        font-size: 18px;
    }
}