/*
	Mapbox map containers. Loaded by Views/Partials/Site/MapboxAssets.cshtml.

	ponytail: sizing only. Mapbox GL JS ships its own control and attribution styling in
	mapbox-gl.css, so nothing here restyles the map chrome until a design asks for it.
*/

.sypn-map {
	/* GL JS measures its container on load, so the height has to come from CSS - a container
	   with no height renders a zero-pixel canvas and never recovers. */
	width: 100%;
	height: 400px;
	border-radius: var(--sypn-radius-md);
	overflow: hidden;
}

.mapboxgl-canvas:focus-visible {
	outline: 2px solid transparent;
	outline-offset: -2px;
	box-shadow: none;
}

.mapboxgl-map:has(.mapboxgl-canvas:focus-visible)::after {
	content: "";
	position: absolute;
	z-index: 3;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 2px var(--brand-asphalt-black), inset 0 0 0 4px var(--utilities-focus);
	pointer-events: none;
}

.mapboxgl-ctrl-attrib-button:focus:not(:focus-visible),
.mapboxgl-ctrl-group button:focus:not(:focus-visible) {
	box-shadow: none;
}

.mapboxgl-ctrl-attrib-button:focus:focus-visible,
.mapboxgl-ctrl-group button:focus:focus-visible {
	outline: var(--sypn-focus-outline);
	outline-offset: -2px;
	box-shadow: var(--sypn-focus-ring);
}

.sypn-map-error {
	padding: var(--sypn-space-xs);
	border: 1px solid var(--brand-asphalt-black-25);
	border-radius: var(--sypn-radius-md);
	color: var(--brand-asphalt-grey);
}

/* =========================================================
   Map markers (Figma timetable map 4225:40500)
   ========================================================= */

.sypn-pin {
	display: block;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

span.sypn-pin {
	cursor: default;
}

.sypn-pin__dot {
	position: absolute;
	top: 29.17%;
	left: 33.33%;
	width: 29.17%;
	height: 29.16%;
	background: var(--neutral-white);
}

.sypn-pin--orange .sypn-pin__dot {
	background: var(--brand-molten-orange);
}

.sypn-pin img {
	position: absolute;
	top: 8.31%;
	left: 16.69%;
	width: 66.67%;
	height: 83.33%;
}

.sypn-pin--mode {
	width: 40px;
	height: 40px;
}

.sypn-pin--mode .sypn-pin__dot {
	display: none;
}

.sypn-pin__mode.material-symbols-outlined {
	position: absolute;
	top: 41.67%;
	left: 50%;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--brand-asphalt-black);
	color: var(--neutral-white);
	font-size: 18px;
	line-height: 22px;
	text-align: center;
	transform: translate(-50%, -50%);
}

.sypn-pin:focus-visible {
	outline: var(--sypn-focus-outline);
	outline-offset: -2px;
	box-shadow: var(--sypn-focus-ring);
}

.sypn-popup .mapboxgl-popup-content {
	padding: 8px 16px 8px 12px;
	border: 1px solid var(--brand-asphalt-black);
	border-radius: var(--sypn-radius-md);
	background: var(--brand-asphalt-black);
	box-shadow: none;
	color: var(--neutral-white);
	font-family: var(--sypn-font);
}

.sypn-popup.mapboxgl-popup-anchor-top .mapboxgl-popup-tip,
.sypn-popup.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip,
.sypn-popup.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip {
	border-bottom-color: var(--brand-asphalt-black);
}

.sypn-popup.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip,
.sypn-popup.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip,
.sypn-popup.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip {
	border-top-color: var(--brand-asphalt-black);
}

.sypn-popup.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
	border-right-color: var(--brand-asphalt-black);
}

.sypn-popup.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
	border-left-color: var(--brand-asphalt-black);
}

.sypn-popup__name {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 700;
	line-height: 28px;
}

.sypn-popup__name:last-child {
	margin-bottom: 0;
}

.sypn-popup__meta {
	margin: -8px 0 8px;
	font-size: 16px;
	line-height: 24px;
}

.sypn-popup__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--neutral-white);
	font-size: 18px;
	line-height: 28px;
	text-decoration: underline;
}

.sypn-popup__link + .sypn-popup__link {
	display: flex;
	width: fit-content;
}

.sypn-popup__link:hover {
	color: var(--neutral-white);
	text-decoration-thickness: 2px;
}

.sypn-popup__link:focus-visible {
	outline: 2px solid transparent;
	background: var(--utilities-focus);
	box-shadow: var(--sypn-focus-underline);
	color: var(--brand-asphalt-black);
	text-decoration: none;
}

.sypn-vehicle {
	display: block;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	background: none;
	text-decoration: none;
	cursor: pointer;
}

span.sypn-vehicle {
	cursor: default;
}

.sypn-vehicle.is-active {
	z-index: 3;
}

.sypn-vehicle__circle {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 8px;
	border-radius: 100px;
	background: var(--brand-asphalt-black);
}

.sypn-vehicle__circle .material-symbols-outlined {
	position: relative;
	font-size: 32px;
	color: var(--neutral-white);
}

.sypn-vehicle__heading {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.sypn-vehicle__heading .material-symbols-outlined {
	position: absolute;
	top: -33px;
	left: 0;
	font-size: 48px;
	color: var(--brand-asphalt-black);
}

.sypn-vehicle.is-live .sypn-vehicle__circle::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--brand-asphalt-black);
	animation: sypn-vehicle-pulse 1.8s ease-out infinite;
}

@keyframes sypn-vehicle-pulse {
	from {
		opacity: 0.5;
		transform: scale(1);
	}

	to {
		opacity: 0;
		transform: scale(1.9);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sypn-vehicle.is-live .sypn-vehicle__circle::before {
		animation: none;
		opacity: 0.25;
		transform: scale(1.35);
	}
}

.sypn-vehicle:focus-visible {
	border-radius: 50%;
	outline: var(--sypn-focus-outline);
	outline-offset: 2px;
	box-shadow: 0 0 0 6px var(--utilities-focus);
}
