/* ──────────────────────────────────────────────────────────────────────────
   Neighborhood Map Block
   Intro column (eyebrow/heading/body/CTA) + a two-panel interactive area:
   a neighborhood list (Cards or Numbered Index) synced to pin markers on a
   map image. Palette tokens throughout except two panel backgrounds
   (.uw-nm__map, .uw-nm--numbered .uw-nm__list-panel) which use literal hex
   from Figma per explicit instruction.
   ────────────────────────────────────────────────────────────────────────── */

.uw-nm {
	position: relative;
	z-index: 1;
	color: var(--wp--preset--color--deep-navy);
}
.uw-nm__inner {
	padding-top: clamp(56px, 7vw, 120px);
	padding-bottom: clamp(56px, 7vw, 120px);
	display: flex;
	flex-direction: column;
	gap: clamp(2rem, 4vw, 64px);
}

/* ── Header (eyebrow/heading + body/CTA) ── */
.uw-nm__header-inner {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: clamp(2rem, 5vw, 80px);
	flex-wrap: wrap;
}
.uw-nm__header-heading-col { max-width: 58%; }
.uw-nm__header-intro-col {
	flex: 0 1 471px;
	display: flex;
	flex-direction: column;
	gap: clamp(1.5rem, 2vw, 32px);
	align-items: flex-start;
}
.uw-nm__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 1.25rem;
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--body);
	line-height: 1;
	text-transform: uppercase;
}
.uw-nm__eyebrow-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--wp--preset--color--red); flex: none; }
.uw-nm__heading {
	margin: 0;
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-weight: 600;
	font-size: clamp(56px, 7vw, var(--wp--preset--font-size--heading-1));
	line-height: 0.8;
	letter-spacing: -0.01em;
}
.uw-nm__body {
	margin: 0;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-weight: 400;
	font-size: var(--wp--preset--font-size--body);
	line-height: 1.35;
}
.uw-nm__cta { text-decoration: none; }

/* ── Panels: fixed height (880px Cards / 820px Numbered), children fill via height:100% ── */
/* content-box so the bottom padding adds space below the fixed height instead
   of eating into it. */
.uw-nm__panels {
	display: flex;
	gap: clamp(1.5rem, 3vw, 48px);
	box-sizing: content-box;
	height: 880px;
	padding-bottom: 80px;
}
.uw-nm--cards .uw-nm__panels {
	gap: 0;
}

.uw-nm__list-panel { flex: 0 1 40%; min-width: 0; height: 100%; overflow: hidden; }
.uw-nm__map-panel { flex: 1 1 60%; min-width: 0; height: 100%; }

/* Numbered Index: list + map read as one fused card, map on the left. */
.uw-nm--numbered .uw-nm__panels { gap: 0; height: 820px; }
.uw-nm--numbered .uw-nm__list-panel {
	order: 2;
	background: #F1F0ED;
	border-radius: 0 20px 20px 0;
	overflow: hidden;
}
.uw-nm--numbered .uw-nm__map-panel { order: 1; }
.uw-nm--numbered .uw-nm__index {
	background: transparent;
	border-radius: 0;
	padding: 20px 60px;
	justify-content: center;
	max-height: none;
	height: 100%;
}

/* ── Cards list style ── */
.uw-nm__cards {
	list-style: none;
	margin: 0;
	padding: 0;
	height: 100%;
	overflow-y: auto;
	scroll-behavior: smooth;
}
/* Thin cobalt scrollbar, both engines. */
.uw-nm__cards,
.uw-nm__index {
	scrollbar-width: thin;
	scrollbar-color: var(--wp--preset--color--cobalt-blue) var(--wp--preset--color--parchment);
}
.uw-nm__cards::-webkit-scrollbar,
.uw-nm__index::-webkit-scrollbar {
	width: 6px;
}
.uw-nm__cards::-webkit-scrollbar-track,
.uw-nm__index::-webkit-scrollbar-track {
	background: var(--wp--preset--color--parchment);
	border-radius: 3px;
}
.uw-nm__cards::-webkit-scrollbar-thumb,
.uw-nm__index::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--cobalt-blue);
	border-radius: 3px;
}
.uw-nm__card {
	display: flex;
	gap: 20px;
	padding: 20px;
	border-radius: 12px;
	transition: background-color 0.2s ease;
}
.uw-nm__card:not(:first-child) {
	border-top: 1px dashed color-mix(in srgb, var(--wp--preset--color--deep-navy) 12%, transparent);
}
.uw-nm__card.is-active,
.uw-nm__card:hover {
	background: var(--wp--preset--color--parchment);
	border-top-color: transparent;
}
.uw-nm__card.is-active + .uw-nm__card,
.uw-nm__card:hover + .uw-nm__card {
	border-top-color: transparent;
}
.uw-nm__card-thumb {
	flex: 0 0 200px;
	width: 200px;
	height: 160px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--wp--preset--color--porcelain);
}
.uw-nm__card-thumb-placeholder { width: 100%; height: 100%; }
.uw-nm__card-img,
.uw-nm__card-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.uw-nm__card-body {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: flex-start;
}
.uw-nm__card-text { display: flex; flex-direction: column; gap: 16px; }
.uw-nm__card-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-weight: 600;
	font-size: 24px;
	line-height: 1;
}
.uw-nm__card-desc {
	margin: 0;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--deep-navy);
	padding-bottom: 10px;
}
/* Underline-sweep animation comes from the shared .uw-read-more rules
   (assets/css/custom-styles.css) — only typography/color overridden here. */
.uw-nm__card .uw-nm__card-link {
	font-family: var(--wp--preset--font-family--test-national-2-condensed);
	font-weight: 500;
	font-size: 20px;
	line-height: 1;
	color: var(--wp--preset--color--deep-navy);
}

/* ── Numbered index list style ── */
.uw-nm__index {
	list-style: none;
	margin: 0;
	padding: clamp(16px, 2vw, 28px);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	background: var(--wp--preset--color--parchment);
	border-radius: 24px;
	max-height: clamp(400px, 60vh, 620px);
	overflow-y: auto;
	scroll-behavior: smooth;
}
.uw-nm__index-item {
	display: flex;
	align-items: center;
	gap: 16px;
	flex: none;
}
.uw-nm__index-item.is-active .uw-nm__index-link { font-weight: 600; }
.uw-nm__index-badge {
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--wp--preset--color--cobalt-blue);
	color: var(--wp--preset--color--white);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: 15px;
	font-weight: 400;
	line-height: 1;
}
.uw-nm__index-link {
	color: var(--wp--preset--color--deep-navy);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: 18px;
	font-weight: 400;
	line-height: 1;
}

/* ── Map + pins ── */
.uw-nm__map {
	position: relative;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #F6F5F2;
	display: flex;
	justify-content: center;
	border-radius: 0 10px 10px 0;
}
.uw-nm--numbered .uw-nm__map { border-radius: 24px 0 0 24px; }
/* Locked to the uploaded image's real aspect-ratio (set inline by render.php
   / index.js) so pins stay aligned regardless of the outer box's width. */
.uw-nm__map-frame { position: relative; height: 100%; }
.uw-nm__map-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.uw-nm__map-notice {
	margin: 12px 0 0;
	font-family: var(--wp--preset--font-family--pp-mori);
	font-size: 14px;
	color: color-mix(in srgb, var(--wp--preset--color--deep-navy) 70%, transparent);
}

/* ── Editor-only: pin assignment button + loading state ── */
.uw-nm__assign-btn {
	margin-top: 6px;
	padding: 4px 10px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--deep-navy) 25%, transparent);
	border-radius: 6px;
	background: var(--wp--preset--color--white);
	font-size: 12px;
	cursor: pointer;
}
.uw-nm__loading { display: flex; justify-content: center; padding: 40px 0; }

.uw-nm-tabs-field { margin-bottom: 24px; }
.uw-nm-tabs-field__label {
	display: block;
	margin-bottom: 8px;
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
}
.uw-nm-tabs { width: 100%; }
.uw-nm-tabs .components-button { flex: 1 1 0; justify-content: center; }
.uw-nm-tabs-field__help { margin: 8px 0 0; font-size: 12px; color: #757575; }

.uw-nm__pin {
	position: absolute;
	transform: translate(-50%, -50%);
	z-index: 10;
	padding: 6px;
	margin: 0;
	border: 0;
	background: none;
	cursor: pointer;
	line-height: 0;
	text-decoration: none;
	display: block;
}
.uw-nm__pin:focus-visible {
	outline: 2px solid var(--wp--preset--color--cobalt-blue);
	outline-offset: 3px;
	border-radius: 50%;
}
.uw-nm__pin-dot {
	position: relative;
	display: block;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--wp--preset--color--white);
	border: 2.5px solid var(--wp--preset--color--cobalt-blue);
	transition: transform 0.2s ease;
}
.uw-nm__pin-dot::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 15px;
	height: 15px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: var(--wp--preset--color--cobalt-blue);
}
.uw-nm__pin-label {
	display: none;
	position: absolute;
	bottom: 131%;
	left: 50%;
	transform: translateX(-50%);
	background: var(--wp--preset--color--red);
	color: var(--wp--preset--color--white);
	padding: 12px 20px;
	border-radius: 0;
	font-family: var(--wp--preset--font-family--marr-sans-cond);
	font-size: 19px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
}
.uw-nm__pin-label::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 12px solid transparent;
	border-right: 12px solid transparent;
	border-top: 12px solid var(--wp--preset--color--red);
}
.uw-nm__pin.is-active { z-index: 20; }
.uw-nm__pin.is-active .uw-nm__pin-label { display: block; }

.uw-nm__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.uw-nm__mobile-tabs { display: none; }

/* ── Tablet and mobile (1024px and below): the map and list panels stack full
   width, map first then list, and the Map / List tabs show. Fixed desktop
   heights no longer apply. ── */
@media (max-width: 1024px) {
	.uw-nm__panels,
	.uw-nm--numbered .uw-nm__panels { flex-direction: column; height: auto; }
	.uw-nm__panels { padding-bottom: 0; }
	.uw-nm__list-panel { flex: none; width: 100%; height: auto; order: 2; }
	.uw-nm__map-panel { flex: none; width: 100%; height: auto; order: 1; }
	.uw-nm__map { height: auto; aspect-ratio: 3 / 2; border-radius: 10px; }
	.uw-nm__cards,
	.uw-nm--numbered .uw-nm__index {
		height: auto;
		max-height: 480px;
		overflow-y: auto;
		padding: 20px 30px;
	}
	.uw-nm--numbered .uw-nm__list-panel { border-radius: 0 0 20px 20px; }
	.uw-nm--numbered .uw-nm__map { border-radius: 24px 24px 0 0; }
	.uw-nm--mobile-tabs.uw-nm--numbered .uw-nm__map { border-radius: 24px; }
	.uw-nm--numbered .uw-nm__index { padding: 40px 30px; }

	/* Mobile Layout: "Map / List Tabs" — one panel visible at a time, toggled
	   by the pill switcher below the header, instead of stacking both. */
	.uw-nm__mobile-tabs { display: none; }
	.uw-nm--mobile-tabs .uw-nm__mobile-tabs {
		display: flex;
		gap: 4px;
		padding: 4px;
		margin: 20px 0 -10px;
		background: var(--wp--preset--color--parchment);
		border-radius: 12px;
	}
	.uw-nm__mobile-tab {
		flex: 1 1 0;
		padding: 16px 20px;
		border: 1px solid transparent;
		border-radius: 8px;
		background: none;
		font-family: var(--wp--preset--font-family--marr-sans-cond);
		font-weight: 600;
		font-size: 18px;
		line-height: 1;
		color: var(--wp--preset--color--deep-navy);
		cursor: pointer;
	}
	.uw-nm__mobile-tab.is-active {
		background: #0A0A51;
		border-color: var(--wp--preset--color--deep-navy);
		color: var(--wp--preset--color--white);
	}
	.uw-nm--mobile-tabs .uw-nm__panels { gap: 0; }
	.uw-nm--mobile-tabs .uw-nm__list-panel,
	.uw-nm--mobile-tabs .uw-nm__map-panel { display: none; }
	.uw-nm--mobile-tabs .uw-nm__list-panel.is-tab-active,
	.uw-nm--mobile-tabs .uw-nm__map-panel.is-tab-active { display: block; }
	.uw-nm--mobile-tabs .uw-nm__cards,
	.uw-nm--mobile-tabs .uw-nm__index { max-height: none; height: 758px; }
	.uw-nm--mobile-tabs .uw-nm__map { height: 400px; aspect-ratio: auto; } 
	.uw-nm__panels:has(.is-tab-active), .is-tab-active .uw-nm__cards, .is-tab-active .uw-nm__index { height: auto; }
	.uw-nm--numbered .is-tab-active.uw-nm__list-panel { border-radius: 20px; }
}

/* ── Mobile (767px and below): stacked header, smaller heading, compact cards ── */
@media (max-width: 767px) {
	.uw-nm__header { flex-direction: column; gap: 2rem; }
	.uw-nm__header-intro-col { flex: none; width: 100%; }
	.uw-nm__header-heading-col { max-width: 100%; }
	.uw-nm__heading { font-size: clamp(48px, 12vw, 72px); }

	/* Cards style, compact mobile card. */
	.uw-nm__card { padding: 12px; }
	.uw-nm__card-thumb { flex: 0 0 141px; width: 141px; height: 130px; }
	.uw-nm__card-body { gap: 40px; }
	.uw-nm__card-text { gap: 12px; }
	.uw-nm__card-title { font-size: 20px; }
	.uw-nm__card-desc { font-size: 14px; }
	.uw-nm__card .uw-nm__card-link { font-size: 18px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
	.uw-nm__card,
	.uw-nm__index-item,
	.uw-nm__pin-dot,
	.uw-nm__cards,
	.uw-nm__index {
		transition: none;
		scroll-behavior: auto;
	}
}
