/* Ticker Widget — frontend. Every rule is scoped to .twgt-ticker. */

.twgt-ticker {
	--twgt-outer-bg: #f6b900;
	--twgt-inner-bg: #15151b;
	--twgt-title-color: #f5f5f5;
	--twgt-link-color: #f6c65b;
	--twgt-hover-color: #ffffff;
	--twgt-sep-color: #f5f5f5;
	--twgt-title-size: 15px;
	--twgt-link-size: 15px;
	--twgt-sep-size: 15px;
	--twgt-title-weight: 600;
	--twgt-link-weight: 500;
	--twgt-pad-y: 14px;
	--twgt-pad-x: 28px;
	--twgt-radius: 14px;
	--twgt-outer-pad-y: 18px;
	--twgt-outer-pad-x: 20px;
	--twgt-gap-x: 14px;
	--twgt-gap-y: 8px;
	--twgt-title-gap: 22px;

	box-sizing: border-box;
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: var(--twgt-outer-pad-y) var(--twgt-outer-pad-x);
	background: var(--twgt-outer-bg);
	font-family: inherit;
	-webkit-text-size-adjust: 100%;
}

.twgt-ticker *,
.twgt-ticker *::before,
.twgt-ticker *::after {
	box-sizing: border-box;
}

.twgt-ticker .twgt-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: var(--twgt-title-gap);
	row-gap: var(--twgt-gap-y);
	width: 100%;
	margin: 0;
	padding: var(--twgt-pad-y) var(--twgt-pad-x);
	background: var(--twgt-inner-bg);
	border-radius: var(--twgt-radius);
	box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.05);
	line-height: 1.4;
}

.twgt-ticker .twgt-title {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	color: var(--twgt-title-color);
	font-size: var(--twgt-title-size);
	font-weight: var(--twgt-title-weight);
	letter-spacing: 0.01em;
	line-height: 1.3;
	white-space: nowrap;
}

.twgt-ticker .twgt-links {
	display: flex;
	flex: 1 1 0;
	flex-wrap: wrap;
	align-items: center;
	column-gap: var(--twgt-gap-x);
	row-gap: var(--twgt-gap-y);
	min-width: min(100%, 220px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.twgt-ticker .twgt-item {
	display: inline-flex;
	align-items: center;
	gap: var(--twgt-gap-x);
	margin: 0;
	padding: 0;
	list-style: none;
	min-width: 0;
}

.twgt-ticker .twgt-item::before,
.twgt-ticker .twgt-item::marker {
	content: none;
}

.twgt-ticker a.twgt-link {
	padding: 0 0 2px;
	border: 0;
	box-shadow: none;
	background-color: transparent;
	background-image: linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0 1px;
	color: var(--twgt-link-color);
	font-size: var(--twgt-link-size);
	font-weight: var(--twgt-link-weight);
	line-height: 1.4;
	text-decoration: none;
	overflow-wrap: anywhere;
	transition: color 0.2s ease, background-size 0.25s ease;
}

.twgt-ticker a.twgt-link:hover,
.twgt-ticker a.twgt-link:focus-visible {
	color: var(--twgt-hover-color);
	background-size: 100% 1px;
	text-decoration: none;
}

.twgt-ticker a.twgt-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
	border-radius: 2px;
}

.twgt-ticker .twgt-sep {
	flex: 0 0 auto;
	color: var(--twgt-sep-color);
	font-size: var(--twgt-sep-size);
	line-height: 1;
	opacity: 0.9;
	user-select: none;
	-webkit-user-select: none;
}

/* Alignment */
.twgt-ticker.twgt-align-center .twgt-bar {
	justify-content: center;
}

.twgt-ticker.twgt-align-center .twgt-links {
	flex: 0 1 auto;
	justify-content: center;
}

/* Horizontal scroll mode */
.twgt-ticker.twgt-mode-scroll .twgt-bar {
	flex-wrap: nowrap;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.twgt-ticker.twgt-mode-scroll .twgt-links {
	flex: 0 0 auto;
	flex-wrap: nowrap;
	min-width: 0;
	white-space: nowrap;
}

.twgt-ticker.twgt-mode-scroll .twgt-item {
	flex: 0 0 auto;
}

.twgt-ticker.twgt-mode-scroll a.twgt-link {
	overflow-wrap: normal;
}

/* Tablets */
@media (max-width: 782px) {
	.twgt-ticker {
		padding: calc(var(--twgt-outer-pad-y) * 0.85) calc(var(--twgt-outer-pad-x) * 0.75);
	}

	.twgt-ticker .twgt-bar {
		padding: calc(var(--twgt-pad-y) * 0.9) calc(var(--twgt-pad-x) * 0.75);
	}
}

/* Phones */
@media (max-width: 520px) {
	.twgt-ticker {
		padding: calc(var(--twgt-outer-pad-y) * 0.7) calc(var(--twgt-outer-pad-x) * 0.5);
	}

	.twgt-ticker .twgt-bar {
		padding: calc(var(--twgt-pad-y) * 0.85) calc(var(--twgt-pad-x) * 0.6);
		column-gap: calc(var(--twgt-title-gap) * 0.6);
	}

	.twgt-ticker .twgt-title {
		font-size: calc(var(--twgt-title-size) * 0.95);
	}

	.twgt-ticker a.twgt-link {
		font-size: calc(var(--twgt-link-size) * 0.94);
	}

	.twgt-ticker .twgt-links,
	.twgt-ticker .twgt-item {
		column-gap: calc(var(--twgt-gap-x) * 0.7);
		gap: calc(var(--twgt-gap-x) * 0.7);
	}

	.twgt-ticker.twgt-mode-wrap .twgt-links {
		row-gap: calc(var(--twgt-gap-y) + 2px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.twgt-ticker a.twgt-link {
		transition: none;
	}
}

/* News-ticker (marquee) motion */
.twgt-ticker.twgt-motion-marquee .twgt-bar {
	flex-wrap: nowrap;
	overflow: hidden;
}

.twgt-ticker .twgt-marquee {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}

.twgt-ticker .twgt-track {
	display: flex;
	width: max-content;
	will-change: transform;
	animation: twgt-scroll var(--twgt-duration, 30s) linear infinite;
}

.twgt-ticker.twgt-dir-right .twgt-track {
	animation-direction: reverse;
}

.twgt-ticker.twgt-motion-marquee .twgt-links {
	flex: 0 0 auto;
	flex-wrap: nowrap;
	min-width: 0;
	margin-right: var(--twgt-gap-x);
	white-space: nowrap;
}

.twgt-ticker.twgt-motion-marquee .twgt-item {
	flex: 0 0 auto;
}

.twgt-ticker.twgt-motion-marquee a.twgt-link {
	overflow-wrap: normal;
}

.twgt-ticker.twgt-pause .twgt-marquee:hover .twgt-track,
.twgt-ticker.twgt-pause .twgt-marquee:focus-within .twgt-track {
	animation-play-state: paused;
}

@keyframes twgt-scroll {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(calc(-1 * var(--twgt-shift, 50%)));
	}
}

@media (prefers-reduced-motion: reduce) {
	.twgt-ticker.twgt-rm .twgt-track {
		animation: none;
	}

	.twgt-ticker.twgt-rm .twgt-marquee {
		overflow-x: auto;
		-webkit-mask-image: none;
		mask-image: none;
	}

	.twgt-ticker.twgt-rm .twgt-links[data-twgt-clone] {
		display: none;
	}
}
