/**
 * Yeldam Scrolling Ticker widget.
 *
 * The track holds 2+ identical groups and slides by exactly one group
 * width/height, then loops — so the seam is invisible. ticker.js sets
 * --ypw-ticker-shift (one group, in px) and --ypw-ticker-duration (from the
 * px/s speed); without JS it falls back to -50% (two groups) and 30s.
 */

.ypw-ticker {
	--ypw-ticker-gap: 48px;
	--ypw-ticker-fade: 60px;

	position: relative;
	display: flex;
	align-items: center;
	overflow: hidden;
	padding: 14px 0;
	background-color: #0f2a1d;
	color: #ffffff;
	font-size: 15px;
	line-height: 1.4;
}

.ypw-ticker__track {
	display: flex;
	flex-wrap: nowrap;
	flex-shrink: 0;
	width: max-content;
	animation: ypw-ticker-x var(--ypw-ticker-duration, 30s) linear infinite;
	will-change: transform;
}

.ypw-ticker__group {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: var(--ypw-ticker-gap);
	/* Same space at the seam as between items. */
	padding-right: var(--ypw-ticker-gap);
}

.ypw-ticker--right .ypw-ticker__track,
.ypw-ticker--down .ypw-ticker__track {
	animation-direction: reverse;
}

.ypw-ticker--pause-hover:hover .ypw-ticker__track,
.ypw-ticker--pause-hover:focus-within .ypw-ticker__track {
	animation-play-state: paused;
}

/* Vertical (up / down). */
.ypw-ticker--vertical {
	align-items: flex-start;
	height: 200px;
}

.ypw-ticker--vertical .ypw-ticker__track {
	flex-direction: column;
	width: 100%;
	height: max-content;
	animation-name: ypw-ticker-y;
}

.ypw-ticker--vertical .ypw-ticker__group {
	flex-direction: column;
	padding-right: 0;
	padding-bottom: var(--ypw-ticker-gap);
}

.ypw-ticker--vertical .ypw-ticker__item {
	white-space: normal;
	justify-content: center;
	text-align: center;
}

/* Fade edges. */
.ypw-ticker--fade {
	-webkit-mask-image: linear-gradient(to right, transparent, #000 var(--ypw-ticker-fade), #000 calc(100% - var(--ypw-ticker-fade)), transparent);
	mask-image: linear-gradient(to right, transparent, #000 var(--ypw-ticker-fade), #000 calc(100% - var(--ypw-ticker-fade)), transparent);
}

.ypw-ticker--fade.ypw-ticker--vertical {
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--ypw-ticker-fade), #000 calc(100% - var(--ypw-ticker-fade)), transparent);
	mask-image: linear-gradient(to bottom, transparent, #000 var(--ypw-ticker-fade), #000 calc(100% - var(--ypw-ticker-fade)), transparent);
}

/* Items. */
.ypw-ticker__item {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

a.ypw-ticker__item--link {
	color: inherit;
	text-decoration: none;
}

.ypw-ticker__icon {
	display: inline-flex;
	align-items: center;
	color: #f07b3f;
	font-size: 18px;
	line-height: 1;
}

.ypw-ticker__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.ypw-ticker__image {
	display: block;
	width: auto;
	max-width: none;
	height: 32px;
	object-fit: contain;
	transition: filter 0.3s ease;
}

.ypw-ticker__text {
	color: #ffffff;
}

.ypw-ticker__highlight {
	color: #f07b3f;
	font-weight: 500;
}

.ypw-ticker__link {
	margin-left: 40px;
	color: #ffffff;
	font-weight: 700;
	text-decoration: none;
	transition: color 0.2s ease;
}

.ypw-ticker__link:hover,
.ypw-ticker__link:focus-visible {
	color: #f07b3f;
}

.ypw-ticker__sep {
	flex-shrink: 0;
	opacity: 0.7;
}

.ypw-ticker__sep--line {
	align-self: center;
	width: 1px;
	height: 32px;
	background-color: currentColor;
	opacity: 0.35;
}

/* Words wrapped in *asterisks*. */
.ypw-ticker__accent {
	color: #f5c518;
}

/* Stacked layout: title on top, text below. */
.ypw-ticker--stacked .ypw-ticker__text {
	display: inline-flex;
	flex-direction: column;
	gap: 2px;
	line-height: 1.25;
}

.ypw-ticker--stacked .ypw-ticker__highlight {
	font-size: 1.2em;
	font-weight: 800;
	color: #ffffff;
}

.ypw-ticker--stacked .ypw-ticker__body {
	font-size: 0.9em;
}

/* Badge ("● LIVE"). */
.ypw-ticker__badge {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 7px;
	padding: 5px 16px;
	border: 2px solid #6fcf73;
	border-radius: 999px;
	background-color: #1e5b2c;
	color: #ffffff;
	font-weight: 800;
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-transform: uppercase;
}

.ypw-ticker__badge-dot {
	flex-shrink: 0;
	width: 0.6em;
	height: 0.6em;
	border-radius: 50%;
	background-color: currentColor;
	color: #ffffff;
}

.ypw-ticker-pulse-yes .ypw-ticker__badge-dot {
	animation: ypw-ticker-pulse 1.6s ease-out infinite;
}

/* Button-style link. */
.ypw-ticker__link--button {
	display: inline-flex;
	align-items: center;
	padding: 8px 22px;
	border-radius: 999px;
	background-color: #f5c518;
	color: #0f2a1d;
	transition: color 0.2s ease, background-color 0.2s ease;
}

.ypw-ticker__link--button:hover,
.ypw-ticker__link--button:focus-visible {
	background-color: #ffd84a;
	color: #0f2a1d;
}

/* A link that leads its item (or sits inside sparkles) needs no gap before it. */
.ypw-ticker .ypw-ticker__item > .ypw-ticker__link:first-child,
.ypw-ticker .ypw-ticker__spark .ypw-ticker__link {
	margin-left: 0;
}

/* Sparkle rays either side of the badge / button. */
.ypw-ticker__spark {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	gap: 4px;
}

.ypw-ticker__rays {
	flex-shrink: 0;
	width: auto;
	height: 24px;
	aspect-ratio: 1 / 2;
	color: #f5c518;
	overflow: visible;
}

.ypw-ticker__rays--end {
	transform: scaleX(-1);
}

/* Fixed edge decorations (e.g. leaves) over the scrolling content. */
.ypw-ticker__decor {
	position: absolute;
	top: 50%;
	z-index: 1;
	width: 40px;
	height: auto;
	max-width: none;
	transform: translateY(-50%);
	pointer-events: none;
}

.ypw-ticker__decor--left {
	left: 8px;
}

.ypw-ticker__decor--right {
	right: 8px;
}

@keyframes ypw-ticker-x {
	from {
		transform: translate3d(0, 0, 0);
	}
	to {
		transform: translate3d(var(--ypw-ticker-shift, -50%), 0, 0);
	}
}

@keyframes ypw-ticker-y {
	from {
		transform: translate3d(0, 0, 0);
	}
	to {
		transform: translate3d(0, var(--ypw-ticker-shift, -50%), 0);
	}
}

@keyframes ypw-ticker-pulse {
	0% {
		box-shadow: 0 0 0 0 currentColor;
	}
	70%,
	100% {
		box-shadow: 0 0 0 0.45em transparent;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ypw-ticker__track,
	.ypw-ticker-pulse-yes .ypw-ticker__badge-dot {
		animation: none;
	}
}
