/* Interactive Map section – the campus map and its pins, ported from the
   schoolcms-gutenberg base theme onto this theme's tokens (style.css :root).
   The pins' popups are styled in the second half, because Fancybox lifts
   them out of the section while they are open. */

.dynamic-interactive_map .section_title {
	margin-bottom: 30px;
}
.dynamic-interactive_map .section_title h2 {
	margin-bottom: 5px;
}
.dynamic-interactive_map .section_title .section_subtitle {
	margin: 0;
}
.dynamic-interactive_map .map-admin-note {
	margin: 0 0 20px;
	font-weight: 600;
	color: #9a3412;
}

/* ── The map and its pins ─────────────────────────────── */
.dynamic-interactive_map .map-stage {
	position: relative;
	overflow: visible;
}
.dynamic-interactive_map .map-stage .map-image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 15px;
}

/* A pin is the design's hotspot badge – a flat brand-blue disc with a
   white plus, sized like the discs on the hotspot artwork – centred on its
   point; the location name slides out beside it on hover from tablet up
   (no hover on a phone – there the popup's title names the place) */
.dynamic-interactive_map .map-pin {
	position: absolute;
	z-index: 2;
	display: flex;
	align-items: center;
	transform: translate(-50%, -50%);
	text-decoration: none;
	color: #fff;
}
.dynamic-interactive_map .map-pin .map-pin-dot {
	position: relative;
	display: block;
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 0;
	background: var(--dh_blue, #007DB0);
	box-shadow: 0 2px 6px rgba(23, 42, 72, 0.35);
	transition: background 0.3s ease, transform 0.3s ease;
}
/* the white plus, two centred bars */
.dynamic-interactive_map .map-pin .map-pin-dot::before,
.dynamic-interactive_map .map-pin .map-pin-dot::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	border-radius: 1px;
	background: #fff;
	transform: translate(-50%, -50%);
}
.dynamic-interactive_map .map-pin .map-pin-dot::before {
	width: 3px;
	height: 14px;
}
.dynamic-interactive_map .map-pin .map-pin-dot::after {
	width: 14px;
	height: 3px;
}
.dynamic-interactive_map .map-pin .map-pin-label {
	display: none;
}
.dynamic-interactive_map .map-pin:hover,
.dynamic-interactive_map .map-pin:focus-visible {
	z-index: 3;
	color: #fff;
	text-decoration: none;
}
.dynamic-interactive_map .map-pin:hover .map-pin-dot,
.dynamic-interactive_map .map-pin:focus-visible .map-pin-dot {
	background: var(--dh_navy, #172A48);
	transform: scale(1.15);
}

@media (min-width: 768px) {
	.dynamic-interactive_map .map-pin .map-pin-dot {
		width: 34px;
		height: 34px;
	}
	.dynamic-interactive_map .map-pin .map-pin-dot::before {
		width: 4px;
		height: 18px;
	}
	.dynamic-interactive_map .map-pin .map-pin-dot::after {
		width: 18px;
		height: 4px;
	}
	/* the name pill sits clear of the badge, never over it; pins near the
	   map's right edge (.map-pin-flip, set in the template) show it on
	   their left instead so it stays on the map */
	.dynamic-interactive_map .map-pin .map-pin-label {
		display: block;
		position: absolute;
		left: calc(100% + 8px);
		top: 50%;
		transform: translateY(-50%);
		padding: 6px 14px;
		border-radius: 999px;
		background: var(--dh_navy, #172A48);
		font-size: 14px;
		font-weight: 600;
		line-height: 1.2;
		white-space: nowrap;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.3s ease, visibility 0.3s ease;
	}
	.dynamic-interactive_map .map-pin.map-pin-flip .map-pin-label {
		left: auto;
		right: calc(100% + 8px);
	}
	.dynamic-interactive_map .map-pin:hover .map-pin-label,
	.dynamic-interactive_map .map-pin:focus-visible .map-pin-label {
		opacity: 1;
		visibility: visible;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dynamic-interactive_map .map-pin .map-pin-dot,
	.dynamic-interactive_map .map-pin .map-pin-label {
		transition: none;
	}
}

/* ── A location's popup, open in Fancybox ─────────────── */
/* Lifted out of the section into Fancybox's container, so styled from
   there: 16:9 at 80vh on landscape screens, the media filling one half and
   the copy scrolling in the other. Portrait screens stack the two and let
   the box run to 80vh instead – a 16:9 box the width of a phone is too
   short to read in. */
.fancybox__container .location-popup {
	display: flex;
	flex-direction: column;
	width: min(calc(80vh * (16 / 9)), calc(100vw - 48px));
	max-height: 80vh;
	padding: 0;
	overflow: hidden auto;
	border-radius: 15px;
	background: #fff;
	color: var(--body_colour, #172A48);
}
/* Scrollable copy shows its scrollbar immediately, in brand colours.
   scrollbar-color switches Chrome/Edge/Firefox to a classic always-visible
   bar; the ::-webkit-scrollbar rules do the same for Safari, which ignores
   the standard property. The popup itself scrolls when stacked, the
   .location-body column when side by side. */
.fancybox__container .location-popup,
.fancybox__container .location-popup .location-body {
	scrollbar-color: var(--dh_blue, #007DB0) rgba(23, 42, 72, 0.12);
}
.fancybox__container .location-popup::-webkit-scrollbar,
.fancybox__container .location-popup .location-body::-webkit-scrollbar {
	width: 12px;
}
.fancybox__container .location-popup::-webkit-scrollbar-track,
.fancybox__container .location-popup .location-body::-webkit-scrollbar-track {
	background: rgba(23, 42, 72, 0.12);
	border-radius: 6px;
}
.fancybox__container .location-popup::-webkit-scrollbar-thumb,
.fancybox__container .location-popup .location-body::-webkit-scrollbar-thumb {
	background: var(--dh_blue, #007DB0);
	border-radius: 6px;
	border: 2px solid #fff;
	background-clip: padding-box;
}
.fancybox__container .location-popup::-webkit-scrollbar-thumb:hover,
.fancybox__container .location-popup .location-body::-webkit-scrollbar-thumb:hover {
	background: var(--dh_navy, #172A48);
	background-clip: padding-box;
}

.fancybox__container .location-popup .location-media {
	position: relative;
	flex-shrink: 0;
	aspect-ratio: 16 / 9;
	background: var(--dh_navy, #172A48);
}
.fancybox__container .location-popup .location-media img,
.fancybox__container .location-popup .location-media picture,
.fancybox__container .location-popup .location-media iframe {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.fancybox__container .location-popup .location-media iframe {
	border: 0;
}

/* the click-to-play poster (a button) */
.fancybox__container .location-popup .location-play {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: var(--dh_navy, #172A48);
	cursor: pointer;
}
.fancybox__container .location-popup .location-play .playButton {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 40px;
	color: #fff;
	background: rgba(0, 0, 0, 0.25);
	transition: background 0.3s ease;
}
.fancybox__container .location-popup .location-play:hover .playButton {
	background: rgba(0, 0, 0, 0.45);
}

.fancybox__container .location-popup .location-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
	padding: 30px;
}
.fancybox__container .location-popup .location-title {
	margin: 0;
	font-size: 28px;
	color: var(--title_colour, #172A48);
}
.fancybox__container .location-popup .location-content > :last-child {
	margin-bottom: 0;
}
.fancybox__container .location-popup .location-body .button {
	margin-top: auto;
}

/* Fancybox's own close button sits on the copy, not the picture */
.fancybox__container .location-popup > .f-button.is-close-btn {
	--f-button-color: var(--dh_blue, #007DB0);
}

@media (min-width: 768px) and (orientation: landscape) {
	.fancybox__container .location-popup {
		flex-direction: row;
		height: min(80vh, calc((100vw - 48px) * 9 / 16));
		overflow: hidden;
	}
	.fancybox__container .location-popup .location-media {
		width: 50%;
		aspect-ratio: auto;
		height: 100%;
	}
	.fancybox__container .location-popup .location-body {
		width: 50%;
		height: 100%;
		padding: 40px 40px 40px 30px;
		overflow-y: auto;
	}
	.fancybox__container .location-popup.no-media .location-body {
		width: 100%;
		padding: 40px 60px;
	}
}

@media (orientation: portrait) {
	.fancybox__container .location-popup {
		width: 80vw;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fancybox__container .location-popup .location-play .playButton {
		transition: none;
	}
}
