/* Galerie photos — page publique */

.galerie-section [hidden],
.galerie-lightbox[hidden],
#galerie-back[hidden] {
    display: none !important;
}

.galerie-section {
    padding-top: 120px;
}

.galerie-back {
    margin-bottom: 24px;
}

.galerie-empty {
    text-align: center;
    padding: 40px 20px;
    color: #777;
}

/* --- Grille d'albums --- */
.galerie-albums {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 22px;
}

.galerie-album-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    font: inherit;
    transition: transform .15s ease, box-shadow .15s ease;
}
.galerie-album-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.galerie-album-cover {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    background-color: #e9e9e9;
    background-size: cover;
    background-position: center;
    color: #bbb;
    font-size: 2.4rem;
}
.galerie-album-count {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.78rem;
    padding: 3px 9px;
    border-radius: 999px;
}
.galerie-album-title {
    font-family: var(--font-heading, 'Oswald', sans-serif);
    font-size: 1.05rem;
    font-weight: 600;
    padding: 12px 14px 2px;
    color: #222;
}
.galerie-album-date {
    padding: 0 14px 14px;
    color: #888;
    font-size: 0.85rem;
    text-transform: capitalize;
}

/* --- En-tête d'album --- */
.galerie-album-head {
    margin-bottom: 22px;
}
.galerie-album-head h2 {
    font-family: var(--font-heading, 'Oswald', sans-serif);
    color: var(--primary-color, #e30613);
    margin: 0 0 4px;
}
.galerie-album-desc {
    color: #555;
    max-width: 640px;
}

/* --- Mosaïque de photos --- */
.galerie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.galerie-thumb {
    position: relative;
    display: block;
    padding: 0;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    background: #eee;
}
.galerie-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}
.galerie-thumb:hover img {
    transform: scale(1.05);
}
.galerie-thumb-legende {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px 10px 8px;
    color: #fff;
    font-size: 0.8rem;
    text-align: left;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
    opacity: 0;
    transition: opacity .2s ease;
}
.galerie-thumb:hover .galerie-thumb-legende,
.galerie-thumb:focus-visible .galerie-thumb-legende {
    opacity: 1;
}

/* --- Lightbox --- */
.galerie-lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-figure {
    margin: 0;
    max-width: 90vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-figure img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}
.lightbox-figure figcaption {
    color: #eee;
    margin-top: 12px;
    font-size: 0.95rem;
    text-align: center;
    max-width: 80vw;
}
.lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: none;
    border: 0;
    color: #fff;
    font-size: 2.6rem;
    line-height: 1;
    cursor: pointer;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.12);
    border: 0;
    color: #fff;
    font-size: 1.8rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
}
.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

@media (max-width: 768px) {
    .galerie-section { padding-top: 100px; }
    .galerie-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .lightbox-nav { width: 42px; height: 42px; font-size: 1.4rem; }
    .lightbox-close { font-size: 2.2rem; top: 10px; right: 14px; }
}
