/**
 * AI Search Button + overlay.
 *
 * Only the trigger and the overlay shell live here. The result list is
 * the search box's, pulled in through the shared `ai-search-box` style
 * handle declared in block.json - see AI_Search::register_blocks().
 */
.ai-search-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0.5em 0.7em;
	color: inherit;
	text-decoration: none;
	border-radius: var( --wp--custom--radius, 6px );
	cursor: pointer;
}

.ai-search-button:hover {
	opacity: 0.75;
}

.ai-search-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ai-search-button__icon {
	flex-shrink: 0;
}

/* ---------------------------------------------------------------- *
 * Overlay shell
 * ---------------------------------------------------------------- */

.ai-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	padding: 12vh 5vw 5vh;
	overflow-y: auto;
	background: rgba( 20, 16, 40, 0.55 );
	backdrop-filter: blur( 3px );
}

body.ai-search-overlay-open {
	overflow: hidden;
}

.ai-search-overlay__inner {
	position: relative;
	max-width: 640px;
	margin: 0 auto;
}

.ai-search-overlay__close {
	position: absolute;
	top: -44px;
	right: 0;
	padding: 4px 10px;
	font-size: 32px;
	line-height: 1;
	color: #fff;
	background: none;
	border: none;
	cursor: pointer;
}

.ai-search-overlay__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* The overlay sits on its own dimmed backdrop rather than on the page,
   so the input is styled for that context: bigger, borderless, lifted. */
.ai-search-overlay .ai-search-box__input {
	flex: 1;
	padding: 0.9em 1.2em;
	font-size: 1.15rem;
	background: var( --ais-surface );
	color: var( --ais-ink );
	border: none;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.25 );
}

/* Inside the overlay the list is a sibling in normal flow, not a
   dropdown floating over the page. */
.ai-search-box__results--overlay {
	position: static;
	margin-top: 10px;
	max-height: 60vh;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.25 );
}

@media ( prefers-reduced-motion: no-preference ) {
	.ai-search-overlay:not( [hidden] ) {
		animation: ai-search-overlay-in 150ms ease;
	}

	@keyframes ai-search-overlay-in {
		from {
			opacity: 0;
		}
	}
}
