/* Explain: Styling for the photo gallery thumbnails and lightbox viewer. */
/* Galerie photos — vignettes et visionneuse */

.gallery-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 1.6rem;
    background: var(--surface-color);
    cursor: pointer;
    transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.gallery-thumb img {
    display: block;
    height: 100%;
    width: 100%;
    object-fit: cover;
    transition: transform 600ms ease;
}

.gallery-thumb:hover {
    border-color: var(--accent-color);
    box-shadow: 0 22px 60px rgba(31, 46, 35, 0.14);
    transform: translateY(-4px);
}

.gallery-thumb:hover img {
    transform: scale(1.06);
}

.gallery-thumb:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 3px;
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 24, 18, 0.9);
    padding: 1rem;
    backdrop-filter: blur(10px);
}

.gallery-lightbox.is-open {
    display: flex;
}

.gallery-lightbox-inner {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 1100px;
    align-items: center;
    justify-content: center;
    padding: 0 3.25rem;
}

.gallery-lightbox-figure {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

.gallery-lightbox-img {
    height: auto;
    width: auto;
    max-height: 78vh;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1.2rem;
    object-fit: contain;
}

.gallery-lightbox-caption {
    margin: 0;
    color: #ffffff;
    font-size: 0.95rem;
    text-align: center;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 300ms ease, border-color 300ms ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.3);
}

.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.gallery-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
}

.gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.gallery-lightbox-prev {
    left: 0.25rem;
}

.gallery-lightbox-next {
    right: 0.25rem;
}

@media (max-width: 640px) {
    .gallery-lightbox-inner {
        padding: 0 2.9rem;
    }

    .gallery-lightbox-close,
    .gallery-lightbox-nav {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .gallery-lightbox-img {
        max-height: 70vh;
    }
}