/**
 * Housing company combobox.
 *
 * autoComplete.js ships its own stylesheet, which is deliberately NOT loaded. That file is
 * demo styling: a fixed 370px width, pink borders and placeholder, and a magnifying glass
 * background image. It fights the theme's form styles. Only the positioning the widget
 * genuinely needs is reproduced below, using the theme's input border and radius.
 */

/* Wrapper the library inserts around the search input. Block, not inline-block, so the
   input can still be full width. Positioned, so the results list can anchor to it. */
.autoComplete_wrapper {
	display: block;
	position: relative;
}

.autoComplete_wrapper > ul {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 2;
	max-height: 16rem;
	margin: 0.25rem 0 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
	background-color: #fff;
	border: 1px solid #8e8e8e;
	border-radius: 2px;
}

/* The library toggles the hidden attribute. Its own stylesheet only faded the list out,
   which left it in the accessibility tree and clickable. */
.autoComplete_wrapper > ul:empty,
.autoComplete_wrapper > ul[hidden] {
	display: none;
}

.autoComplete_wrapper > ul > li {
	padding: 0.5em 0.75em;
	cursor: pointer;
}

/* Keyboard and pointer highlight share one style, dark enough to satisfy the 3:1 non-text
   contrast requirement against the white list background. A faint grey does not. */
.autoComplete_wrapper > ul > li:hover,
.autoComplete_wrapper > ul > li[aria-selected="true"] {
	background-color: #000;
	color: #fff;
}

.gf-housing-company-no-results {
	padding: 0.5em 0.75em;
}

/* Instruction text under the field, referenced by aria-describedby. */
.gf-housing-company-hint {
	display: block;
	font-size: 0.875em;
	margin-top: 0.25em;
}

/* Live region announcing result counts and selections to screen readers. */
.gf-housing-company-status {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}
