/*
 * Site Alert — orange announcement bar fixed above the navigation.
 * Figma: 15 Project Alert → Option 1 (desktop 2:224, mobile 7:148).
 * Markup: template-parts/site-alert.php · Fields: Site Settings (functions.php)
 *
 * --site-alert-h is set inline by JS from the bar's real height; the values
 * below are first-paint fallbacks so the reserved space is right before JS runs.
 */

body.has-site-alert {
	--site-alert-h: 93px;
	/* No body padding: the bar overlays the top of the page (transparent until it drops in). */
}

@media only screen and (min-width: 768px) {
	body.has-site-alert {
		--site-alert-h: 72px;
	}
}

@media only screen and (min-width: 1200px) {
	body.has-site-alert {
		--site-alert-h: 48px;
	}
}

/* Push the fixed header / menu button / menu overlay down below the bar. */
body.has-site-alert .site-header {
	top: var(--site-alert-h);
}

body.has-site-alert .nav-toggle,
body.has-site-alert .site-header .navbar,
body.has-site-alert .site-header .close {
	margin-top: var(--site-alert-h);
}

body.has-site-alert .site-header #navigationWrap {
	min-height: calc(100vh - var(--site-alert-h));
}

/* ── Bar ─────────────────────────────────────────────── */
.site-alert {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 60; /* above .site-header (50) and its menu overlay */
	background-color: #ff6724;
	color: #0a1124;
	transform: translateY(-100%);
	transition: transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
	will-change: transform;
}

.site-alert.is-visible {
	transform: translateY(0);
}

/* Logged-in admin bar: start hidden behind it, not peeking below it. */
body.admin-bar .site-alert:not(.is-visible) {
	transform: translateY(calc(-100% - var(--wp-admin--admin-bar--height, 0px)));
}

.site-alert__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	column-gap: 10px;
	row-gap: 5px;
	padding: 10px;
	font-family: "DM Mono", monospace;
	font-weight: 500;
	font-size: 13px;
	letter-spacing: 0.1em;
	line-height: normal;
	text-transform: uppercase;
	text-align: center;
}

.site-alert__text {
	margin: 0;
	flex: 1 1 100%;
}

.site-alert__link,
.site-alert__link:visited {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: from-font;
	text-underline-position: from-font;
	text-decoration-skip-ink: none;
	white-space: nowrap;
	transition: opacity 0.2s ease;
}

.site-alert__link:hover {
	color: inherit;
	opacity: 0.7;
}

.site-alert__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media only screen and (min-width: 768px) {
	.site-alert__inner {
		padding: 13px 20px;
		font-size: 16px;
	}

	/* Editor line breaks are mobile-only; desktop flows as one line. */
	.site-alert__text br {
		display: none;
	}
}

@media only screen and (min-width: 1200px) {
	.site-alert__text {
		flex: 0 1 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-alert {
		transition: none;
	}
}
