/*
 * CAR-2: logo scroller. A block style on a Group that holds images.
 * Without JavaScript, in the editor, and with reduced motion it is a row that scrolls sideways.
 */

.is-style-wprk-scroller.is-style-wprk-scroller {
	--wprk-scroller-gap: var(--wp--preset--spacing--60);
	align-items: center;
	display: flex;
	flex-wrap: nowrap;
	gap: var(--wprk-scroller-gap);
	overflow-x: auto;
	scrollbar-width: thin;
}

.is-style-wprk-scroller.is-style-wprk-scroller > * {
	flex: 0 0 auto;
	margin: 0;
}

/* When the row is not moving and everything fits, centre it. Auto margins never push items out of reach. */
.is-style-wprk-scroller.is-style-wprk-scroller:not([data-wprk-scroller]) > :first-child {
	margin-inline-start: auto;
}

.is-style-wprk-scroller.is-style-wprk-scroller:not([data-wprk-scroller]) > :last-child {
	margin-inline-end: auto;
}

.is-style-wprk-scroller[data-wprk-scroller] {
	display: block;
	-webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
	mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
	overflow: hidden;
}

.wprk-scroller__track {
	align-items: center;
	animation: wprk-scroller var(--wprk-scroller-duration, 30s) linear infinite;
	display: flex;
	gap: var(--wprk-scroller-gap);
	width: max-content;
}

.wprk-scroller__track > * {
	flex: 0 0 auto;
	margin: 0;
}

.is-style-wprk-scroller:hover .wprk-scroller__track,
.is-style-wprk-scroller:focus-within .wprk-scroller__track,
.is-style-wprk-scroller.is-paused .wprk-scroller__track {
	animation-play-state: paused;
}

@keyframes wprk-scroller {
	to {
		transform: translateX(calc(-50% - var(--wprk-scroller-gap) / 2));
	}
}

.wprk-scroller__toggle {
	align-items: center;
	background: transparent;
	border: 1px solid var(--wprk-border);
	border-radius: 50%;
	color: var(--wprk-muted);
	cursor: pointer;
	display: flex;
	height: 2.75rem;
	justify-content: center;
	margin: var(--wp--preset--spacing--30) auto 0;
	padding: 0;
	width: 2.75rem;
}

.wprk-scroller__toggle:hover {
	border-color: var(--wprk-heading);
	color: var(--wprk-heading);
}

.wprk-scroller__toggle svg {
	fill: none;
	height: 1.125rem;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 1.75;
	width: 1.125rem;
}
