.chm-map {
	position: relative;
	display: inline-block;
	max-width: 100%;
	line-height: 0;
	--chm-dot-color: #ff595a;
	--chm-dot-hover: #d93027;
	--chm-dot-size: 16px;
	--chm-popup-bg: #001266;
	--chm-popup-text: #ffffff;
	--chm-popup-accent: #ffffff;
	--chm-popup-width: 300px;
	--chm-popup-radius: 0px;
}

.chm-map__image {
	display: block;
	width: 100%;
	height: auto;
}

.chm-hotspot-wrap {
	position: absolute;
	transform: translate(-50%, -50%);
	line-height: normal;
}

/* The transform above makes every wrap a stacking context, so the popover's
   own z-index can only lift it above its own dot -- never above sibling
   hotspots, which paint in DOM order. Raise the whole wrap instead, so an open
   popover covers the dots of locations added after it. */
.chm-hotspot-wrap--open {
	z-index: 20;
}

.chm-hotspot {
	display: block;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	background-color: transparent !important;
	cursor: pointer;
	/* Own stacking context so the pulse ring paints above the map but
	   behind the dot (a negative z-index alone would slip behind the map image). */
	position: relative;
	z-index: 0;
}

.chm-hotspot:focus {
	outline: none;
	outline-offset: 0;
}

.chm-hotspot__dot {
	position: relative;
	display: block;
	width: var(--chm-dot-size);
	height: var(--chm-dot-size);
	border-radius: 50%;
	background: var(--chm-dot-color);
	transition: background 0.15s ease, transform 0.15s ease;
}

/* Expanding, fading pulse ring behind the dot. */
.chm-hotspot__dot::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: 50%;
	background: var(--chm-dot-color);
	animation: chm-pulse 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
	pointer-events: none;
}

@keyframes chm-pulse {
	0% {
		transform: scale(1);
		opacity: 0.55;
	}

	70% {
		transform: scale(2.8);
		opacity: 0;
	}

	100% {
		transform: scale(2.8);
		opacity: 0;
	}
}

.chm-hotspot:hover .chm-hotspot__dot,
.chm-hotspot:focus-visible .chm-hotspot__dot {
	background: var(--chm-dot-hover);
	transform: scale(1.15);
}

.chm-hotspot:focus-visible {
	outline: 2px solid var(--chm-popup-accent);
	outline-offset: 3px;
	border-radius: 50%;
}

.chm-popup {
	position: absolute;
	bottom: calc(var(--chm-dot-size) / 2 + 14px);
	left: 50%;
	transform: translateX(-50%);
	transform-origin: bottom center;
	width: var(--chm-popup-width);
	max-width: calc(100vw - 24px);
	/* A popup with several members can outgrow a short viewport. */
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 34px 22px;
	background: var(--chm-popup-bg);
	color: var(--chm-popup-text);
	border-radius: var(--chm-popup-radius);
	box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4);
	text-align: center;
	z-index: 10;
}

/* Springy grow-in each time the popup is shown. Uses the independent `scale`
   property (not `transform`) so the JS horizontal-clamp translate never conflicts. */
.chm-popup:not([hidden]) {
	animation: chm-pop-in 0.32s cubic-bezier(0.175, 0.885, 0.32, 1.15) both;
}

@keyframes chm-pop-in {
	from {
		opacity: 0;
		scale: 0.5;
	}

	to {
		opacity: 1;
		scale: 1;
	}
}

/* Flip below the dot when too close to the top edge. */
.chm-popup.chm-popup--below {
	bottom: auto;
	top: calc(var(--chm-dot-size) / 2 + 14px);
	transform-origin: top center;
}

.chm-popup[hidden] {
	display: none;
}

/* Locations with several members stack their blocks in one popup. */
.chm-popup__member + .chm-popup__member {
	margin-top: 26px;
}

.chm-popup__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	margin-bottom: 14px;
	border: 1.5px solid rgba(255, 255, 255, 0.55);
	border-radius: 50%;
	color: var(--chm-popup-text);
}

.chm-popup__name {
	margin: 0 0 6px;
	font-weight: 700;
	font-size: 18px;
	line-height: 1.3;
}

.chm-popup__role {
	display: block;
	margin-top: 4px;
	font-size: 15px;
	color: var(--chm-popup-accent);
}

.chm-popup__title {
	margin: 0 0 10px;
	font-size: 14px;
	line-height: 1.4;
	opacity: 0.95;
}

.chm-popup__org {
	margin: 0 0 10px;
	font-size: 14px;
	line-height: 1.4;
	color: var(--chm-popup-accent);
}

/* Shown once per popup, below every member. */
.chm-popup__country {
	margin: 18px 0 0;
	font-weight: 700;
	font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {

	.chm-hotspot__dot::before {
		animation: none;
		opacity: 0;
	}

	.chm-popup:not([hidden]) {
		animation: none;
	}
}
