/*
 * Gallery: every image keeps its column width, so a short last row is not
 * stretched (core lets last-row images grow to fill the row). The selector
 * matches core's own width rule, including its :not(#individual-image).
 */
.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) {
	flex-grow: 0;
}

/*
 * Cropped galleries: uniform 4:3 tiles (the old theme's grid), so a row with a
 * single image or images of other proportions keeps the same tile size.
 */
.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) {
	align-self: flex-start;
	aspect-ratio: 4 / 3;
}

/* Product gallery slot (single-prodotto): space before the showroom band. */
.wp-block-gallery.product-gallery {
	margin-block-end: var(--wp--preset--spacing--section);
}

/*
 * Product gallery: no "enlarge" icon on hover; the photo zooms in gently
 * inside its tile instead, and a click still opens the lightbox. Core's
 * enlarge button stays in the page for keyboard users and shows only when
 * it has keyboard focus.
 */
.wp-block-gallery.product-gallery figure.wp-block-image {
	overflow: hidden;
}

.wp-block-gallery.product-gallery figure.wp-block-image img {
	cursor: zoom-in;
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {

	.wp-block-gallery.product-gallery figure.wp-block-image:hover img {
		transform: scale(1.06);
	}
}

.wp-block-gallery.product-gallery .lightbox-trigger:not(:focus-visible) {
	opacity: 0;
}
