/**
 * Leaflet location picker (replaces ACF's Google Map field UI).
 */

.cfd-locpick {
	--cfd-accent: #DC530A;
	--cfd-border: #d8e0de;
	position: relative;
	max-width: 720px;
}

.cfd-locpick__bar {
	display: flex;
	gap: 0.5rem;
	align-items: stretch;
}

.cfd-locpick__search {
	flex: 1 1 auto;
	padding: 0.6rem 0.8rem;
	border: 1px solid var(--cfd-border);
	border-radius: 8px;
	font-size: 0.95rem;
	min-width: 0;
}

.cfd-locpick__search:focus-visible,
.cfd-locpick__clear:focus-visible,
.cfd-locpick__result:focus-visible {
	outline: 2px solid var(--cfd-accent);
	outline-offset: 1px;
}

.cfd-locpick__clear {
	flex: 0 0 auto;
	padding: 0.55rem 0.9rem;
	border: 1px solid var(--cfd-border);
	background: #fff;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.85rem;
}

.cfd-locpick__results {
	position: absolute;
	z-index: 1200;
	left: 0;
	right: 0;
	margin: 0.25rem 0 0;
	padding: 0;
	list-style: none;
	background: #fff;
	border: 1px solid var(--cfd-border);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(20, 31, 29, 0.14);
	max-height: 260px;
	overflow-y: auto;
}

.cfd-locpick__results[hidden] {
	display: none;
}

.cfd-locpick__result {
	display: block;
	width: 100%;
	text-align: left;
	padding: 0.6rem 0.8rem;
	border: 0;
	background: none;
	cursor: pointer;
	font-size: 0.9rem;
	line-height: 1.35;
}

.cfd-locpick__result:hover {
	background: #eef3f1;
}

.cfd-locpick__empty {
	padding: 0.7rem 0.8rem;
	color: var(--cfd-muted, #444);
	font-size: 0.88rem;
}

.cfd-locpick__map {
	height: 320px;
	margin-top: 0.6rem;
	border: 1px solid var(--cfd-border);
	border-radius: 10px;
	overflow: hidden;
	background: #eef3f1;
}

/* CSS pin — no marker images to ship. */
.cfd-locpick__pin span {
	display: block;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--cfd-accent);
	border: 3px solid #fff;
	box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45);
	cursor: grab;
}

/*
 * Read before anything is typed, because the mistake it prevents cannot be
 * undone quietly: a home address entered here goes onto a public map.
 */
.cfd-locpick__privacy {
	margin: 0 0 0.5rem;
	padding: 0.5rem 0.7rem;
	border-left: 3px solid #b26a00;
	background: #fdf4e7;
	font-size: 0.85rem;
	line-height: 1.5;
	font-weight: 500;
	color: #7a4a00;
}

/* What the field is for, said once, above the map. */
.cfd-locpick__hint {
	margin: 0.4rem 0 0.6rem;
	font-size: 0.82rem;
	line-height: 1.5;
	color: var(--cfd-muted, #555);
}

/*
 * Where the pin ended up. A shortfall is never silent: an approximate pin
 * gets an amber rule and an instruction, so the facilitator sees it without
 * the form having to block them.
 */
.cfd-locpick__status {
	margin: 0.5rem 0 0;
	padding: 0.5rem 0.7rem;
	border-left: 3px solid transparent;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--cfd-muted, #444);
	min-height: 1.2em;
}

.cfd-locpick__status:empty {
	display: none;
}

.cfd-locpick__status.is-ok {
	border-left-color: #2e7d32;
	background: #f1f8f1;
	color: #1f5222;
}

.cfd-locpick__status.is-warn {
	border-left-color: #b26a00;
	background: #fdf4e7;
	color: #7a4a00;
	font-weight: 500;
}

.cfd-locpick__status.is-busy {
	border-left-color: var(--cfd-accent, #00BECA);
	background: #f3fbfc;
}
