/* ============================================================
   Bilderband „Galerie“ (Startseite)
   Endloser Dauerlauf per CSS: jedes Bild braucht ca. 3 s, um
   an einem Punkt vorbeizuziehen. Mausüber hält das Band an.
   ============================================================ */

.artifx-gallery {
	padding-block: 2rem;
	overflow-x: clip;
}

.artifx-gallery__title {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin: 0 auto 1rem;
	padding-inline: 1rem;
}

.artifx-gallery__band {
	--gallery-count: 7;        /* Anzahl Bilder pro Gruppe */
	--gallery-per-image: 3s;   /* Zeit, bis ein Bild um eine Bildbreite gewandert ist */
	height: 260px;
	overflow: hidden;
}

/* Zwei identische Gruppen nebeneinander. Verschoben wird um genau eine Gruppe,
   danach steht das Band wieder am Anfang: die Schleife ist nicht sichtbar. */
.artifx-gallery__track {
	display: flex;
	width: max-content;
	height: 100%;
	animation: artifx-gallery-scroll calc(var(--gallery-count) * var(--gallery-per-image)) linear infinite;
}

.artifx-gallery__band:hover .artifx-gallery__track {
	animation-play-state: paused;
}

.artifx-gallery__set {
	display: flex;
	gap: 16px;
	flex-shrink: 0;
	height: 100%;
	margin: 0;
	padding: 0 16px 0 0; /* gleicher Abstand wie zwischen den Bildern, damit die Gruppen gleich lang sind */
	list-style: none;
}

.artifx-gallery__item {
	flex-shrink: 0;
	width: 360px;
	height: 100%;
	margin: 0;
}

.artifx-gallery__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 6px;
}

@keyframes artifx-gallery-scroll {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

@media (max-width: 782px) {
	.artifx-gallery__band {
		height: 160px;
	}

	.artifx-gallery__set {
		gap: 12px;
		padding-right: 12px;
	}

	.artifx-gallery__item {
		width: 240px;
	}
}

/* Bewegung reduzieren: Band steht still und lässt sich seitlich scrollen. */
@media (prefers-reduced-motion: reduce) {
	.artifx-gallery__track {
		animation: none;
	}

	.artifx-gallery__band {
		overflow-x: auto;
	}
}
