/**
 * KEPSA News Ticker — front-end styles.
 * Every selector is prefixed with .knt- so it can never match, override,
 * or be overridden by Salient's own CSS classes. Box model is isolated
 * with box-sizing so it won't inherit any stray theme rules.
 */

.knt-wrapper,
.knt-wrapper * {
	box-sizing: border-box;
}

.knt-wrapper {
	position: relative;
	display: flex;
	align-items: stretch;
	width: 100%;
	height: var(--knt-height, 46px);
	overflow: hidden;
	background: linear-gradient(90deg, var(--knt-bg-start, #0a3fae), var(--knt-bg-end, #1256d1));
	font-family: inherit;
	line-height: 1;
	border-radius: 0;
	z-index: 1;
	isolation: isolate;
}

.knt-label {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 18px;
	background: var(--knt-label-bg, #d32f2f);
	color: var(--knt-label-color, #fff);
	font-size: calc(var(--knt-font-size, 14px) * 0.86);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
	position: relative;
	z-index: 2;
}

/* Little angled edge so the label reads as a "tag" rather than a flat block. */
.knt-label::after {
	content: "";
	position: absolute;
	top: 0;
	right: -14px;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: var(--knt-height, 46px) 0 0 14px;
	border-color: transparent transparent transparent var(--knt-label-bg, #d32f2f);
}

.knt-viewport {
	position: relative;
	flex: 1 1 auto;
	overflow: hidden;
	display: flex;
	align-items: center;
	height: 100%;
}

/* The row that actually gets animated. It holds TWO identical copies of the
   headline list, side by side. Translating it by exactly -50% moves it by
   the width of one copy, so the moment it "resets" to 0% the pixels are
   identical to what was already on screen — a perfectly seamless loop,
   regardless of how much (or little) content there is. */
.knt-track-row {
	display: flex;
	align-items: center;
	width: max-content;
	will-change: transform;
	animation: knt-scroll-left var(--knt-speed, 30s) linear infinite;
}

.knt-direction-right .knt-track-row {
	animation-name: knt-scroll-right;
}

.knt-track {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	white-space: nowrap;
	flex: 0 0 auto;
}

.knt-wrapper[data-pause-on-hover="yes"]:hover .knt-track-row,
.knt-wrapper[data-pause-on-hover="yes"]:focus-within .knt-track-row {
	animation-play-state: paused;
}

.knt-item {
	display: inline-flex;
	align-items: center;
	padding: 0 6px;
	font-size: var(--knt-font-size, 14px);
	font-weight: 600;
	color: var(--knt-text-color, #fff);
}

.knt-item a,
.knt-item span {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.knt-item a:hover,
.knt-item a:focus {
	color: var(--knt-hover-color, #ffe27a);
	text-decoration: underline;
}

.knt-sep {
	display: inline-flex;
	align-items: center;
	padding: 0 14px;
	color: var(--knt-sep-color, #ff5c5c);
	font-size: calc(var(--knt-font-size, 14px) * 0.7);
}

@keyframes knt-scroll-left {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

@keyframes knt-scroll-right {
	from { transform: translateX(-50%); }
	to   { transform: translateX(0); }
}

/* Respect users who've asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.knt-track-row {
		animation: none;
	}
	.knt-track-clone {
		display: none;
	}
	.knt-viewport {
		overflow-x: auto;
	}
}

/* Small screens: shrink label + text a touch so nothing wraps oddly. */
@media (max-width: 600px) {
	.knt-label {
		padding: 0 12px;
		font-size: calc(var(--knt-font-size, 14px) * 0.75);
	}
	.knt-item {
		font-size: calc(var(--knt-font-size, 14px) * 0.92);
	}
}
