/*
 * NS Notification Bar — frontend styles.
 *
 * Defensive principles:
 *  - All rules scoped under #nsnb-bar so the bar's styles only apply to itself.
 *  - !important applied ONLY to the visibility-critical properties listed in
 *    the spec (display, position, visibility, opacity, z-index, width,
 *    top/bottom). History shows these are the ones theme CSS most often
 *    breaks; everything else relies on selector specificity.
 *  - The bar carries its own font-stack and box-sizing so layout doesn't
 *    inherit theme weirdness.
 */

#nsnb-bar {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	/* z-index is set by the inline critical CSS block (admin-configurable). */
	width: 100% !important;
	box-sizing: border-box;
	margin: 0;
	padding: 14px 48px 14px 24px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	font-weight: 400;
	text-align: left;
	animation: nsnb-fade-in 200ms ease-in;
}

#nsnb-bar.nsnb-top-fixed {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
}
#nsnb-bar.nsnb-bottom-fixed {
	position: fixed !important;
	bottom: 0 !important;
	left: 0 !important;
}
#nsnb-bar.nsnb-top-static {
	position: relative !important;
}

#nsnb-bar .nsnb-inner {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 16px;
	flex-wrap: wrap;
	max-width: 1200px;
	margin: 0 auto;
}

#nsnb-bar .nsnb-message {
	display: inline;
}
#nsnb-bar .nsnb-message a {
	color: inherit;
	text-decoration: underline;
}
#nsnb-bar .nsnb-message a:hover {
	opacity: 0.85;
}

#nsnb-bar .nsnb-cta {
	display: inline-block;
	padding: 6px 18px;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none;
	border: 0;
	transition: filter 150ms ease;
	white-space: nowrap;
	line-height: 1.4;
}
#nsnb-bar .nsnb-cta:hover,
#nsnb-bar .nsnb-cta:focus {
	/* Subtle hover state without requiring admin to pick a second color. */
	filter: brightness(0.92);
	text-decoration: none;
}

#nsnb-bar .nsnb-dismiss {
	position: absolute;
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
	width: 24px;
	height: 24px;
	background: transparent;
	border: 0;
	color: inherit;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 150ms ease;
	padding: 0;
}
#nsnb-bar .nsnb-dismiss:hover,
#nsnb-bar .nsnb-dismiss:focus {
	opacity: 1;
}

#nsnb-bar.nsnb-dismissing {
	transform: translateY(-100%);
	opacity: 0 !important;
	transition: transform 200ms ease, opacity 200ms ease;
}
#nsnb-bar.nsnb-bottom-fixed.nsnb-dismissing {
	transform: translateY(100%);
}

@keyframes nsnb-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@media (max-width: 600px) {
	#nsnb-bar {
		padding: 12px 40px 12px 16px;
		font-size: 14px;
	}
	#nsnb-bar .nsnb-inner {
		flex-direction: column;
		gap: 10px;
	}
	#nsnb-bar .nsnb-cta {
		width: 100%;
		text-align: center;
	}
	#nsnb-bar .nsnb-dismiss {
		top: 8px;
		right: 8px;
		transform: none;
	}
}
