/* ==========================================================================
   Sitewide Top Banner
   Layout shifting is controlled here. --swb-h is the RESERVED height per
   breakpoint that all push offsets use; the banner itself uses min-height
   so wrapped text can't overflow the bar. Keep --swb-h >= the banner's
   real rendered height at each breakpoint (inspect and bump if the client
   writes longer copy). body.swb-open is toggled by sitewide-banner.js.
   ========================================================================== */

:root {
	--swb-h: 40px; /* desktop: one line */
}
@media (max-width: 800px) {
	:root {
		--swb-h: 64px; /* two lines */
	}
}
@media (max-width: 480px) {
	:root {
		--swb-h: 78px; /* three lines at 14px font */
	}
}

/* ----- The banner bar ----- */
#sitewide-banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 10px 30px 10px 16px; /* right padding clears the close button */
	background: #FAD08D;
	color: #1D1734;
	box-sizing: border-box;
	font-family: effra, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	box-shadow: 0 2px 8px rgba(29, 23, 52, .15);
	transform: translateY(-100%);
	transition: transform .45s ease-out;
}
body.swb-open #sitewide-banner {
	transform: translateY(0);
}

/* Sit below the WP admin bar when logged in */
body.admin-bar #sitewide-banner { top: 32px; }
@media (max-width: 782px) {
	body.admin-bar #sitewide-banner { top: 46px; }
}

#sitewide-banner p {
	margin: 0;
	font-size: 16px;
	line-height: 1.35;
	text-align: center;
}
#sitewide-banner a {
	color: #1D1734;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}
#sitewide-banner a:hover,
#sitewide-banner a:focus-visible { color: #000; }

#sitewide-banner .swb-close {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	border: none;
	background: transparent;
	color: #1D1734;
	font-size: 20px;
	line-height: 1;
	padding: 6px 10px;
	cursor: pointer;
	border-radius: 4px;
}
#sitewide-banner .swb-close:hover,
#sitewide-banner .swb-close:focus-visible {
	background: rgba(29, 23, 52, .12);
}

@media (max-width: 480px) {
	#sitewide-banner { padding: 8px 44px 8px 12px; }
	#sitewide-banner p { font-size: 14px; }
}

/* ==========================================================================
   LAYOUT SHIFT — everything the banner pushes down, per breakpoint.
   ========================================================================== */

/* Page content */
body {
	transition: padding-top .45s ease-out;
}
body.swb-open {
	padding-top: var(--swb-h);
}
/*
   NOTE: padding-top REPLACES any padding the theme/plugins already put on
   body — it does not add to it. If body has a non-zero computed padding-top
   with the banner dismissed (check mobile especially), fold it in here, e.g.:

   @media (max-width: 1004px) {
       body.swb-open { padding-top: calc(52px + var(--swb-h)); }
   }
*/

/* Desktop: #header is position:relative; these fire only if .sticky is ever enabled */
@media (min-width: 1005px) {
	#header {
		transition: top .45s ease-out;
	}
	body.swb-open #header {
		top: var(--swb-h) !important;
	}
	body.logged-in.swb-open #header {
		top: calc(32px + var(--swb-h)) !important;
	}
	/* Admin bar is 46px at ≤782px */
	@media (max-width: 782px) {
		body.logged-in.swb-open #header {
			top: calc(46px + var(--swb-h)) !important;
		}
	}
}

/* Mobile: theme hides #header at ≤1004px; reveal it as a fixed bar below
   the banner when open, then push the MobMenu plugin drawer below it. */
@media (max-width: 1004px) {
	body.swb-open #header {
		display: block !important;
		position: fixed;
		top: var(--swb-h);
		left: 0;
		right: 0;
		z-index: 99999;
		transition: top .45s ease-out;
	}
	body.swb-open .mobmenu,
	body.swb-open .mobmenu-panel,
	.show-nav-left.swb-open .mobmenu-overlay,
	.show-nav-right.swb-open .mobmenu-overlay {
		top: var(--swb-h) !important;
	}
	body.swb-open {
		padding-top: var(--swb-h);
	}
}
/* Admin bar is 46px at ≤782px — shift everything down accordingly */
@media (max-width: 782px) {
	body.admin-bar.swb-open #header {
		top: calc(38px + var(--swb-h));
	}
	body.admin-bar.swb-open .mobmenu,
	body.admin-bar.swb-open .mobmenu-panel,
	.show-nav-left.admin-bar.swb-open .mobmenu-overlay,
	.show-nav-right.admin-bar.swb-open .mobmenu-overlay {
		top: calc(36px + var(--swb-h)) !important;
	}
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
	#sitewide-banner,
	body,
	#header,
	.mobmenu,
	.mobmenu-panel {
		transition: none !important;
	}
}