/**
 * Auz Logo Marquee
 *
 * The track holds several identical copies of the logo set and travels by
 * exactly one set per iteration, so the loop is seamless.
 *
 * Every logo carries its own right margin rather than the flex `gap` property.
 * With `gap` the last logo in the track has no trailing space, the track ends
 * up one gap short of a whole number of sets, and the band jumps on each loop.
 *
 * Sizes arrive as custom properties set inline by the shortcode. An inline
 * custom property cannot be overridden from this file, so the breakpoint
 * changes --auz-mq-scale instead and every size is multiplied by it. Width and
 * spacing scale together, which keeps the one-set shift exact at every size.
 */

.auz-mq {
	--auz-mq-scale: 1;
	width: 100%;
}

.auz-mq__label {
	margin: 0 0 22px;
	text-align: center;
	font-weight: 700;
	font-size: 18px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.auz-mq__viewport {
	position: relative;
	width: 100%;
	overflow: hidden;
	/* The band must not react to the cursor at all: no pause, no speed change. */
	pointer-events: none;
}

.auz-mq--fade .auz-mq__viewport {
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
	        mask-image: linear-gradient(90deg, transparent 0, #000 80px, #000 calc(100% - 80px), transparent 100%);
}

.auz-mq__track {
	display: flex;
	align-items: center;
	width: max-content;
	animation: auz-mq-scroll var(--auz-mq-speed, 42s) linear infinite;
	will-change: transform;
}

.auz-mq__logo {
	flex: 0 0 auto;
	display: block;
	width: calc(var(--auz-mq-w, 140px) * var(--auz-mq-scale));
	max-height: calc(var(--auz-mq-h, 62px) * var(--auz-mq-scale));
	height: auto;
	margin: 0 calc(var(--auz-mq-gap, 72px) * var(--auz-mq-scale)) 0 0;
	object-fit: contain;
}

.auz-mq--grey .auz-mq__logo {
	filter: grayscale(1);
	opacity: 0.72;
}

@keyframes auz-mq-scroll {
	from { transform: translate3d(0, 0, 0); }
	to   { transform: translate3d(var(--auz-mq-shift, -33.3333%), 0, 0); }
}

@media (max-width: 980px) {
	.auz-mq {
		--auz-mq-scale: 0.78;
	}
	.auz-mq__label {
		font-size: 16px;
		margin-bottom: 16px;
	}
	.auz-mq--fade .auz-mq__viewport {
		-webkit-mask-image: none;
		        mask-image: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.auz-mq__track {
		animation: none;
		width: 100%;
		flex-wrap: wrap;
		justify-content: center;
		row-gap: 20px;
	}
	.auz-mq__logo {
		margin: 0 calc(var(--auz-mq-gap, 72px) * 0.5);
	}
	/* Without the animation the repeats are just the same logos over again.
	   They are the ones marked aria-hidden, so they can be dropped. */
	.auz-mq__logo[aria-hidden="true"] {
		display: none;
	}
}
