/**
 * Search Bar — Futura-pt, brand colors #326699 / #FFC601
 */

/* Futura PT stack — load via theme/Adobe Fonts; sensible fallbacks */
.sb-search-trigger,
.sb-search-modal {
	font-family: "futura-pt", Futura, "Trebuchet MS", "Century Gothic", "Arial Narrow", Arial, sans-serif;
}

/* ---- Trigger (icon + “Search”) ---- */
.sb-search-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.01em;
	-webkit-font-smoothing: antialiased;
	transition: color 0.2s ease, opacity 0.2s ease;
}

.sb-search-trigger:hover,
.sb-search-trigger:focus-visible {
	color: #ffc601;
	outline: none;
}

.sb-search-trigger:focus-visible {
	box-shadow: 0 0 0 2px #326699, 0 0 0 4px #ffc601;
	border-radius: 2px;
}

.sb-search-trigger__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: inherit;
	transform: rotate(-38deg);
}

.sb-search-trigger__icon svg {
	display: block;
}

.sb-search-trigger__label {
	position: relative;
	top: 0.02em;
}

/* ---- Modal root ---- */
.sb-search-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	pointer-events: none;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.sb-search-modal[hidden] {
	display: none !important;
}

.sb-search-modal.is-open {
	display: flex !important;
	pointer-events: auto;
	visibility: visible;
	opacity: 1;
}

.sb-search-modal.is-open[hidden] {
	display: flex !important;
}

/* Backdrop */
.sb-search-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.78);
	cursor: pointer;
}

/* Panel wrapper (for close button positioning) */
.sb-search-modal__panel {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 640px;
	transform: scale(0.94);
	opacity: 0;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.sb-search-modal.is-open .sb-search-modal__panel {
	transform: scale(1);
	opacity: 1;
}

/* Close (X) — above pill, top-right */
.sb-search-modal__close {
	position: absolute;
	right: 0;
	top: -2.75rem;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 1.85rem;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease, transform 0.2s ease;
	border-radius: 4px;
}

.sb-search-modal__close:hover,
.sb-search-modal__close:focus-visible {
	color: #ffc601;
	outline: none;
}

.sb-search-modal__close:focus-visible {
	box-shadow: 0 0 0 2px #ffc601;
}

.sb-search-modal__close span {
	display: block;
	margin-top: -0.15em;
	font-weight: 300;
}

/* Pill form */
.sb-search-modal__form {
	display: flex;
	align-items: stretch;
	width: 100%;
	border-radius: 9999px;
	overflow: hidden;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.sb-search-modal__input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	border-radius: 0;
	padding: 1.05rem 1.35rem 1.05rem 1.65rem;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 400;
	color: #1a1a1a;
	background: #fff;
	-webkit-appearance: none;
	appearance: none;
}

.sb-search-modal__input::placeholder {
	color: #9a9a9a;
	opacity: 1;
}

.sb-search-modal__input:focus {
	outline: none;
	box-shadow: inset 0 0 0 2px #ffc601;
}

.sb-search-modal__submit {
	flex: 0 0 auto;
	border: 0;
	border-radius: 0;
	padding: 1.05rem 1.85rem;
	min-width: 7.5rem;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: #fff;
	background: #326699;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}

.sb-search-modal__submit:hover,
.sb-search-modal__submit:focus-visible {
	background: #2a567f;
	outline: none;
}

.sb-search-modal__submit:focus-visible {
	box-shadow: 0 0 0 3px #ffc601;
}

/* Screen reader text (WP-style) */
.sb-search-modal .screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	word-wrap: normal !important;
	border: 0;
}

body.sb-search-modal-open {
	overflow: hidden;
}

@media (max-width: 520px) {
	.sb-search-modal__form {
		flex-direction: column;
		border-radius: 1.25rem;
	}

	.sb-search-modal__input {
		border-radius: 1.25rem 1.25rem 0 0;
		padding: 1rem 1.25rem;
	}

	.sb-search-modal__submit {
		border-radius: 0 0 1.25rem 1.25rem;
		min-width: 100%;
		padding: 0.95rem 1.25rem;
	}

	.sb-search-modal__close {
		top: -2.35rem;
	}
}
