/* core/gallery: Mosaic style (12-column rhythm 5/4/3 · 3/5/4, swipeable on mobile). */
.wp-block-gallery.has-nested-images.is-style-mosaic { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(10px, 1.2vw, 16px); }
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image {
	position: relative;
	width: auto !important;
	height: clamp(240px, 24vw, 350px);
	margin: 0 !important;
	overflow: hidden;
	border-radius: 14px;
	background: #cfc7b8;
}
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image:nth-child(-n+3) { height: clamp(280px, 31vw, 450px); }
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image:nth-child(6n+1),
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image:nth-child(6n+5) { grid-column: span 5; }
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image:nth-child(6n+2),
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image:nth-child(6n+6) { grid-column: span 4; }
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image:nth-child(6n+3),
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image:nth-child(6n+4) { grid-column: span 3; }
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image img { width: 100%; height: 100% !important; object-fit: cover; transition: transform 1.4s var(--ne-ease); }
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image:hover img { transform: scale(1.05); }
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image:has(figcaption)::before { display: none; }
.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image figcaption {
	position: absolute;
	left: 16px;
	right: auto;
	bottom: 16px;
	width: auto;
	max-width: calc(100% - 32px);
	max-height: none;
	margin: 0;
	padding: 8px 14px;
	overflow: visible;
	border-radius: 999px;
	background: rgba(12, 18, 28, .5);
	color: #fff;
	font-size: .84rem;
	text-align: left;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}
@media (max-width: 860px) {
	.wp-block-gallery.has-nested-images.is-style-mosaic {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: auto;
		/* Sideways only: a row that can also move up and down loses its snapping in iOS Safari. */
		overflow-y: hidden;
		/* Edge to edge: !important beats the auto margins of the constrained layout, so the first
		   photo lines up with the text and the row runs to both edges of the screen. */
		margin-inline: calc(-1 * var(--wp--style--root--padding-left, 16px)) !important;
		padding-inline: var(--wp--style--root--padding-left, 16px);
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--wp--style--root--padding-left, 16px);
		scrollbar-width: none;
	}
	.wp-block-gallery.has-nested-images.is-style-mosaic::-webkit-scrollbar { display: none; }
	.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image,
	.wp-block-gallery.has-nested-images.is-style-mosaic figure.wp-block-image:nth-child(-n+3) { flex: 0 0 78% !important; height: auto; aspect-ratio: 4 / 5; scroll-snap-align: start; }
}

/* Arrows under the row of photos (added by assets/js/frontend.js while the row scrolls) */
.ne-mosaic-nav { display: none; }
@media (max-width: 860px) {
	.ne-mosaic-nav { display: flex; justify-content: flex-end; gap: 10px; margin-block-start: 18px; }
	.ne-mosaic-nav__button {
		display: grid;
		place-items: center;
		box-sizing: border-box;
		width: 48px;
		height: 48px;
		padding: 0;
		border: 1px solid color-mix(in srgb, currentcolor 26%, transparent);
		border-radius: 50%;
		background: transparent;
		color: inherit;
		cursor: pointer;
		transition: background-color .25s, opacity .25s;
		-webkit-tap-highlight-color: transparent;
	}
	.ne-mosaic-nav__button .ne-icon { width: 18px; height: 18px; stroke-width: 2; }
	.ne-mosaic-nav__button:active { background: color-mix(in srgb, currentcolor 10%, transparent); }
	.ne-mosaic-nav__button[aria-disabled="true"] { opacity: .3; cursor: default; }
}
