/**
 * Location autocomplete dropdown (shared by sghr/directory and
 * sghr/home-finder — see assets/js/location-autocomplete.js).
 *
 * The anchor class is added by JS to the input's wrapper, which both
 * host blocks already position-relative for their leading icon.
 */

.sghr-loc-anchor {
	position: relative;
}

.sghr-loc-suggest {
	position: absolute;
	top: calc(100% + 0.375rem);
	left: 0;
	right: 0;
	z-index: 80;
	margin: 0;
	padding: 0.375rem;
	list-style: none;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0.75rem;
	box-shadow: 0 16px 40px rgb(15 35 52 / 0.14);
	max-height: 19rem;
	overflow-y: auto;
}

/* Engine-split scrollbar styling — see assets/css/select-menu.css for
   why the standard properties must be Firefox-only. */
.sghr-loc-suggest::-webkit-scrollbar {
	width: 10px;
}

.sghr-loc-suggest::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--border);
	border-radius: 999px;
	border: 3px solid transparent;
	background-clip: content-box;
}

.sghr-loc-suggest::-webkit-scrollbar-button {
	display: none;
}

@supports (-moz-appearance: none) {
	.sghr-loc-suggest {
		scrollbar-width: thin;
		scrollbar-color: var(--wp--preset--color--border) transparent;
	}
}

.sghr-loc-suggest[hidden] {
	display: none;
}

.sghr-loc-suggest__opt {
	display: flex;
	align-items: baseline;
	gap: 0.75rem;
	margin: 0;
	padding: 0.5rem 0.75rem;
	border-radius: 0.5rem;
	cursor: pointer;
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--ink);
}

.sghr-loc-suggest__opt.is-active {
	background: var(--wp--preset--color--primary-soft);
	color: var(--wp--preset--color--primary);
}

.sghr-loc-suggest__main {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sghr-loc-suggest__meta {
	margin-left: auto;
	flex: none;
	font-size: var(--wp--preset--font-size--xs);
	color: var(--wp--preset--color--ink-muted);
}

.sghr-loc-suggest__opt.is-active .sghr-loc-suggest__meta {
	color: var(--wp--preset--color--primary);
}

/* Visually hidden result-count announcer (self-contained so the
   pattern doesn't depend on a theme-level .screen-reader-text). */
.sghr-loc-suggest__status {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
