/* Explain: Styles for image galleries, slideshows, and interactive photo elements. */
/* Galleria fotografica: griglia a colonne e lightbox per ingrandire le immagini. */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(22, 36, 27, 0.84);
    backdrop-filter: blur(6px);
}

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

.gallery-lightbox-stage {
    display: flex;
    max-width: 100%;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox-stage img {
    width: auto;
    max-width: 100%;
    max-height: 86vh;
    border-radius: 1.75rem;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.gallery-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--background-color);
    color: var(--text-color);
    font-size: 1.15rem;
    transition: background 300ms ease;
}

.gallery-lightbox-close:hover {
    background: var(--surface-color);
}

/* Slideshow della pratica del Qi Gong: una foto alla volta, cambio automatico. */
.qigong-gallery {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: var(--surface-color);
}

.qigong-gallery-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.04);
    transition: opacity 1200ms ease, transform 7000ms ease;
}

.qigong-gallery-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.qigong-gallery-dot {
    display: inline-flex;
    width: 1.9rem;
    height: 2.75rem;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
}

.qigong-gallery-dot-mark {
    width: 0.7rem;
    height: 0.7rem;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    background: transparent;
    transition: background 300ms ease, transform 300ms ease;
}

.qigong-gallery-dot.is-active .qigong-gallery-dot-mark {
    background: var(--accent-color);
    transform: scale(1.22);
}

@media (prefers-reduced-motion: reduce) {
    .qigong-gallery-slide {
        transform: none;
        transition: opacity 400ms ease;
    }
}

/* Arco con due foto: una immagine alla volta, scorrimento da destra verso sinistra. */
.arch-frame-slideshow {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.arch-frame-slideshow .arch-frame-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 1.6rem clamp(1.1rem, 4%, 2rem);
    object-fit: contain;
    opacity: 0;
    transform: translateX(102%);
    transition: transform 1000ms ease, opacity 800ms ease;
    pointer-events: none;
}

.arch-frame-slideshow .arch-frame-slide.is-active {
    opacity: 1;
    transform: translateX(0);
}

.arch-frame-slideshow .arch-frame-slide.is-leaving {
    opacity: 0;
    transform: translateX(-102%);
}

/* Arco a scorrimento: la foto riempie tutto l'arco, una alla volta. */
.arch-frame-slideshow .arch-frame-slide.arch-slide-full {
    padding: 0;
    object-fit: cover;
}

@media (prefers-reduced-motion: reduce) {
    .arch-frame-slideshow .arch-frame-slide {
        transform: none;
        transition: opacity 500ms ease;
    }
}

/* Arco con tre foto sempre visibili: ognuna si apre e si sostituisce singolarmente. */
.arch-frame-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.45rem;
    width: 100%;
    height: 100%;
    padding: 0.45rem;
}

.arch-frame-stack img {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 1.1rem;
    background: var(--surface-color);
    object-fit: contain;
}

.arch-frame-stack img:first-child {
    grid-column: 1 / -1;
    grid-row: 1;
}

/* Foto del Qi Gong accanto al titolo: senza cornice, comparsa morbida in dissolvenza. */
.qigong-hero-frame {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: min(62vh, 525px);
    min-height: 400px;
}

.qigong-hero-slideshow {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.qigong-hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transform: scale(1.03);
    transition: opacity 1800ms ease, transform 9000ms ease;
    pointer-events: none;
}

.qigong-hero-slide.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

@media (max-width: 767px) {
    .qigong-hero-frame {
        max-width: 320px;
        height: 400px;
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qigong-hero-slide {
        transform: none;
        transition: opacity 500ms ease;
    }
}