/**
 * Announcement marquee. Color and type come from the Blocksy Content Block.
 * Copies are identical, so one announcement and several both loop without a gap.
 */

.ct-header-content-block:has(.sa-announce) {
	width: 100%;
	min-width: 0;
	overflow: hidden;
}

.sa-announce {
	--sa-announce-gap: 1.25rem;
	width: 100%;
	max-width: none;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	mask-image: linear-gradient(to left, hsl(0 0% 0% / 0), hsl(0 0% 0% / 1) 5%, hsl(0 0% 0% / 1) 95%, hsl(0 0% 0% / 0));
}

.sa-announce__track {
	display: flex;
	width: max-content;
	animation: sa-announce-marquee var(--sa-announce-duration, 16s) linear infinite;
}

.sa-announce__group {
	display: flex;
	flex: none;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sa-announce__item {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
}

.sa-announce__item::after {
	content: "·";
	margin-inline: var(--sa-announce-gap);
}

.sa-announce__item a {
	color: inherit;
	text-decoration: none;
}

.sa-announce__item a:hover,
.sa-announce__item a:focus-visible {
	text-decoration: underline;
}

.sa-announce:hover .sa-announce__track,
.sa-announce:focus-within .sa-announce__track {
	animation-play-state: paused;
}

@keyframes sa-announce-marquee {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(calc(-100% / var(--sa-announce-copies, 2)));
	}
}

@media (prefers-reduced-motion: reduce) {
	.sa-announce {
		overflow-x: auto;
	}

	.sa-announce__track {
		animation: none;
	}

	.sa-announce__group[aria-hidden="true"] {
		display: none;
	}
}

/* Pause / play for moving decoration (motion.js). Shared by the marquee and the hero snowfall. */
.sa-announce {
	position: relative;
}

.sa-announce:has(.sa-announce__toggle) {
	padding-right: 32px;
}

html.sa-motion-paused .sa-announce__track {
	animation-play-state: paused;
}

.sa-motion-toggle {
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	min-height: 0;
	padding: 0;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	line-height: 0;
	cursor: pointer;
	opacity: 0.8;
}

.sa-motion-toggle:hover,
.sa-motion-toggle:focus-visible {
	opacity: 1;
}

.sa-motion-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.sa-motion-toggle__play,
.sa-motion-toggle[aria-pressed="true"] .sa-motion-toggle__pause {
	display: none;
}

.sa-motion-toggle[aria-pressed="true"] .sa-motion-toggle__play {
	display: block;
}

.sa-announce__toggle {
	position: absolute;
	top: 50%;
	right: 4px;
	transform: translateY(-50%);
}

.sa-snowfall__toggle {
	position: absolute;
	top: var(--sa-snow-toggle-top, 16px);
	right: 16px;
	z-index: 3;
	color: #fff;
	background: rgb(0 0 0 / 0.35);
}

@media (prefers-reduced-motion: reduce) {
	.sa-announce__toggle {
		display: none;
	}
}

.sa-announce:has(.sa-announce__viewport) {
	mask-image: none;
}

.sa-announce__viewport {
	overflow: hidden;
	mask-image: linear-gradient(to left, hsl(0 0% 0% / 0), hsl(0 0% 0% / 1) 5%, hsl(0 0% 0% / 1) 95%, hsl(0 0% 0% / 0));
}

@media (prefers-reduced-motion: reduce) {
	.sa-announce__viewport {
		overflow-x: auto;
	}
}
