/* ABOUTME: Styles for the [pslp_school_map] NC partner schools SVG map. */
/* ABOUTME: Map container, pins, hover states, tooltip, and the link to the explorer. */

/* Wrapper holds the map image and the "Browse all schools" link, which cannot live inside
   role="img" (its children are presentational). */
.pslp-map-wrap {
	width: 100%;
	align-self: stretch;
	max-width: 100%;
}

.pslp-map {
	position: relative;
	/* Fill the parent surface. Without an explicit width the inline SVG
	   collapses to its 300px default, and a flex parent centers it. */
	width: 100%;
	align-self: stretch;
	max-width: 100%;
	margin: 0.5rem auto;
}

.pslp-map__svg {
	display: block;
	width: 100%;
	height: auto;
}

.pslp-map__outline {
	transition: fill 0.2s ease;
}

/* Pins are pointer-only (the explorer is the keyboard and screen reader path), so no focus styles. */
.pslp-map__pin {
	cursor: pointer;
}

.pslp-map__pin--interactive,
.pslp-map__pin--has-url {
	cursor: pointer;
}

.pslp-map__dot {
	transition: r 0.15s ease, filter 0.15s ease;
}

.pslp-map__pin:hover .pslp-map__dot,
.pslp-map__pin.is-active .pslp-map__dot {
	r: 7;
	filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
}

.pslp-map__hit-area {
	pointer-events: all;
}

/* Tooltip: hoverable (pointer events on) and dismissible with Escape (JS), per WCAG 1.4.13. */
.pslp-map__tooltip {
	position: absolute;
	display: none;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 0.5rem;
	padding: 0.625rem 0.875rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	z-index: 10;
	min-width: 160px;
	max-width: 260px;
	transform: translate(-50%, -100%);
}

/* Transparent bridge over the gap down to the pin, so moving onto the tooltip never leaves it. */
.pslp-map__tooltip::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	width: 2.5rem;
	height: 10px;
	transform: translateX(-50%);
}

/* Uses each school's Brand Color (ACF) as an accent bar; the name stays dark for contrast. */
.pslp-map__tooltip--has-brand {
	border-top-width: 6px;
	border-top-style: solid;
	border-top-color: var(--pslp-map-brand);
}

.pslp-map__tooltip--has-brand .pslp-map__tooltip-name {
	font-weight: 700;
}

.pslp-map__tooltip.is-visible {
	display: flex;
	flex-direction: column;
	gap: 0.125rem;
}

.pslp-map__tooltip-name {
	font-size: 0.9rem;
	font-weight: 600;
	color: #222;
	line-height: 1.3;
}

.pslp-map__tooltip-city {
	font-size: 0.8rem;
	color: #666;
}

.pslp-map__tooltip-levels {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	align-items: center;
}

.pslp-map__tooltip-level-pill {
	display: inline-block;
	padding: 0.15em 0.55em;
	font-size: 0.6875rem;
	font-weight: 400;
	line-height: 1.35;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #5c6370;
	background: #eef1f4;
	border: 1px solid #dfe3e8;
	border-radius: 999px;
}

/* Link to the accessible equivalent (theme link styles and focus ring apply). */
.pslp-map__browse {
	margin: 0.75rem 0 0;
}

@media (prefers-reduced-motion: reduce) {
	.pslp-map__outline,
	.pslp-map__dot {
		transition: none;
	}
}
