/* WCM Combobox — the searchable dropdown used for the long Practice lists
 * (see assets/js/combobox.js for the markup it builds and the JS API).
 *
 * Structural + ACSS-token-driven, with the site's current values as fallbacks,
 * so it inherits the live palette like the rest of the plugin's chrome. Tunable
 * per surface through the --wcm-combo-* variables on .wcm-combo:
 *
 *   --wcm-combo-accent / -tint / -line / -bg / -fg / -muted / -radius / -max-h
 *
 * The control (border, background, focus ring) lives on .wcm-combo__control and
 * the inner input is deliberately stripped bare, so surface stylesheets that
 * style `label input` (registration-form.css, checkin.css) can't double up on it.
 */

.wcm-combo {
	--wcm-combo-accent: var( --primary, #0071ce );
	--wcm-combo-tint: var( --primary-ultra-light, rgba( 0, 113, 206, 0.1 ) );
	--wcm-combo-line: var( --base-light, #cedce3 );
	--wcm-combo-bg: #fff;
	--wcm-combo-fg: currentColor;
	--wcm-combo-muted: var( --base-dark, #5d7382 );
	--wcm-combo-radius: var( --radius-s, 6px );
	--wcm-combo-max-h: 17rem;

	position: relative;
	display: block;
	width: 100%;
}

/* ── Control ───────────────────────────────────────────────────────────── */
.wcm-combo__control {
	display: flex;
	flex-direction: row;            /* ACSS defaults flex containers to column */
	align-items: center;
	gap: 0.25rem;
	padding-inline: 0.75em;
	border: var( --border-width, 1px ) solid var( --wcm-combo-line );
	border-radius: var( --wcm-combo-radius );
	background: var( --wcm-combo-bg );
	cursor: text;
	transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.wcm-combo.is-open .wcm-combo__control,
.wcm-combo__control:focus-within {
	border-color: var( --wcm-combo-accent );
	box-shadow: 0 0 0 3px var( --wcm-combo-tint );
}
.wcm-combo.is-empty-list .wcm-combo__control {
	background: var( --base-ultra-light, #f4f7f9 );
	cursor: not-allowed;
}

/* The bare field: every visual affordance belongs to the control around it, so
 * surface rules targeting `label input` have nothing left to fight over. */
.wcm-combo .wcm-combo__input {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 0.6em 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var( --wcm-combo-fg );
	font: inherit;
	line-height: 1.3;
	text-overflow: ellipsis;
}
.wcm-combo .wcm-combo__input:focus,
.wcm-combo .wcm-combo__input:focus-visible {
	outline: none;
	border: 0;
	box-shadow: none;
}
.wcm-combo .wcm-combo__input::placeholder { color: var( --wcm-combo-muted ); opacity: 0.75; }
.wcm-combo .wcm-combo__input:disabled { cursor: not-allowed; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.wcm-combo__clear,
.wcm-combo__caret {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 1.5rem;
	height: 1.5rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var( --wcm-combo-muted );
}
.wcm-combo__ico {
	width: 1rem;
	height: 1rem;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}
.wcm-combo__clear {
	cursor: pointer;
	visibility: hidden;             /* only offer it once there's something to clear */
}
.wcm-combo.has-value .wcm-combo__clear { visibility: visible; }
.wcm-combo__clear:hover,
.wcm-combo__clear:focus-visible {
	background: var( --wcm-combo-tint );
	color: var( --wcm-combo-accent );
	outline: none;
}
.wcm-combo__caret {
	pointer-events: auto;
	cursor: pointer;
	transition: transform 0.16s ease, color 0.16s ease;
}
.wcm-combo.is-open .wcm-combo__caret { transform: rotate( 180deg ); color: var( --wcm-combo-accent ); }
.wcm-combo.is-empty-list .wcm-combo__caret { opacity: 0.4; cursor: not-allowed; }

/* ── Panel ─────────────────────────────────────────────────────────────── */
.wcm-combo__panel {
	position: absolute;
	z-index: 40;
	top: calc( 100% + 0.3rem );
	left: 0;
	right: 0;
	overflow: hidden;
	border: var( --border-width, 1px ) solid var( --wcm-combo-line );
	border-radius: var( --radius, 10px );
	background: var( --wcm-combo-bg );
	box-shadow: 0 0.75rem 2rem rgba( 16, 34, 46, 0.16 );
}
.wcm-combo__list {
	max-height: var( --wcm-combo-max-h );
	overflow-y: auto;
	margin: 0;
	padding: 0.25rem 0;
	list-style: none;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}
.wcm-combo__list::-webkit-scrollbar { width: 0.6rem; }
.wcm-combo__list::-webkit-scrollbar-thumb {
	border: 0.18rem solid transparent;
	border-radius: 1rem;
	background-clip: content-box;
	background-color: var( --wcm-combo-line );
}

/* Sticky A–Z divider — what makes a 200-office list scannable. */
.wcm-combo__letter {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: 0.3rem 0.85rem;
	background: var( --wcm-combo-bg );
	border-bottom: 1px solid var( --base-ultra-light, #eff3f6 );
	color: var( --wcm-combo-muted );
	font-size: var( --text-xs, 0.75rem );
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.wcm-combo__opt {
	position: relative;
	margin: 0;
	padding: 0.5rem 0.85rem 0.5rem 1.6rem;
	line-height: 1.35;
	cursor: pointer;
}
.wcm-combo__opt.is-active { background: var( --wcm-combo-tint ); }
.wcm-combo__opt.is-selected { font-weight: 600; }
/* Tick for the current choice, drawn in the gutter every row reserves. */
.wcm-combo__opt.is-selected::before {
	content: '';
	position: absolute;
	left: 0.7rem;
	top: 50%;
	width: 0.3rem;
	height: 0.55rem;
	border: solid var( --wcm-combo-accent );
	border-width: 0 2px 2px 0;
	transform: translateY( -70% ) rotate( 45deg );
}
.wcm-combo__opt mark {
	background: none;
	color: var( --wcm-combo-accent );
	font-weight: 700;
}

.wcm-combo__note {
	margin: 0;
	padding: 0.85rem;
	color: var( --wcm-combo-muted );
	font-size: var( --text-s, 0.9rem );
	text-align: center;
}

/* Screen-reader-only match count. */
.wcm-combo__live {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset( 50% );
	white-space: nowrap;
}

/* ── Error state ───────────────────────────────────────────────────────── */
.has-error .wcm-combo__control {
	border-color: #c0392b;
	box-shadow: none;
}
.has-error .wcm-combo__control:focus-within { box-shadow: 0 0 0 3px rgba( 192, 57, 43, 0.15 ); }

/* Roomier hit targets where a thumb is doing the picking. */
@media ( max-width: 782px ) {
	.wcm-combo { --wcm-combo-max-h: 15rem; }
	.wcm-combo__opt { padding-block: 0.65rem; }
}
