/**
 * Promo announcement bar — full-width strip above the header nav.
 */

/* Stack header template-part vertically so the bar is never inline with nav. */
header.wp-block-template-part,
.wp-block-template-part:has(.wp-block-header),
.wp-block-template-part:has(#page-top) {
	align-items: stretch !important;
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	overflow: visible !important;
	width: 100% !important;
}

.wp-header-page-top,
#page-top.wp-header-page-top,
#page-top,
.sophia-promo-bar-host {
	align-self: stretch !important;
	box-sizing: border-box;
	flex: 0 0 auto !important;
	margin: 0 !important;
	max-width: none !important;
	min-height: 0 !important;
	overflow: visible !important;
	padding: 0 !important;
	position: relative;
	width: 100% !important;
	z-index: 30;
}

.wp-block-template-part > .wp-block-header,
header.wp-block-template-part > .wp-block-header {
	align-self: stretch !important;
	flex: 0 0 auto !important;
	max-width: none !important;
	position: relative;
	width: 100% !important;
	z-index: 9;
}

.sophia-promo-bar {
	--sophia-promo-bg: #1b4a4a;
	--sophia-promo-fg: #f7f1ea;
	align-self: stretch !important;
	background: transparent;
	box-sizing: border-box;
	color: var(--sophia-promo-fg);
	flex: 0 0 auto !important;
	max-width: none !important;
	overflow: visible !important;
	position: relative;
	width: 100% !important;
	z-index: 30;
}

.sophia-promo-bar__panel {
	background: var(--sophia-promo-bg);
	box-sizing: border-box;
	max-height: 6rem;
	opacity: 1;
	overflow: hidden;
	transition: max-height 0.28s ease, opacity 0.2s ease;
	width: 100%;
}

.sophia-promo-bar.is-collapsed .sophia-promo-bar__panel {
	max-height: 0 !important;
	opacity: 0;
	pointer-events: none;
}

.sophia-promo-bar__inner {
	align-items: center;
	box-sizing: border-box;
	display: flex;
	gap: 0.75rem;
	justify-content: center;
	margin: 0 auto;
	max-width: 100%;
	padding: 0.55rem 2.75rem 0.55rem 1rem;
	position: relative;
	width: min(100%, 90rem);
}

.sophia-promo-bar__text {
	flex: 1 1 auto;
	font-family: var(--wp--preset--font-family--body, inherit);
	font-size: clamp(0.75rem, 1.6vw, 0.9375rem);
	font-weight: 500;
	letter-spacing: 0.01em;
	line-height: 1.35;
	margin: 0;
	text-align: center;
}

.sophia-promo-bar__close {
	align-items: center;
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: 999px;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	flex: 0 0 auto;
	font-size: 1.35rem;
	height: 2rem;
	justify-content: center;
	line-height: 1;
	margin: 0;
	padding: 0;
	position: absolute;
	right: 0.35rem;
	top: 50%;
	transform: translateY(-50%);
	width: 2rem;
}

.sophia-promo-bar__close:hover,
.sophia-promo-bar__close:focus-visible {
	background: rgba(255, 255, 255, 0.14);
	outline: none;
}

.sophia-promo-bar__close span {
	display: block;
	margin-top: -0.05em;
}

/*
 * Expand tab: keep in normal flow when collapsed so mobile parents
 * with overflow/clipping cannot hide a height:0 absolute child.
 */
.sophia-promo-bar__expand {
	align-items: center;
	appearance: none;
	background: var(--sophia-promo-bg);
	border: 0;
	border-radius: 0 0 0.55rem 0.55rem;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
	color: var(--sophia-promo-fg);
	cursor: pointer;
	display: none;
	font-size: 0.9rem;
	height: 1.25rem;
	justify-content: center;
	letter-spacing: -0.08em;
	line-height: 1;
	margin: 0 auto;
	min-width: 2.85rem;
	padding: 0 0.7rem 0.12rem;
	position: relative;
	z-index: 31;
}

.sophia-promo-bar.is-collapsed {
	align-items: center;
	display: flex !important;
	flex-direction: column;
	height: auto !important;
	justify-content: flex-start;
	min-height: 1.25rem;
	overflow: visible !important;
}

.sophia-promo-bar.is-collapsed .sophia-promo-bar__expand {
	display: inline-flex !important;
	visibility: visible !important;
}

.sophia-promo-bar:not(.is-collapsed) .sophia-promo-bar__expand {
	display: none !important;
}

.sophia-promo-bar__expand:hover,
.sophia-promo-bar__expand:focus-visible {
	filter: brightness(1.08);
	outline: none;
}

@media screen and (max-width: 48em) {
	.sophia-promo-bar__inner {
		gap: 0.5rem;
		padding: 0.5rem 2.5rem 0.5rem 0.85rem;
	}

	.sophia-promo-bar__text {
		font-size: clamp(0.6875rem, 3.2vw, 0.8125rem);
		line-height: 1.4;
	}

	.sophia-promo-bar__close {
		height: 1.85rem;
		right: 0.2rem;
		width: 1.85rem;
	}

	.sophia-promo-bar.is-collapsed {
		min-height: 1.35rem;
	}

	.sophia-promo-bar__expand {
		font-size: 0.95rem;
		height: 1.35rem;
		min-width: 3rem;
		padding: 0 0.8rem 0.15rem;
	}
}

@media screen and (max-width: 30em) {
	.sophia-promo-bar__inner {
		padding: 0.45rem 2.25rem 0.45rem 0.7rem;
	}

	.sophia-promo-bar__text {
		font-size: 0.6875rem;
	}

	.sophia-promo-bar.is-collapsed {
		min-height: 1.4rem;
	}

	.sophia-promo-bar__expand {
		font-size: 1rem;
		height: 1.4rem;
		min-width: 3.15rem;
	}
}
