/*
 * SiliconMayhem Gallery Pattern
 *
 * Uses the same preset tokens and section behaviour as the rest
 * of the theme. Gutenberg-selected colours intentionally override
 * these defaults.
 */

.gallery-section {
    box-sizing: border-box;
    color: var(--wp--preset--color--foreground);
}

.gallery-section:not(.has-background) {
    background: var(--wp--preset--color--background-light);
}

.gallery-section__header {
    margin-bottom: clamp(1.75rem, 3vw, 3rem);
}

.gallery-section .section-header__title:not(.has-text-color) {
    color: var(--wp--preset--color--foreground);
}

.gallery-section .section-header__description:not(.has-text-color) {
    color: var(--wp--preset--color--muted);
}

.gallery-section__gallery {
    margin-top: 0;
    margin-bottom: 0;
    gap: clamp(0.75rem, 1.6vw, 1.25rem);
}

.gallery-section__gallery.has-nested-images figure.wp-block-image {
    overflow: hidden;
    border-radius: 4px;
    background: var(--wp--preset--color--background);
}

.gallery-section__gallery.has-nested-images figure.wp-block-image img {
    width: 100%;
    transition:
        transform 180ms ease,
        opacity 180ms ease;
}

.gallery-section__gallery.has-nested-images figure.wp-block-image:hover img {
    transform: scale(1.015);
}

.gallery-section__gallery figcaption {
    color: var(--wp--preset--color--muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

/*
 * Empty native Gallery blocks show WordPress's own media
 * placeholder in the editor. No custom image placeholder markup
 * is needed, so inserted images remain fully native/editable.
 */

/* Dark-surface user overrides retain readable inherited text. */
.gallery-section.has-background {
    color: inherit;
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
    .gallery-section__gallery.has-nested-images figure.wp-block-image img {
        transition: none;
    }

    .gallery-section__gallery.has-nested-images figure.wp-block-image:hover img {
        transform: none;
    }
}
