/* ==========================================================================
   Gallery — diagonal rotated collage of three animated marquee rows.
   Rows 1 & 3 move left → right, row 2 moves right → left. Seamless loop.
   ========================================================================== */

.section--gallery {
	padding: 0;
}

.gallery {
	position: relative;
	width: 100vw;
	left: 50%;
	transform: translateX(-50%);
	height: clamp(360px, 41vw, 657px);
	background: var(--beige);
	overflow: hidden;
}

.gallery__rows {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-28deg) scale(1.15);
	transform-origin: center;
	display: flex;
	flex-direction: column;
	gap: 32px;
	width: max-content;
}

/* Track holds two identical copies of the row; translating loops it. */
.gallery__track {
	display: flex;
	gap: 32px;
	width: max-content;
	will-change: transform;
	animation: hass-marquee var(--marquee-duration, 40s) linear infinite;
}

/* Row scrolls so content moves right → left. */
.marquee--rtl .gallery__track {
	animation-direction: normal;
}

/* Reverse so content moves left → right. */
.marquee--ltr .gallery__track {
	animation-direction: reverse;
}

@keyframes hass-marquee {
	from {
		transform: translateX(0);
	}
	to {
		/* One copy = half the track minus half a gap (32px/2), so it loops seamlessly. */
		transform: translateX(calc(-50% - 16px));
	}
}

.gallery__item {
	flex: none;
	width: clamp(170px, 18vw, 300px);
	height: clamp(220px, 24vw, 400px);
}

.gallery__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gallery__scrim {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.33);
	pointer-events: none;
}

/* Accessibility: stop motion for users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.gallery__track {
		animation: none;
	}
}
