/* ─── Top Banner: Frontend Styles ────────────────────── */

#njt-top-banner {
	--njt-bg:    #0f172a;
	--njt-color: #f8fafc;

	/* Hidden by default; JS shows it after checking the dismissed cookie. */
	display: none;
	width: 100%;
	background-color: var( --njt-bg );
	color: var( --njt-color );
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	position: relative;
	z-index: 99998;
}

/* Fixed variant — rendered in wp_footer for themes without wp_body_open(). */
#njt-top-banner.njt-top-banner--fixed {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99999;
}

/* Slide-in animation when JS adds .is-visible */
#njt-top-banner.is-visible {
	display: block;
	animation: njt-slide-down 0.38s cubic-bezier( 0.4, 0, 0.2, 1 ) both;
}

@keyframes njt-slide-down {
	from {
		transform: translateY( -100% );
		opacity: 0;
	}
	to {
		transform: translateY( 0 );
		opacity: 1;
	}
}

/* ─── Inner layout ───────────────────────────────────── */
.njt-top-banner__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px 52px 10px 16px;
	max-width: 1280px;
	margin: 0 auto;
	position: relative;
	min-height: 44px;
}

/* ─── Content area ───────────────────────────────────── */
.njt-top-banner__content {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	justify-content: center;
	text-align: center;
}

.njt-top-banner__content a {
	color: inherit;
}

/* ─── CTA pill button ────────────────────────────────── */
.njt-top-banner__cta {
	display: inline-flex;
	align-items: center;
	padding: 4px 15px;
	border: 1.5px solid currentColor;
	border-radius: 20px;
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none !important;
	color: inherit !important;
	white-space: nowrap;
	letter-spacing: 0.02em;
	transition: background 0.15s, opacity 0.15s;
}

.njt-top-banner__cta:hover {
	background: rgba( 255, 255, 255, 0.15 );
	text-decoration: none;
}

/* ─── Dismiss button ─────────────────────────────────── */
.njt-top-banner__close {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY( -50% );
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: transparent;
	border: none;
	cursor: pointer;
	color: inherit;
	opacity: 0.65;
	border-radius: 6px;
	padding: 0;
	transition: opacity 0.15s, background 0.15s;
	flex-shrink: 0;
}

.njt-top-banner__close:hover {
	opacity: 1;
	background: rgba( 255, 255, 255, 0.14 );
}

.njt-top-banner__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ─── WordPress admin-bar offset ────────────────────── */
/* Keeps the banner below the sticky WP toolbar. */
.admin-bar #njt-top-banner.njt-top-banner--fixed {
	top: 32px;
}

@media screen and ( max-width: 782px ) {
	.admin-bar #njt-top-banner.njt-top-banner--fixed {
		top: 46px;
	}
}

/* ─── Responsive ─────────────────────────────────────── */
@media ( max-width: 600px ) {
	#njt-top-banner {
		font-size: 13px;
	}

	.njt-top-banner__inner {
		padding: 10px 44px 10px 12px;
	}
}
