/* Styles scoped to /test lightGallery experiment. */
#test-lightgallery {
    margin-top: 0.5rem;
}

#test-lightgallery .lg-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    align-items: start;
}

#test-lightgallery .lg-photo-grid.lg-justified-active {
    display: block;
}

#test-lightgallery .lg-photo-item {
    display: block;
    width: 100%;
    text-decoration: none;
    color: inherit;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 12px var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

#test-lightgallery .lg-photo-grid.lg-justified-active .lg-photo-item {
    display: inline-block;
    width: auto;
}

#test-lightgallery .lg-photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--shadow-md);
    filter: saturate(1.03);
}

#test-lightgallery .lg-photo-item img {
    display: block;
    width: 100%;
    height: auto;
    background: rgba(0,0,0,0.06);
    object-fit: contain;
}

#test-lightgallery .lg-photo-grid.lg-justified-active .lg-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Keep /test lightbox toolbar minimal: close + fullscreen (+ autoplay via progress). */
.lg-outer [id^="lg-maximize-"] {
    display: none !important;
}

.lg-outer [id^="lg-actual-size-"] {
    display: none !important;
}

/* Autoplay icon state: show play by default, pause while slideshow is active. */
.lg-outer .lg-autoplay-button .lg-ci {
    display: none;
}

.lg-outer .lg-autoplay-button .lg-ci-autoplay-play {
    display: inline-block;
}

.lg-outer.lg-show-autoplay .lg-autoplay-button .lg-ci-autoplay-play {
    display: none;
}

.lg-outer.lg-show-autoplay .lg-autoplay-button .lg-ci-autoplay-pause {
    display: inline-block;
}

/* Fullscreen icon state: show enter icon normally, exit icon only in fullscreen. */
.lg-outer .lg-fullscreen .lg-ci {
    display: none;
}

.lg-outer .lg-fullscreen .lg-ci-fullscreen {
    display: inline-block;
}

.lg-outer.lg-fullscreen-on .lg-fullscreen .lg-ci-fullscreen {
    display: none;
}

.lg-outer.lg-fullscreen-on .lg-fullscreen .lg-ci-fullscreen-exit {
    display: inline-block;
}

@media (max-width: 900px) {
    #test-lightgallery .lg-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

@media (max-width: 540px) {
    #test-lightgallery .lg-photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}
