/* =============================================================
   SNB NOTICE BAR — frontend.css
   Visual language matches #st-joseph-topbar (dark navy #1e2d3a,
   orange #FFA500 accents, Montserrat). Two layout modes:
     - Desktop (>960px): full-width strip stacked ABOVE
       #st-joseph-topbar, pushing it (and the navbar below it) down.
     - Mobile (<=960px): floating bottom pill, clear of #mn-bar.

   Z-INDEX NOTE: the theme uses 100000 for both #st-joseph-topbar and
   #mn-bar. We render above both (100001) since the notice bar is the
   most time-sensitive, attention-needing element when present, and
   visually sits "outside"/above the rest of the fixed header stack.
   ============================================================= */

#snb-notice-bar {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 100001;
	font-family: 'Montserrat', sans-serif;
	background: #1e2d3a;
	border-bottom: 1px solid rgba(255, 165, 0, 0.25);
	box-sizing: border-box;
}

#snb-notice-bar * {
	box-sizing: border-box;
}

/*
 * IMPORTANT — why the topbar/navbar offset is NOT done here in CSS:
 *
 * header.php prints its own <style> block (with #st-joseph-topbar /
 * #st-joseph-navbar position rules, several using `!important`)
 * *inline*, after wp_head() — i.e. after this stylesheet in source
 * order. Per the CSS cascade, those inline `!important` rules will
 * always win over any plain rule here, and even matching them with
 * `!important` of our own is fragile (a tie is broken by source
 * order, and our stylesheet loses that tie too).
 *
 * The theme's own nav.js / inline header.php script solves exactly
 * this problem by setting `navbar.style.top` directly via JS (inline
 * style always outranks both author stylesheets, !important or not).
 * assets/js/frontend.js follows the same pattern: it sets inline
 * `top` on #st-joseph-topbar and #st-joseph-navbar directly, and
 * keeps them in sync with the theme's own scroll-hide behaviour and
 * WP's admin-bar offset. See frontend.js `positionThemeBars()`.
 *
 * This rule only sets our own bar's admin-bar offset, since nothing
 * else competes for #snb-notice-bar's positioning.
 */
.admin-bar #snb-notice-bar {
	top: 32px;
}

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

/* ── Inner layout (desktop strip) ───────────────────────────── */

.snb-inner {
	max-width: 1200px;
	margin: 0 auto;
	height: 40px;
	padding: 0 20px;
	display: flex;
	align-items: center;
	gap: 16px;
}

.snb-track {
	flex: 1;
	min-width: 0;
	position: relative;
	height: 100%;
	display: flex;
	align-items: center;
}

.snb-slide {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	white-space: nowrap;
	overflow: hidden;
	color: rgba(255, 255, 255, 0.92);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.01em;
	animation: snb-fade-in 0.35s ease;
}

.snb-slide[hidden] {
	display: none;
}

@keyframes snb-fade-in {
	from { opacity: 0; transform: translateY(3px); }
	to   { opacity: 1; transform: translateY(0); }
}

.snb-icon {
	color: #FFA500;
	font-size: 13px;
	flex-shrink: 0;
}

.snb-message {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	min-width: 0;
}

.snb-link {
	flex-shrink: 0;
	color: #FFA500;
	font-weight: 700;
	font-size: 12px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 0 4px 10px;
	border-left: 1px solid rgba(255, 255, 255, 0.18);
	transition: color 0.2s ease;
}
.snb-link:hover {
	color: #ffb733;
}
.snb-link i {
	font-size: 10px;
}

/* ── Rotation dots ───────────────────────────────────────────── */

.snb-dots {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.snb-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.3);
	padding: 0;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}
.snb-dot:hover {
	background: rgba(255, 255, 255, 0.55);
}
.snb-dot.is-active {
	background: #FFA500;
	transform: scale(1.15);
}

/* ── Dismiss button ──────────────────────────────────────────── */

.snb-dismiss {
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	color: rgba(255, 255, 255, 0.55);
	cursor: pointer;
	border-radius: 50%;
	transition: color 0.2s ease, background 0.2s ease;
	font-size: 13px;
}
.snb-dismiss:hover {
	color: #FFA500;
	background: rgba(255, 255, 255, 0.08);
}

/* ── Dismiss choice panel ────────────────────────────────────── */

.snb-choice {
	position: absolute;
	top: 100%;
	right: 20px;
	margin-top: 8px;
	background: #ffffff;
	color: #2c3e50;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
	border-top: 3px solid #FFA500;
	width: 280px;
	z-index: 100002;
	animation: snb-fade-in 0.2s ease;
}
.snb-choice[hidden] {
	display: none;
}
.snb-choice-inner {
	padding: 18px 20px 16px;
}
.snb-choice-title {
	font-family: 'Montserrat', sans-serif;
	font-weight: 700;
	font-size: 14px;
	color: #2c3e50;
	margin: 0 0 12px;
}
.snb-choice-buttons {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.snb-choice-btn {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	width: 100%;
	text-align: left;
	padding: 10px 12px;
	background: #f9f9f9;
	border: 1px solid #eaeaea;
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: #2c3e50;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}
.snb-choice-btn:hover {
	background: rgba(255, 165, 0, 0.08);
	border-color: #FFA500;
}
.snb-choice-sub {
	font-size: 11px;
	font-weight: 500;
	color: #546e7a;
}
.snb-choice-close {
	margin-top: 12px;
	background: none;
	border: none;
	font-size: 12px;
	font-weight: 600;
	color: #546e7a;
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
}
.snb-choice-close:hover {
	color: #2c3e50;
}

/* =============================================================
   MOBILE (<=960px) — matches the theme's own #mn-bar breakpoint.
   Floating bottom pill instead of a top strip: avoids competing
   with #mn-bar (56px fixed top bar + hamburger) and clears the
   iOS home-indicator safe area.
   ============================================================= */

@media (max-width: 960px) {

	#snb-notice-bar {
		top: auto;
		bottom: calc(14px + env(safe-area-inset-bottom, 0px));
		left: 50%;
		transform: translateX(-50%);
		width: calc(100% - 24px);
		max-width: 480px;
		border-radius: 10px;
		border: 1px solid rgba(255, 165, 0, 0.3);
		border-bottom: 1px solid rgba(255, 165, 0, 0.3);
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	}

	/* No offset needed for #st-joseph-topbar/#st-joseph-navbar here —
	   our mobile pill floats at the bottom and never stacks with the
	   header, so frontend.js's positionThemeBars() correctly leaves
	   them untouched (theme's own CSS/JS continues to fully own their
	   position) at this breakpoint. */

	.snb-inner {
		height: auto;
		min-height: 48px;
		padding: 10px 14px;
		gap: 10px;
	}

	.snb-slide {
		font-size: 12.5px;
		white-space: normal;
		line-height: 1.4;
	}

	.snb-message {
		white-space: normal;
		overflow: visible;
		text-overflow: initial;
	}

	.snb-link {
		border-left: none;
		padding-left: 0;
		margin-left: auto;
	}

	.snb-dots {
		display: none; /* dots read as clutter in the compact pill; swipe/auto-rotate still works */
	}

	.snb-choice {
		right: 10px;
		left: 10px;
		width: auto;
		bottom: 100%;
		top: auto;
		margin-top: 0;
		margin-bottom: 8px;
	}
}

@media (max-width: 480px) {
	#snb-notice-bar {
		width: calc(100% - 16px);
		bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	}
}

/* Reduced motion: respect user preference, skip the slide-in animation. */
@media (prefers-reduced-motion: reduce) {
	.snb-slide,
	.snb-choice {
		animation: none;
	}
}
