/* =========================================================================
   REGION MAP — Vancouver Island Resource Directory Navigator
   ========================================================================= */

#cpc-region-map {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	max-width: var(--cpc-max-width);
	margin: 0 auto;
	padding: 0 24px;
}

.cpc-rm-leaflet {
	flex: 1 1 55%;
	min-height: 480px;
	border-radius: var(--cpc-radius);
	overflow: hidden;
	border: 1px solid var(--cpc-border);
	position: relative;
}

/* Override Leaflet cursors */
.cpc-rm-leaflet .leaflet-container { cursor: default !important; }
.cpc-rm-leaflet .leaflet-grab { cursor: default !important; }
.cpc-rm-leaflet .leaflet-interactive { cursor: pointer !important; }

/* Tone down Leaflet attribution */
.cpc-rm-leaflet .leaflet-control-attribution {
	font-size: 10px;
	opacity: 0.7;
}

/* ── Region list overlay (pill buttons on map) ── */
.cpc-rm-region-list {
	position: absolute;
	top: 80px;
	left: 12px;
	z-index: 800;
	display: flex;
	flex-direction: column;
	gap: 2px;
	max-height: calc(100% - 92px);
	overflow: hidden;
}

.cpc-rm-region-item {
	display: block;
	width: auto;
	padding: 5px 10px;
	border: none;
	background: var(--region-color, #999);
	font-family: "foco", -apple-system, sans-serif;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #fff;
	text-align: left;
	cursor: pointer;
	border-radius: 4px;
	transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
	white-space: nowrap;
	line-height: 1.3;
	opacity: 0.85;
	text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.cpc-rm-region-item:hover,
.cpc-rm-region-item.is-hover {
	opacity: 1;
	transform: translateX(3px);
	box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.cpc-rm-region-item.is-active {
	opacity: 1;
	transform: translateX(3px);
	box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 0 0 2px rgba(255,255,255,0.5);
}

/* ── Region name labels on main page map ── */
.cpc-rm-label {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	white-space: nowrap;
}
.cpc-rm-label span {
	font-family: "foco", -apple-system, sans-serif;
	font-size: 11px;
	font-weight: 700;
	text-shadow:
		0 0 3px rgba(255,255,255,0.95),
		0 0 6px rgba(255,255,255,0.8),
		0 1px 2px rgba(255,255,255,0.9);
	pointer-events: none;
	line-height: 1.3;
	text-align: center;
	display: block;
	transition: font-size 0.2s ease;
}

.cpc-rm-label.is-hover span,
.cpc-rm-label.is-active span {
	font-size: 13px;
}
.cpc-rm-label.is-active span {
	text-shadow:
		0 0 4px rgba(255,255,255,1),
		0 0 10px rgba(255,255,255,0.9),
		0 1px 3px rgba(255,255,255,1);
}

/* ── City dot + label markers (landing pages only) ── */
.cpc-rm-city {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	white-space: nowrap;
}
.cpc-rm-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 4px rgba(0,0,0,0.4);
	vertical-align: middle;
	position: absolute;
	top: 0;
	left: 0;
}
.cpc-rm-city-name {
	font-family: "foco", -apple-system, sans-serif;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.01em;
	text-shadow:
		-1px -1px 0 #fff, 1px -1px 0 #fff,
		-1px  1px 0 #fff, 1px  1px 0 #fff,
		0 0 6px rgba(255,255,255,1),
		0 0 12px rgba(255,255,255,0.8);
	pointer-events: none;
	line-height: 1;
	display: block;
	position: absolute;
	top: -5px;
	left: 14px;
}

/* Landing page city labels — plum on green, extra punch */
.cpc-rm-city-lp .cpc-rm-dot {
	border-color: #fff;
	box-shadow: 0 0 5px rgba(0,0,0,0.5);
}
.cpc-rm-city-lp .cpc-rm-city-name {
	font-size: 16px;
	text-shadow:
		-2px -2px 0 #fff, 2px -2px 0 #fff,
		-2px  2px 0 #fff, 2px  2px 0 #fff,
		-1px  0   0 #fff, 1px  0   0 #fff,
		 0   -1px 0 #fff, 0    1px 0 #fff,
		0 0 8px rgba(255,255,255,1),
		0 0 16px rgba(255,255,255,0.9);
}

/* ── HQ heart marker (landing pages only) ── */
.cpc-rm-hq {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	white-space: nowrap;
}
.cpc-rm-hq-heart {
	font-size: 22px;
	color: #E91E7E;
	text-shadow:
		-1px -1px 0 #fff, 1px -1px 0 #fff,
		-1px  1px 0 #fff, 1px  1px 0 #fff,
		0 0 4px rgba(255,255,255,1);
	position: absolute;
	top: 0;
	left: 0;
	line-height: 1;
}
.cpc-rm-hq-label {
	font-family: "foco", -apple-system, sans-serif;
	font-size: 11px;
	font-weight: 800;
	color: #E91E7E;
	letter-spacing: 0.05em;
	text-shadow:
		-1px -1px 0 #fff, 1px -1px 0 #fff,
		-1px  1px 0 #fff, 1px  1px 0 #fff;
	position: absolute;
	top: 2px;
	left: 24px;
	line-height: 1;
}

/* ── Hide old dropdown (replaced by overlay list) ── */
.cpc-rm-select-row {
	display: none !important;
}

/* ── Panel ── */
.cpc-rm-panel-wrap {
	flex: 1 1 40%;
	min-width: 280px;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.cpc-rm-panel {
	flex: 1;
	background: var(--cpc-bg-soft);
	border-radius: var(--cpc-radius);
	padding: 24px;
	min-height: 420px;
	border: 1px solid var(--cpc-border);
	transition: background-color 0.25s ease;
}

.cpc-rm-panel h3 {
	font-size: 1.3rem;
	font-weight: 600;
	color: var(--cpc-plum);
	margin: 0 0 4px;
}

.cpc-rm-subtitle {
	font-size: 0.875rem;
	color: var(--cpc-text-light);
	margin: 0 0 20px;
}

.cpc-rm-dir-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.cpc-rm-dir-list li {
	margin: 0 0 8px;
}

.cpc-rm-dir-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	min-height: 44px;
	background: var(--cpc-bg);
	border: 1px solid var(--cpc-border);
	border-left: 3px solid var(--cpc-fuchsia);
	border-radius: var(--cpc-radius);
	color: var(--cpc-plum) !important;
	font-size: 0.9375rem;
	text-decoration: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cpc-rm-dir-link:hover {
	border-color: var(--cpc-fuchsia);
	box-shadow: 0 2px 8px rgba(126, 44, 101, 0.1);
	color: var(--cpc-fuchsia) !important;
}

.cpc-rm-dir-link:focus-visible {
	outline: 3px solid var(--cpc-fuchsia);
	outline-offset: 2px;
}

.cpc-rm-dir-title {
	flex: 1;
	font-weight: 600;
}

.cpc-rm-dir-arrow {
	font-size: 1.25rem;
	color: var(--cpc-text-light);
	line-height: 1;
}

.cpc-rm-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 400px;
	text-align: center;
	color: var(--cpc-text-light);
	font-size: 0.9375rem;
	line-height: 1.6;
}

/* ── Responsive ── */
@media (max-width: 900px) {
	#cpc-region-map {
		flex-direction: column;
	}
	.cpc-rm-leaflet {
		min-height: 350px;
		width: 100%;
	}
	.cpc-rm-panel-wrap {
		width: 100%;
	}
	.cpc-rm-panel {
		min-height: auto;
	}
	.cpc-rm-empty {
		min-height: 120px;
	}
	.cpc-rm-region-item {
		padding: 3px 8px;
		font-size: 0.6875rem;
	}
}

@media (max-width: 600px) {
	#cpc-region-map {
		gap: 16px;
		padding: 0 16px;
	}
	.cpc-rm-leaflet {
		min-height: 280px;
	}
	.cpc-rm-panel {
		padding: 16px;
	}
	.cpc-rm-region-list {
		top: auto;
		bottom: 28px;
		left: 8px;
		right: 8px;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 3px;
		max-height: none;
		justify-content: center;
	}
	.cpc-rm-region-item {
		padding: 3px 6px;
		font-size: 0.625rem;
	}
}
