/* Hotspot Lines – front end */

.hsl-map {
	--hsl-line: #3e7d5a;
	--hsl-dot: #3e7d5a;
	--hsl-label-bg: #3e7d5a;
	--hsl-label-color: #fff;
	--hsl-tip-bg: #fff;
	--hsl-tip-color: #1f2a24;
	--hsl-btn-bg: #3e7d5a;
	--hsl-btn-color: #fff;
	--hsl-line-w: 1px;
	--hsl-dot-size: 6px;
	--hsl-phone-dot: 22px;
	--hsl-radius: 8px;
	/* Labels scale with the map width; override --hsl-label-size to fix a size. */
	--hsl-label-size: clamp(11px, 1.45cqi, 15px);
	--hsl-ease-draw: cubic-bezier(.65, 0, .35, 1);
	--hsl-ease-pop: cubic-bezier(.34, 1.56, .64, 1);

	position: relative;
	width: 100%;
	margin-inline: auto;
}

.hsl-stage {
	position: relative;
	container-type: inline-size;
	line-height: 1.3;
}

.hsl-stage .hsl-image {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	margin: 0;
	border: 0;
	box-shadow: none;
}

/* Lines ------------------------------------------------------------------ */

.hsl-lines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
	z-index: 1;
}

.hsl-line {
	stroke: var(--hsl-line);
	stroke-width: var(--hsl-line-w);
	stroke-linecap: round;
	fill: none;
}

.hsl-js .hsl-line { opacity: 0; }
.hsl-js .hsl-line.is-in { opacity: 1; }

/* Dots ------------------------------------------------------------------- */

.hsl-map .hsl-dot {
	appearance: none;
	position: absolute;
	left: var(--x);
	top: var(--y);
	z-index: 2;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	box-shadow: none;
	transform: translate(-50%, -50%);
	cursor: default;
}

.hsl-map button.hsl-dot { cursor: pointer; }
.hsl-map button.hsl-dot:hover,
.hsl-map button.hsl-dot:focus { background: none; }

.hsl-map .hsl-dot::after {
	content: "";
	width: var(--hsl-dot-size);
	height: var(--hsl-dot-size);
	border-radius: 50%;
	background: var(--hsl-dot);
	transition: transform .22s var(--hsl-ease-pop) var(--d, 0ms);
}

.hsl-js .hsl-dot::after { transform: scale(0); }
.hsl-js .hsl-dot.is-in::after { transform: scale(1); }

/* Labels ----------------------------------------------------------------- */

.hsl-label-wrap {
	position: absolute;
	left: var(--lx);
	top: var(--ly);
	z-index: 3;
	transform: translate(-50%, -50%);
}

.hsl-spot.is-open .hsl-label-wrap { z-index: 20; }

.hsl-map .hsl-label {
	appearance: none;
	display: block;
	margin: 0;
	padding: .62em .85em;
	min-width: 0;
	min-height: 0;
	border: 0;
	border-radius: var(--hsl-radius);
	background: var(--hsl-label-bg);
	color: var(--hsl-label-color);
	box-shadow: none;
	font: inherit;
	font-size: 14px;
	font-size: var(--hsl-label-size);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	white-space: nowrap;
	cursor: default;
	transition:
		opacity .3s ease var(--d, 0ms),
		transform .4s var(--hsl-ease-pop) var(--d, 0ms),
		box-shadow .2s ease;
}

.hsl-map button.hsl-label { cursor: pointer; }

.hsl-map .hsl-label:hover,
.hsl-map .hsl-label:focus {
	background: var(--hsl-label-bg);
	color: var(--hsl-label-color);
}

.hsl-js .hsl-label { opacity: 0; transform: scale(.8); }
.hsl-js .hsl-label.is-in { opacity: 1; transform: none; }

.hsl-map .hsl-label[aria-expanded="true"] {
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--hsl-label-bg) 28%, transparent);
}

.hsl-map .hsl-label:focus-visible,
.hsl-map .hsl-dot:focus-visible,
.hsl-map .hsl-tip-close:focus-visible,
.hsl-map .hsl-tip-link:focus-visible {
	outline: 2px solid var(--hsl-label-bg);
	outline-offset: 3px;
}

/* Tooltip ---------------------------------------------------------------- */

.hsl-tip {
	display: none;
	position: absolute;
	top: calc(100% + 12px);
	left: 50%;
	z-index: 5;
	width: min(300px, 80vw);
	margin-left: var(--shift, 0px);
	translate: -50% 0;
	border-radius: calc(var(--hsl-radius) + 4px);
	background: var(--hsl-tip-bg);
	color: var(--hsl-tip-color);
	box-shadow: 0 14px 34px -10px rgba(20, 32, 26, .3), 0 2px 6px rgba(20, 32, 26, .08);
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
	white-space: normal;
}

.hsl-tip.is-open {
	display: block;
	animation: hsl-tip-in .22s ease-out;
}

.hsl-tip.is-above {
	top: auto;
	bottom: calc(100% + 12px);
	animation-name: hsl-tip-in-up;
}

/* Caret, kept pointing at the label when the tooltip is nudged sideways. */
.hsl-tip::before {
	content: "";
	position: absolute;
	top: -6px;
	left: calc(50% - var(--shift, 0px));
	width: 12px;
	height: 12px;
	border-radius: 2px;
	background: var(--hsl-tip-bg);
	transform: translateX(-50%) rotate(45deg);
}

.hsl-tip.is-above::before { top: auto; bottom: -6px; }

/* Invisible bridge over the gap so the pointer can travel label → tooltip. */
.hsl-tip::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -14px;
	height: 14px;
}

.hsl-tip.is-above::after { top: auto; bottom: -14px; }

.hsl-tip-media {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: calc(var(--hsl-radius) + 4px) calc(var(--hsl-radius) + 4px) 0 0;
}

.hsl-tip-media img,
.hsl-tip .hsl-tip-img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 180px;
	margin: 0;
	object-fit: cover;
}

.hsl-tip-body { padding: 16px 18px 18px; }

.hsl-map .hsl-tip-title {
	margin: 0 0 6px;
	padding: 0;
	color: inherit;
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.3;
}

.hsl-tip:not(.has-media) .hsl-tip-title { padding-right: 30px; }

.hsl-tip-text {
	font-size: .92em;
	line-height: 1.55;
	opacity: .85;
}

.hsl-map .hsl-tip-text p { margin: 0 0 .6em; padding: 0; }
.hsl-map .hsl-tip-text p:last-child { margin-bottom: 0; }

.hsl-map .hsl-tip-link {
	display: inline-block;
	margin-top: 12px;
	padding: .55em 1.05em;
	border-radius: 999px;
	background: var(--hsl-btn-bg);
	color: var(--hsl-btn-color);
	font-size: .88em;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	transition: filter .15s ease;
}

.hsl-map .hsl-tip-link:hover,
.hsl-map .hsl-tip-link:focus {
	color: var(--hsl-btn-color);
	text-decoration: none;
	filter: brightness(1.1);
}

.hsl-map .hsl-tip-close {
	appearance: none;
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: color-mix(in srgb, var(--hsl-tip-bg) 88%, transparent);
	color: var(--hsl-tip-color);
	box-shadow: none;
	line-height: 1;
	cursor: pointer;
}

.hsl-map .hsl-tip-close:hover,
.hsl-map .hsl-tip-close:focus {
	background: var(--hsl-tip-bg);
	color: var(--hsl-tip-color);
}

.hsl-map .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Phones in "labels" mode: the open tooltip moves below the image. ------- */

.hsl-panel:empty { display: none; }
.hsl-panel { margin-top: 12px; }

.hsl-panel .hsl-tip {
	position: relative;
	top: auto;
	bottom: auto;
	left: auto;
	width: auto;
	margin-left: 0;
	translate: none;
}

.hsl-panel .hsl-tip::before,
.hsl-panel .hsl-tip::after { display: none; }

/* Phones: numbered dots + card strip ------------------------------------ */

.hsl-map .hsl-dot.is-static { cursor: default; }
.hsl-map:not(.is-compact) .hsl-dot.is-static { pointer-events: none; }

.hsl-dot-num,
.hsl-cards-wrap { display: none; }

.hsl-map.is-compact[data-mobile="cards"] .hsl-label-wrap,
.hsl-map.is-compact[data-mobile="cards"] .hsl-lines { display: none; }

.hsl-map.is-compact[data-mobile="cards"] .hsl-cards-wrap { display: block; }

.hsl-map.is-compact[data-mobile="cards"] .hsl-dot {
	width: max(28px, calc(var(--hsl-phone-dot) + 6px));
	height: max(28px, calc(var(--hsl-phone-dot) + 6px));
	pointer-events: auto;
	cursor: pointer;
}

.hsl-map.is-compact[data-mobile="cards"] .hsl-dot::after { display: none; }

.hsl-map.is-compact[data-mobile="cards"] .hsl-dot-num {
	display: grid;
	place-items: center;
	min-width: var(--hsl-phone-dot);
	height: var(--hsl-phone-dot);
	padding: 0 calc(var(--hsl-phone-dot) * .18);
	box-sizing: border-box;
	border-radius: 999px;
	background: var(--hsl-dot);
	color: var(--hsl-label-color);
	box-shadow: 0 0 0 2px var(--hsl-tip-bg);
	font-size: max(10px, calc(var(--hsl-phone-dot) * .5));
	font-weight: 600;
	line-height: 1;
	font-variant-numeric: tabular-nums;
	transition: transform .22s var(--hsl-ease-pop) var(--d, 0ms), box-shadow .2s ease;
}

.hsl-map.hsl-plain-dots.is-compact[data-mobile="cards"] .hsl-dot-num {
	padding: 0;
	width: var(--hsl-phone-dot);
	font-size: 0;
	box-shadow: 0 0 0 1.5px var(--hsl-tip-bg);
}

.hsl-js .hsl-dot-num { transform: scale(0); }
.hsl-js .hsl-dot.is-in .hsl-dot-num { transform: none; }

.hsl-map .hsl-dot.is-clustered { visibility: hidden; }
.hsl-map .hsl-dot.is-active { z-index: 4; }

.hsl-map .hsl-dot.is-active .hsl-dot-num,
.hsl-map .hsl-cluster.is-active {
	box-shadow: 0 0 0 2px var(--hsl-tip-bg), 0 0 0 4.5px var(--hsl-dot);
}

.hsl-map .hsl-cluster {
	appearance: none;
	position: absolute;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: .3em;
	height: max(20px, calc(var(--hsl-phone-dot) + 4px));
	margin: 0;
	padding: 0 .75em 0 .55em;
	border: 2px solid var(--hsl-dot);
	border-radius: 999px;
	background: var(--hsl-tip-bg);
	color: var(--hsl-dot);
	box-shadow: 0 0 0 2px var(--hsl-tip-bg);
	white-space: nowrap;
	font: inherit;
	font-size: clamp(10px, calc(var(--hsl-phone-dot) * .55), 13px);
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transform: translate(-50%, -50%) scale(0);
	transition: transform .22s var(--hsl-ease-pop) var(--d, 0ms), box-shadow .2s ease;
}

.hsl-map .hsl-cluster.is-in { transform: translate(-50%, -50%); }

.hsl-map .hsl-cluster svg { display: block; flex: none; width: 1em; height: 1em; }

.hsl-map .hsl-cluster:hover,
.hsl-map .hsl-cluster:focus {
	background: var(--hsl-tip-bg);
	color: var(--hsl-dot);
}

/* The active location is inside this bubble. */
.hsl-map .hsl-cluster.is-active,
.hsl-map .hsl-cluster.is-active:hover,
.hsl-map .hsl-cluster.is-active:focus {
	background: var(--hsl-dot);
	color: var(--hsl-label-color);
}

.hsl-map .hsl-cluster:focus-visible {
	outline: 2px solid var(--hsl-label-bg);
	outline-offset: 5px;
}

.hsl-cards-wrap { margin-top: 14px; }

.hsl-map .hsl-cards {
	--hsl-card-w: min(84%, 340px);
	--hsl-card-gap: 12px;

	position: relative;
	display: flex;
	align-items: flex-start;
	gap: var(--hsl-card-gap);
	margin: 0;
	padding: 3px 0 6px;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.hsl-cards::-webkit-scrollbar { display: none; }

/* Spacers let the first and last cards sit in the centre too. */
.hsl-cards::before,
.hsl-cards::after {
	content: "";
	flex: 0 0 max(0px, calc((100% - var(--hsl-card-w)) / 2 - var(--hsl-card-gap)));
}

.hsl-map .hsl-card {
	flex: 0 0 var(--hsl-card-w);
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid color-mix(in srgb, var(--hsl-tip-color) 14%, transparent);
	border-radius: calc(var(--hsl-radius) + 4px);
	background: var(--hsl-tip-bg);
	color: var(--hsl-tip-color);
	font-size: 15px;
	line-height: 1.5;
	list-style: none;
	scroll-snap-align: center;
	transition: border-color .2s ease;
}

.hsl-map .hsl-card::before { display: none; }
.hsl-map .hsl-card.is-active { border-color: var(--hsl-dot); }

.hsl-card-media { display: block; }

.hsl-map .hsl-card-media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	margin: 0;
	object-fit: cover;
}

.hsl-card-body { padding: 14px 16px 16px; }

.hsl-map .hsl-card-meta,
.hsl-map .hsl-card-title {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 4px;
	padding: 0;
}

.hsl-map .hsl-card-meta {
	color: color-mix(in srgb, var(--hsl-tip-color) 70%, var(--hsl-tip-bg));
	font-size: .82em;
}

.hsl-map .hsl-card-title {
	color: inherit;
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.3;
}

.hsl-card-num {
	display: grid;
	place-items: center;
	flex: none;
	min-width: 20px;
	height: 20px;
	padding: 0 5px;
	box-sizing: border-box;
	border-radius: 999px;
	background: var(--hsl-dot);
	color: var(--hsl-label-color);
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.hsl-map .hsl-card-meta .hsl-card-num { min-width: 18px; height: 18px; padding: 0 4px; font-size: 10px; }

.hsl-cards-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 10px;
}

.hsl-map .hsl-cards-btn {
	appearance: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
	border-radius: 50%;
	background: transparent;
	color: inherit;
	box-shadow: none;
	cursor: pointer;
}

.hsl-map .hsl-cards-btn:hover,
.hsl-map .hsl-cards-btn:focus {
	background: transparent;
	color: inherit;
	border-color: currentColor;
}

.hsl-map .hsl-cards-btn:focus-visible {
	outline: 2px solid var(--hsl-dot);
	outline-offset: 2px;
}

.hsl-map .hsl-cards-btn:disabled {
	opacity: .35;
	border-color: color-mix(in srgb, currentColor 25%, transparent);
	cursor: default;
}

.hsl-cards-count {
	min-width: 5.5em;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

@keyframes hsl-tip-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: none; }
}

@keyframes hsl-tip-in-up {
	from { opacity: 0; transform: translateY(4px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hsl-map *,
	.hsl-map *::before,
	.hsl-map *::after {
		animation: none !important;
		transition: none !important;
	}
}
