/*
 * Glowence Image Drift.
 *
 * Each column holds a track with its image set printed twice. Every set
 * carries one gap below it, so moving the track by exactly 50% lands the
 * second set where the first one started and the loop never jumps.
 * Visible columns per screen size come from data-show-{d|t|m|s}.
 */

.glowence-drift {
	--glw-drift-height: 50.9375rem;
	--glw-drift-gap: 1rem;
	--glw-drift-img-h: 17rem;
	--glw-drift-img-radius: 1rem;
	--glw-drift-col-radius: 2rem;
	--glw-drift-fade: var(--e-global-color-glw_soft_gray, #f1eeec);

	position: relative;
	display: flex;
	gap: var(--glw-drift-gap);
	width: 100%;
	height: var(--glw-drift-height);
	overflow: hidden;
	border-radius: var(--glw-drift-col-radius);
}

.glowence-drift__col {
	display: flex;
	flex: 1 1 0;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	overflow: hidden;
	border-radius: var(--glw-drift-col-radius);
}

.glowence-drift__track {
	display: flex;
	flex-direction: column;
	will-change: transform;
}

.glowence-drift__col[data-direction="down"] .glowence-drift__track {
	transform: translateY(-50%);
}

.glowence-drift__set {
	display: flex;
	flex-direction: column;
	gap: var(--glw-drift-gap);
	padding-bottom: var(--glw-drift-gap);
}

.glowence-drift .glowence-drift__img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: var(--glw-drift-img-h);
	border-radius: var(--glw-drift-img-radius);
	object-fit: cover;
}

.glowence-drift__fade {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background-image: linear-gradient(180deg, var(--glw-drift-fade) 4%, transparent 20%, transparent 80%, var(--glw-drift-fade) 96%);
}

/* Visible columns: desktop. */
.glowence-drift[data-show-d="1"] .glowence-drift__col:nth-child(n+2),
.glowence-drift[data-show-d="2"] .glowence-drift__col:nth-child(n+3),
.glowence-drift[data-show-d="3"] .glowence-drift__col:nth-child(n+4),
.glowence-drift[data-show-d="4"] .glowence-drift__col:nth-child(n+5),
.glowence-drift[data-show-d="5"] .glowence-drift__col:nth-child(n+6) {
	display: none;
}

@media (max-width: 991px) {
	.glowence-drift {
		--glw-drift-height: 30rem;
		--glw-drift-img-h: 12rem;
		--glw-drift-col-radius: 1.7rem;
	}

	.glowence-drift[data-show-t] .glowence-drift__col:nth-child(n) {
		display: flex;
	}

	.glowence-drift[data-show-t="1"] .glowence-drift__col:nth-child(n+2),
	.glowence-drift[data-show-t="2"] .glowence-drift__col:nth-child(n+3),
	.glowence-drift[data-show-t="3"] .glowence-drift__col:nth-child(n+4),
	.glowence-drift[data-show-t="4"] .glowence-drift__col:nth-child(n+5),
	.glowence-drift[data-show-t="5"] .glowence-drift__col:nth-child(n+6) {
		display: none;
	}
}

@media (max-width: 767px) {
	.glowence-drift {
		--glw-drift-gap: 0.75rem;
		--glw-drift-img-h: 10rem;
		--glw-drift-col-radius: 1.5rem;
	}

	.glowence-drift[data-show-m] .glowence-drift__col:nth-child(n) {
		display: flex;
	}

	.glowence-drift[data-show-m="1"] .glowence-drift__col:nth-child(n+2),
	.glowence-drift[data-show-m="2"] .glowence-drift__col:nth-child(n+3),
	.glowence-drift[data-show-m="3"] .glowence-drift__col:nth-child(n+4),
	.glowence-drift[data-show-m="4"] .glowence-drift__col:nth-child(n+5),
	.glowence-drift[data-show-m="5"] .glowence-drift__col:nth-child(n+6) {
		display: none;
	}
}

@media (max-width: 479px) {
	.glowence-drift {
		--glw-drift-height: 23.5rem;
		--glw-drift-img-h: 8rem;
		--glw-drift-img-radius: 0.75rem;
		--glw-drift-col-radius: 1rem;
	}

	.glowence-drift[data-show-s] .glowence-drift__col:nth-child(n) {
		display: flex;
	}

	.glowence-drift[data-show-s="1"] .glowence-drift__col:nth-child(n+2),
	.glowence-drift[data-show-s="2"] .glowence-drift__col:nth-child(n+3),
	.glowence-drift[data-show-s="3"] .glowence-drift__col:nth-child(n+4),
	.glowence-drift[data-show-s="4"] .glowence-drift__col:nth-child(n+5),
	.glowence-drift[data-show-s="5"] .glowence-drift__col:nth-child(n+6) {
		display: none;
	}
}
