/* Area 53 District Map. Inherits the site's fonts; colors are variables so the theme can adjust them. */

.a53dm {
	--a53dm-ink: #0b2545;
	--a53dm-accent: #1d4f8c;
	--a53dm-muted: #4a5a6a;
	--a53dm-line: #c4cfda;
	--a53dm-surface: #ffffff;
	--a53dm-wash: #f2f5f8;
	--a53dm-focus: #1d4f8c;
	color: var(--a53dm-ink);
	margin-block: 1.5rem;
}

.a53dm [hidden] { display: none !important; }

/* Search */
.a53dm-search { margin: 0 0 1rem; max-width: 40rem; }
.a53dm-label { display: block; font-size: 1.25rem; font-weight: 700; margin: 0; }
.a53dm-hint { margin: 0.2rem 0 0.6rem; color: var(--a53dm-muted); }
.a53dm-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.a53dm-input {
	flex: 1 1 14rem;
	min-width: 0;
	font: inherit;
	padding: 0.65rem 0.8rem;
	border: 2px solid var(--a53dm-line);
	border-radius: 6px;
	background: var(--a53dm-surface);
	color: inherit;
}
/* One clear control only: hide the browser's built-in one. */
.a53dm-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.a53dm-input:focus { border-color: var(--a53dm-accent); outline: 3px solid color-mix(in srgb, var(--a53dm-focus) 30%, transparent); outline-offset: 1px; }
.a53dm-btn {
	font: inherit;
	font-weight: 600;
	padding: 0.65rem 1.1rem;
	border-radius: 6px;
	border: 2px solid var(--a53dm-accent);
	background: var(--a53dm-surface);
	color: var(--a53dm-accent);
	cursor: pointer;
}
.a53dm-btn--primary { background: var(--a53dm-accent); color: #fff; }
.a53dm-btn:hover { filter: brightness(1.08); }
.a53dm-btn:focus-visible,
.a53dm-link:focus-visible,
.a53dm-panel a:focus-visible,
.a53dm-panel-close:focus-visible,
.a53dm-list a:focus-visible { outline: 3px solid var(--a53dm-focus); outline-offset: 2px; }
.a53dm-link {
	font: inherit;
	background: none;
	border: 0;
	padding: 0.35rem 0;
	margin-top: 0.35rem;
	color: var(--a53dm-accent);
	text-decoration: underline;
	text-underline-offset: 0.15em;
	cursor: pointer;
}
.a53dm-status { min-height: 1.5em; margin: 0.5rem 0 0; font-weight: 600; }
.a53dm-status:empty { min-height: 0; }
.a53dm-privacy { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--a53dm-muted); }

/* Map */
.a53dm-stage { position: relative; }
.a53dm-map {
	height: clamp(340px, 62vh, 580px);
	border: 1px solid var(--a53dm-line);
	border-radius: 8px;
	background: var(--a53dm-wash);
	z-index: 0;
}
.a53dm--single .a53dm-map { height: clamp(260px, 45vh, 380px); }
.a53dm-map path.leaflet-interactive:focus { outline: none; }
.a53dm-map path.leaflet-interactive:focus-visible { stroke: var(--a53dm-focus); stroke-width: 5px; }

/* District numbers on the map */
.a53dm-num { background: none; border: 0; }
.a53dm-num span {
	display: inline-block;
	transform: translate(-50%, -50%);
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1;
	padding: 0.2rem 0.4rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.9);
	color: var(--a53dm-ink);
	box-shadow: 0 0 0 1px rgba(11, 37, 69, 0.25);
	white-space: nowrap;
	pointer-events: none;
}
.a53dm-num.is-dim span { opacity: 0.4; }
.a53dm-num.is-selected span { background: var(--a53dm-ink); color: #fff; font-size: 0.95rem; }

.a53dm-tip { font: inherit; font-weight: 600; }

/* Info panel: over the map on wide screens, under it on phones */
.a53dm-panel {
	position: absolute;
	left: 12px;
	bottom: 28px;
	z-index: 500;
	width: min(20rem, calc(100% - 24px));
	padding: 1rem 2.5rem 1rem 1.1rem;
	background: var(--a53dm-surface);
	border-left: 5px solid var(--a53dm-ink);
	border-radius: 6px;
	box-shadow: 0 2px 10px rgba(11, 37, 69, 0.2);
}
.a53dm-panel-title { margin: 0; font-size: 1.3rem; line-height: 1.2; }
.a53dm-panel-serves { margin: 0.3rem 0 0.7rem; }
.a53dm-panel-link { font-weight: 600; color: var(--a53dm-accent); }
.a53dm-panel-close {
	position: absolute;
	top: 0.35rem;
	right: 0.35rem;
	width: 2rem;
	height: 2rem;
	font-size: 1.4rem;
	line-height: 1;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--a53dm-muted);
	cursor: pointer;
}
.a53dm-panel-close:hover { background: var(--a53dm-wash); }

@media (max-width: 600px) {
	.a53dm-panel { position: relative; left: auto; bottom: auto; width: auto; margin-top: 0.75rem; box-shadow: none; border: 1px solid var(--a53dm-line); border-left-width: 5px; border-left-color: var(--a53dm-ink); }
}

/* District list */
.a53dm-list {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 0.25rem 1.5rem;
}
.a53dm-list li { padding: 0.55rem 0; border-bottom: 1px solid var(--a53dm-line); }
.a53dm-list a { font-weight: 700; color: var(--a53dm-accent); margin-right: 0.4rem; }
.a53dm-list span { color: var(--a53dm-muted); }

@media (prefers-reduced-motion: reduce) {
	.a53dm-map .leaflet-zoom-anim .leaflet-zoom-animated { transition: none !important; }
}
.a53dm-num.is-hidden { display: none; }
.a53dm-panel .a53dm-panel-link { display: inline-block; margin-bottom: 0.6rem; }
.a53dm-panel .a53dm-panel-link:last-of-type { margin-bottom: 0; }
