/* Ticker style for the Group block. See inc/ticker.php and assets/js/ticker.js. */

.is-style-ticker {
	overflow: hidden;
	white-space: nowrap;
}

.is-style-ticker p {
	margin: 0;
	flex-shrink: 0;
}

/* The track uses the same gap as the Group, so the spacing stays even across the loop. */
.ticker__track {
	display: flex;
	flex-shrink: 0;
	gap: inherit;
}

.is-style-ticker.is-running .ticker__track {
	animation: ticker-scroll var(--ticker-duration, 30s) linear infinite;
}

/* Let people stop the movement to read it. */
.is-style-ticker:hover .ticker__track,
.is-style-ticker:focus-within .ticker__track {
	animation-play-state: paused;
}

@keyframes ticker-scroll {
	to {
		transform: translateX(calc(-100% - var(--ticker-gap, 0px)));
	}
}

/* No movement for people who have asked their device to reduce motion. */
@media (prefers-reduced-motion: reduce) {
	.is-style-ticker.is-running .ticker__track {
		animation: none;
	}
}
