/**
 * Scoped Search — live results panel.
 *
 * Hardcoded to Ollie's palette slugs (main / base / border-light /
 * tertiary / main-accent) with hex fallbacks for sites whose theme
 * doesn't define those slugs. The panel reads as the same standard
 * "card" regardless of whether the host theme is light or dark; we
 * intentionally don't try to adapt to the surrounding scope.
 */

/* Panel uses `position: fixed` with JS-computed coordinates anchored to
   the input rect. This escapes any ancestor `overflow: clip|hidden` —
   common with `wp-block-cover` and other layout wrappers — without
   needing to wrestle each parent's CSS. The runtime updates `top`,
   `left`, `width` on scroll + resize while the panel is open. */
.kc-live-search-panel {
	position: fixed;
	z-index: 1000;
	display: none;
	max-height: min( 60vh, 480px );
	overflow-y: auto;
	padding: 0.25rem;
	font-size: var( --wp--preset--font-size--base, 1rem );
	background-color: var( --wp--preset--color--base, #ffffff );
	color: var( --wp--preset--color--main, #1e1b25 );
	border: 1px solid var( --wp--preset--color--border-light, #e3e3f0 );
	border-radius: 12px;
	box-shadow:
		0 12px 32px rgba( 0, 0, 0, 0.12 ),
		0 2px 6px rgba( 0, 0, 0, 0.06 );
}

.kc-live-search-panel.is-open {
	display: block;
}

/* Result row */

.kc-live-search-result {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.6rem 0.75rem;
	border-radius: 8px;
	text-decoration: none;
	color: inherit;
}

.kc-live-search-result:hover,
.kc-live-search-result.is-active,
.kc-live-search-result:focus-visible {
	background-color: var( --wp--preset--color--tertiary, #f8f7fc );
	outline: none;
}

.kc-live-search-result__body {
	flex: 1;
	min-width: 0;
}

.kc-live-search-result__title {
	font-weight: 600;
	line-height: 1.3;
	margin-bottom: 0.15rem;
}

.kc-live-search-result__excerpt {
	opacity: 0.75;
	font-size: 0.875em;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	line-clamp: 2;
	overflow: hidden;
}

.kc-live-search-result__chip {
	flex: none;
	font-size: 0.75em;
	font-weight: 500;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	background-color: var( --wp--preset--color--main-accent, #d4d4ec );
	color: var( --wp--preset--color--main, #1e1b25 );
	align-self: center;
	white-space: nowrap;
}

/* Recent searches: title only, no excerpt or chip. */
.kc-live-search-result--recent .kc-live-search-result__title {
	font-weight: 500;
}

.kc-live-search-recent-header,
.kc-live-search-empty {
	padding: 0.6rem 0.75rem;
	font-size: 0.875em;
	opacity: 0.7;
}

.kc-live-search-recent-header {
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: 0.75em;
}

/* "View all" link at the bottom of the panel. */
.kc-live-search-more {
	display: block;
	padding: 0.6rem 0.75rem;
	margin-top: 0.25rem;
	border-top: 1px solid var( --wp--preset--color--border-light, #e3e3f0 );
	font-weight: 500;
	font-size: 0.875em;
	text-align: center;
	text-decoration: none;
	color: inherit;
	border-radius: 0 0 8px 8px;
}

.kc-live-search-more:hover,
.kc-live-search-more:focus-visible {
	background-color: var( --wp--preset--color--tertiary, #f8f7fc );
	outline: none;
}

/* Visually-hidden ARIA live region for result count announcements. */
.kc-live-search-status {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
	border: 0;
}
