/* Fond de la page */
body {
    background-color: #121212; /* Fond noir par défaut */
    /* Utilisez background-color: #0a1a2a; pour un bleu foncé */
    color: #e0e0e0;
    font-family: Arial, sans-serif;
    padding: 1rem;
    margin: 0;
    overflow-x: hidden;
}

/* Galerie */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.gallery-item {
    position: relative;
    text-align: center;
    background-color: rgba(20, 20, 20, 0.5);
    padding: 0.5rem;
    border-radius: 4px;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.gallery img {
    max-width: 100%;
    max-height: 120px;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    cursor: pointer;
}

.gallery-caption {
    color: #e0e0e0;
    font-size: 0.7rem; /* Taille de la police des imagettes (modifiable ici) */
    text-align: center;
    padding: 0.3rem;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 0 0 4px 4px;
    margin-top: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

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

/* Classe pour l'image agrandie */
.modal-content img.enlarged {
    max-width: 100%;
    max-height: 100vh;
}

.modal-caption {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1.5rem; /* Taille de la légende sur la photo (modifiable ici) */
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    z-index: 2;
}

/* Flèches et bouton de fermeture */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    color: white;
    cursor: pointer;
    user-select: none;
    z-index: 2;
}

.prev {
    left: 10%;
}

.next {
    right: 10%;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
}

/* Cases à cocher */
.checkbox-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(20, 20, 20, 0.8);
    padding: 10px;
    border-radius: 5px;
    display: flex;
    gap: 15px;
    z-index: 100;
}

.checkbox-container label {
    color: #e0e0e0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.checkbox-container input[type="checkbox"] {
    margin-right: 5px;
    accent-color: #4CAF50;
}

/* Bouton Agrandir */
.enlarge-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    z-index: 2;
}

