/* ZIP Claim Map — front end
   Namespaced under .zipmap so themes are left alone. */

.zipmap {
	--zipmap-height: 640px;
	--zipmap-map-width: 80%;

	--zipmap-ink: #17201c;
	--zipmap-muted: #5e6b66;
	--zipmap-panel: #eef1f0;
	--zipmap-panel-edge: #cfd8d4;
	--zipmap-rule: #dde3e0;
	--zipmap-accent: #1f7a3f;
	--zipmap-focus: #c8471f;

	--zipmap-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	--zipmap-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	display: flex;
	align-items: stretch;
	width: 100%;
	height: var(--zipmap-height);
	border: 1px solid var(--zipmap-panel-edge);
	background: var(--zipmap-panel);
	color: var(--zipmap-ink);
	font-family: var(--zipmap-sans);
	font-size: 15px;
	line-height: 1.45;
	overflow: hidden;
	box-sizing: border-box;
}

.zipmap *,
.zipmap *::before,
.zipmap *::after {
	box-sizing: inherit;
}

/* ------------------------------------------------------------ map ---- */

.zipmap__map {
	position: relative;
	flex: 0 0 var(--zipmap-map-width);
	min-width: 0;
	background: #dfe5e3;
}

.zipmap__canvas {
	position: absolute;
	inset: 0;
}

.zipmap__legend {
	position: absolute;
	left: 10px;
	top: 10px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid var(--zipmap-panel-edge);
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--zipmap-muted);
}

.zipmap__swatch {
	width: 11px;
	height: 11px;
	display: inline-block;
	border: 1px solid var(--zipmap-panel-edge);
}

.zipmap__swatch--claimed {
	background: var(--zipmap-accent);
	border-color: var(--zipmap-accent);
}

.zipmap__swatch--open {
	background: transparent;
	border-color: #8b9691;
}

.zipmap__swatch:not(:first-child) {
	margin-left: 8px;
}

/* -------------------------------------------------------- sidebar ---- */

.zipmap__sidebar {
	flex: 1 1 auto;
	min-width: 240px;
	display: flex;
	flex-direction: column;
	border-left: 1px solid var(--zipmap-panel-edge);
	background: var(--zipmap-panel);
	overflow: hidden;
}

.zipmap__search {
	padding: 16px 16px 14px;
	border-bottom: 1px solid var(--zipmap-rule);
}

.zipmap__label {
	display: block;
	margin: 0 0 8px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--zipmap-muted);
}

.zipmap__field {
	display: flex;
	gap: 6px;
}

.zipmap__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 9px 10px;
	border: 1px solid #b3bfba;
	background: #fff;
	color: var(--zipmap-ink);
	font-family: var(--zipmap-mono);
	font-size: 16px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.08em;
	border-radius: 0;
}

.zipmap__input:focus-visible,
.zipmap__button:focus-visible,
.zipmap__tag:focus-visible,
.zipmap__back:focus-visible {
	outline: 2px solid var(--zipmap-focus);
	outline-offset: 1px;
}

.zipmap__button {
	flex: 0 0 auto;
	padding: 9px 12px;
	border: 1px solid var(--zipmap-accent);
	background: var(--zipmap-accent);
	color: #fff;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	border-radius: 0;
}

.zipmap__button:hover {
	background: #17612f;
	border-color: #17612f;
}

.zipmap__status {
	margin: 8px 0 0;
	min-height: 1.2em;
	font-size: 12.5px;
	color: var(--zipmap-muted);
}

.zipmap__status.is-error {
	color: #96361a;
}

/* ---------------------------------------------------------- info ----- */

.zipmap__info {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px 16px 20px;
}

.zipmap__info:focus {
	outline: none;
}

.zipmap__count {
	display: flex;
	align-items: baseline;
	gap: 8px;
	padding-bottom: 12px;
	margin-bottom: 4px;
	border-bottom: 1px solid var(--zipmap-rule);
}

.zipmap__count-number {
	font-family: var(--zipmap-mono);
	font-size: 30px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	color: var(--zipmap-accent);
}

.zipmap__count-label {
	font-size: 11px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--zipmap-muted);
}

.zipmap__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.zipmap__item {
	padding: 12px 0;
	border-bottom: 1px solid var(--zipmap-rule);
}

.zipmap__item:last-child {
	border-bottom: 0;
}

.zipmap__name {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
}

.zipmap__zips {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.zipmap__tag {
	padding: 3px 7px 3px 6px;
	border: 1px solid var(--zipmap-panel-edge);
	border-left: 3px solid var(--zipmap-accent);
	background: #fff;
	color: var(--zipmap-ink);
	font-family: var(--zipmap-mono);
	font-size: 12.5px;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.04em;
	cursor: pointer;
	border-radius: 0;
}

.zipmap__tag:hover {
	background: var(--zipmap-accent);
	border-color: var(--zipmap-accent);
	color: #fff;
}

.zipmap__back {
	margin: 0 0 12px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--zipmap-muted);
	font-family: inherit;
	font-size: 12px;
	letter-spacing: 0.04em;
	cursor: pointer;
}

.zipmap__back:hover {
	color: var(--zipmap-ink);
}

.zipmap__card {
	border-top: 3px solid #b3bfba;
	padding-top: 12px;
}

.zipmap__card.is-claimed {
	border-top-color: var(--zipmap-accent);
}

.zipmap__eyebrow {
	margin: 0 0 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--zipmap-muted);
}

.zipmap__zip-big {
	margin: 0 0 10px;
	font-family: var(--zipmap-mono);
	font-size: 34px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.06em;
	line-height: 1;
}

.zipmap__contact {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	font-size: 14px;
}

.zipmap__contact li {
	padding: 3px 0;
}

.zipmap__contact a {
	color: var(--zipmap-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}

.zipmap__note {
	margin: 10px 0 0;
	padding-left: 10px;
	border-left: 2px solid var(--zipmap-rule);
	font-size: 13.5px;
	color: var(--zipmap-muted);
}

.zipmap__muted {
	margin: 12px 0 0;
	color: var(--zipmap-muted);
	font-size: 13.5px;
}

/* -------------------------------------------------------- narrow ----- */

@media (max-width: 860px) {
	.zipmap {
		flex-direction: column;
		height: auto;
	}

	.zipmap__map {
		flex: 0 0 auto;
		height: var(--zipmap-height);
	}

	.zipmap__sidebar {
		border-left: 0;
		border-top: 1px solid var(--zipmap-panel-edge);
		max-height: 420px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.zipmap * {
		transition: none !important;
	}
}
