/**
 * News Ticker for Elementor — Styles
 * @version 1.1.0  — lag-free / optimized
 */

/* ─── Reset & Base ─── */
.nte-ticker *,
.nte-ticker *::before,
.nte-ticker *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

.nte-ticker {
	--nte-transition: 600ms;
	display: flex;
	align-items: stretch;
	width: 100%;
	height: 46px;
	overflow: hidden;
	font-family: inherit;
	position: relative;
	background: #fff;
	/* GPU compositing layer — avoids layout reflow during animation */
	contain: layout style;
}

/* ─── Label ─── */
.nte-ticker__label {
	display: flex;
	align-items: center;
	white-space: nowrap;
	padding: 0 16px;
	background: #dc2626;
	color: #fff;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	flex-shrink: 0;
	position: relative;
	z-index: 2;
}

.nte-ticker__label i,
.nte-ticker__label svg {
	margin-right: 6px;
	flex-shrink: 0;
	font-size: 14px !important;
	width: 14px !important;
	height: 14px !important;
	line-height: 1 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
}

/* Force icon element rendered by Elementor Icons Manager */
.nte-ticker__label .eicon,
.nte-ticker__label [class^="fa"],
.nte-ticker__label [class*=" fa"] {
	font-size: 14px !important;
	line-height: 1 !important;
	vertical-align: middle;
}

/* SVG icons from Elementor */
.nte-ticker__label svg {
	width: 14px !important;
	height: 14px !important;
	max-width: 14px;
	max-height: 14px;
	overflow: hidden;
}

/* Diagonal clip on label right side */
.nte-ticker__label::after {
	content: '';
	position: absolute;
	right: -10px;
	top: 0;
	bottom: 0;
	width: 0;
	border-top: 46px solid transparent;
	border-left: 10px solid;
	border-left-color: inherit;
	pointer-events: none;
}

/* ─── Separator line ─── */
.nte-ticker__separator {
	width: 1px;
	flex-shrink: 0;
	background: #e5e7eb;
	margin: 6px 0;
}

/* ─── Body ─── */
.nte-ticker__body {
	flex: 1 1 auto;
	overflow: hidden;
	display: flex;
	align-items: center;
	min-width: 0;
}

/* ─── Nav ─── */
.nte-ticker__nav {
	display: flex;
	align-items: center;
	flex-shrink: 0;
	gap: 2px;
	padding: 0 8px;
}

.nte-nav-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 4px;
	background: #f3f4f6;
	color: #374151;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	flex-shrink: 0;
	line-height: 1;
}

.nte-nav-btn:hover {
	background: #dc2626;
	color: #fff;
}

.nte-nav-btn:focus-visible {
	outline: 2px solid #dc2626;
	outline-offset: 1px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SCROLL EFFECT
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.nte-effect-scroll .nte-ticker__body {
	position: relative;
}

.nte-scroll-track {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	display: flex;
	align-items: center;
}

.nte-scroll-inner {
	display: flex;
	align-items: center;
	white-space: nowrap;
	/* Promote to own compositor layer — transforms happen on GPU, no repaints */
	will-change: transform;
	transform: translateX(0);
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	/* Prevent subpixel blurring during animation */
	backface-visibility: hidden;
}

.nte-ticker__item {
	display: inline-flex;
	align-items: center;
	height: 100%;
	flex-shrink: 0;
}

.nte-effect-scroll .nte-ticker__item {
	margin-right: var(--nte-item-gap, 60px);
}

/* Item separator via CSS pseudo-element */
.nte-effect-scroll .nte-has-sep .nte-ticker__item::after,
.nte-effect-scroll .nte-ticker__item.nte-has-sep::after {
	content: var(--nte-sep, '•');
	margin-left: var(--nte-sep-gap, var(--nte-item-gap, 60px));
	color: #9ca3af;
	font-weight: 300;
}

/* Fade edge masks for scroll */
.nte-effect-scroll .nte-ticker__body::before,
.nte-effect-scroll .nte-ticker__body::after {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	width: 30px;
	z-index: 1;
	pointer-events: none;
}

.nte-effect-scroll .nte-ticker__body::before {
	left: 0;
	background: linear-gradient(to right, var(--e-global-color-background, #fff), transparent);
}

.nte-effect-scroll .nte-ticker__body::after {
	right: 0;
	background: linear-gradient(to left, var(--e-global-color-background, #fff), transparent);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FLASH PREVENTION GUARD
   Items in slide/fade/typing effects start hidden UNTIL JS adds
   nte-js-ready on the parent. This prevents the flash of unstyled /
   mis-positioned content before JS runs.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.nte-effect-slide:not(.nte-js-ready) .nte-ticker__item,
.nte-effect-fade:not(.nte-js-ready) .nte-ticker__item,
.nte-effect-typing:not(.nte-js-ready) .nte-ticker__item {
	/* Show only the server-rendered active item before JS kicks in */
	opacity: 0;
	pointer-events: none;
}

.nte-effect-slide:not(.nte-js-ready) .nte-ticker__item.nte-active,
.nte-effect-fade:not(.nte-js-ready) .nte-ticker__item.nte-active,
.nte-effect-typing:not(.nte-js-ready) .nte-ticker__item.nte-active {
	opacity: 1;
	pointer-events: auto;
	/* No transition here — instant display, transition only kicks in after JS ready */
	transition: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SLIDE / FADE SHARED
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.nte-effect-slide .nte-slide-track,
.nte-effect-fade .nte-slide-track,
.nte-effect-typing .nte-slide-track {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.nte-effect-slide .nte-ticker__item,
.nte-effect-fade .nte-ticker__item,
.nte-effect-typing .nte-ticker__item {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	padding: 0 16px;
	opacity: 0;
	pointer-events: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nte-effect-slide .nte-ticker__item.nte-active,
.nte-effect-fade .nte-ticker__item.nte-active,
.nte-effect-typing .nte-ticker__item.nte-active {
	opacity: 1;
	pointer-events: auto;
}

/* ─── SLIDE transitions ─── */
.nte-effect-slide .nte-ticker__item {
	transform: translateY(100%);
	transition: opacity var(--nte-transition) ease,
	            transform var(--nte-transition) ease;
	will-change: transform, opacity;
}

.nte-effect-slide .nte-ticker__item.nte-active {
	transform: translateY(0);
}

.nte-effect-slide .nte-ticker__item.nte-exit-up {
	transform: translateY(-100%);
	opacity: 0;
	pointer-events: none;
}

.nte-effect-slide .nte-ticker__item.nte-enter-up {
	transform: translateY(0);
	opacity: 1;
}

/* ─── FADE transitions ─── */
.nte-effect-fade .nte-ticker__item {
	transition: opacity var(--nte-transition) ease;
	will-change: opacity;
}

.nte-effect-fade .nte-ticker__item.nte-enter-fade {
	opacity: 1;
}

.nte-effect-fade .nte-ticker__item.nte-exit-fade {
	opacity: 0;
}

/* ─── TYPING ─── */
.nte-effect-typing .nte-ticker__item {
	transform: none;
	transition: none;
}

.nte-typing-text {
	display: inline;
}

/* Blinking cursor */
.nte-typing-text.nte-typing::after {
	content: '|';
	animation: nteCursorBlink 0.7s step-end infinite;
	margin-left: 1px;
	color: inherit;
	opacity: 0.8;
}

@keyframes nteCursorBlink {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0; }
}

/* ─── Item links ─── */
.nte-ticker__item a {
	color: #1f2937;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: color 0.2s;
	white-space: nowrap;
	display: inline-block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nte-ticker__item a:hover {
	color: #dc2626;
	text-decoration: underline;
}

.nte-ticker__item a:focus-visible {
	outline: 2px solid #dc2626;
	outline-offset: 2px;
	border-radius: 2px;
}

/* ─── Responsive ─── */
@media ( max-width: 1024px ) {
	.nte-ticker__label {
		padding: 0 12px;
	}
}

@media ( max-width: 767px ) {
	.nte-ticker {
		height: 40px;
	}

	.nte-ticker__label {
		padding: 0 10px;
		font-size: 11px;
	}

	.nte-ticker__label i,
	.nte-ticker__label svg {
		font-size: 11px !important;
		width: 11px !important;
		height: 11px !important;
	}

	.nte-ticker__item a {
		font-size: 13px;
	}

	.nte-ticker__nav {
		padding: 0 4px;
	}

	.nte-nav-btn {
		width: 26px;
		height: 26px;
	}
}

/* ─── Elementor editor visibility ─── */
.elementor-editor-active .nte-ticker {
	overflow: visible;
}
