/**
 * Dynamische SEO-Fotogalerie – ergänzt das SAUNAEXPERT-Layout
 * (bestehende .gallery-Section bleibt erhalten, Grid nutzt .seo-gallery)
 */

.gallery .seo-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4rem 2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gallery .seo-gallery__item {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.gallery .seo-gallery__link {
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.16);
    border-radius: 2.4rem;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #fff;
    cursor: pointer;
    transition: box-shadow 0.25s ease;
}

.gallery .seo-gallery__link:hover,
.gallery .seo-gallery__link:focus-visible {
    box-shadow: 0 0.8rem 2.4rem rgba(0, 0, 0, 0.12);
    outline: none;
}

.gallery .seo-gallery__link:hover .seo-gallery__thumb,
.gallery .seo-gallery__link:focus-visible .seo-gallery__thumb {
    transform: scale(1.05);
}

.gallery .seo-gallery__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.gallery .seo-gallery__caption {
    margin-top: 1.2rem;
    font-size: 1.4rem;
    line-height: 1.4;
    color: rgba(0, 0, 0, 0.72);
    text-align: center;
}

.gallery .seo-gallery__empty {
    font-size: 1.6rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.75);
    max-width: 60rem;
}

.gallery .seo-gallery__empty code {
    font-size: 0.95em;
    background: rgba(0, 0, 0, 0.06);
    padding: 0.1em 0.4em;
    border-radius: 0.4rem;
}

/* Tablet: 2 Spalten */
@media (max-width: 997px) {
    .gallery .seo-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem 2rem;
    }
}

/* Handy: 1 Spalte */
@media (max-width: 599px) {
    .gallery .seo-gallery {
        grid-template-columns: 1fr;
        gap: 2.4rem;
    }

    .gallery .title-block {
        margin-bottom: 4rem;
    }
}

/* —— Lightbox —— */
.seo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seo-lightbox[hidden] {
    display: none !important;
}

.seo-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 11, 11, 0.88);
    cursor: pointer;
}

.seo-lightbox__panel {
    position: relative;
    z-index: 1;
    width: min(92vw, 120rem);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem 4.8rem 2rem;
    box-sizing: border-box;
}

.seo-lightbox__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-height: calc(92vh - 8rem);
    overflow: hidden;
}

.seo-lightbox__image {
    max-width: 100%;
    max-height: calc(92vh - 8rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.8rem;
    box-shadow: 0 1.6rem 4.8rem rgba(0, 0, 0, 0.45);
}

.seo-lightbox__counter {
    margin-top: 1.6rem;
    color: #fff;
    font-size: 1.6rem;
    letter-spacing: 0.02em;
}

.seo-lightbox__close {
    position: absolute;
    top: 0;
    right: 0;
    width: 4.4rem;
    height: 4.4rem;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #000;
    font-size: 2.8rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.seo-lightbox__close:hover,
.seo-lightbox__close:focus-visible {
    background: #f3efea;
    outline: none;
}

.seo-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 4.8rem;
    height: 4.8rem;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    font-size: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.seo-lightbox__nav:hover,
.seo-lightbox__nav:focus-visible {
    background: #fff;
    outline: none;
    transform: translateY(-50%) scale(1.05);
}

.seo-lightbox__nav--prev {
    left: 0;
}

.seo-lightbox__nav--next {
    right: 0;
}

@media (max-width: 599px) {
    .seo-lightbox__panel {
        padding: 1rem 3.6rem 1.6rem;
    }

    .seo-lightbox__nav {
        width: 3.6rem;
        height: 3.6rem;
        font-size: 1.6rem;
    }

    .seo-lightbox__close {
        width: 3.6rem;
        height: 3.6rem;
        font-size: 2.2rem;
    }
}

body.seo-lightbox-open {
    overflow: hidden;
}
