/* Guide search block; colours and fonts come from the theme variables. */
.sbd-search {
	position: relative;
}

.sbd-search__form {
	display: flex;
	gap: 0.5rem;
	position: relative;
	flex-wrap: wrap;
}

.sbd-search__input {
	flex: 1 1 12rem;
	min-width: 0;
	padding: 0.5rem 0.75rem;
}

.sbd-search__results {
	position: absolute;
	inset-inline: 0;
	top: 100%;
	z-index: 20;
	margin: 0.25rem 0 0;
	padding: 0;
	list-style: none;
	max-height: 70vh;
	overflow-y: auto;
	background: var(--wp--preset--color--base, #fff);
	color: var(--wp--preset--color--contrast, #111);
	border: 1px solid currentColor;
	border-radius: 4px;
}

.sbd-search__results[hidden] {
	display: none;
}

.sbd-search__results a {
	display: block;
	padding: 0.5rem 0.75rem;
	text-decoration: none;
	color: inherit;
}

.sbd-search__results [aria-selected="true"] a,
.sbd-search__results a:hover {
	background: var(--wp--preset--color--accent-5, rgba(0, 0, 0, 0.08));
}

.sbd-search__title {
	display: block;
	font-weight: 600;
}

.sbd-search__section {
	display: block;
	font-size: 0.8125rem;
	opacity: 0.7;
}

.sbd-search__excerpt {
	display: block;
	font-size: 0.875rem;
}

.sbd-search__empty {
	padding: 0.5rem 0.75rem;
}

/* Trigger variant: a field-looking link that opens the form inside a native dialog. */
.sbd-search__trigger {
	align-items: center;
	display: flex;
	gap: 0.5rem;
	text-decoration: none;
}

.sbd-search__trigger-text {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sbd-search__icon {
	flex: none;
}

.sbd-search__dialog {
	border: 1px solid currentColor;
	border-radius: 0.5rem;
	inset-block: 12vh auto;
	margin-inline: auto;
	max-height: 76vh;
	max-width: none;
	overflow: hidden;
	padding: 0;
	width: min(640px, 92vw);
}

.sbd-search__dialog .sbd-search__form {
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0;
}

.sbd-search__dialog .sbd-search__input {
	background: transparent;
	border: 0;
	flex: 1 1 0;
	outline: 0;
}

.sbd-search__dialog .sbd-search__submit {
	display: none;
}

.sbd-search__dialog .sbd-search__results {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	flex: 1 0 100%;
	margin: 0;
	max-height: 52vh;
	position: static;
}

.sbd-search__close {
	background: none;
	border: 0;
	color: inherit;
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
	padding: 0.25rem 0.5rem;
}
