/*
 * BOCO US Map. The stage is the Figma "Map Background" (1500x643). Dots are positioned as a
 * percentage of the stage, so they stay locked to the geography at any size.
 */
.boco-us-map {
	--boco-map-w: 104.1667;
	--boco-map-x: -2.0833;
	--boco-map-top: 23px;
	position: relative;
	width: 100%;
	padding-top: var(--boco-map-top);
	overflow: clip;
}

.boco-us-map__stage {
	position: relative;
	width: calc(var(--boco-map-w) * 1%);
	margin-left: calc(var(--boco-map-x) * 1%);
	container-type: inline-size;
}

/* `.boco-us-map img` outranks Elementor's `.elementor img { max-width: 100% }`. */
.elementor .boco-us-map img {
	max-width: none;
}

.boco-us-map__bg {
	display: block;
	width: 100%;
	height: 100%;
}

.boco-us-map__boco {
	position: absolute;
	height: auto;
}

.boco-us-map__dot {
	position: absolute;
	width: 0;
	height: 0;
}

/* Dot width = Figma px size as a fraction of the 1500px stage. */
.boco-us-map__state {
	--dot-size: 13.2039;
	position: absolute;
	top: 0;
	left: 0;
	translate: -50% -50%;
	width: calc(var(--dot-size) / 1500 * 100cqw);
	height: auto;
}

.boco-us-map__state--xs { --dot-size: 7.92233; }
.boco-us-map__state--s  { --dot-size: 13.2039; }
.boco-us-map__state--mf,
.boco-us-map__state--m  { --dot-size: 19.8058; }
.boco-us-map__state--l  { --dot-size: 26.408; }

/* At rest only the second-smallest state (s) shows. */
.boco-us-map__state:not(.boco-us-map__state--s) {
	opacity: 0;
}

/*
 * A pulse walks every dot s > mf > m > l > m > mf > s > xs > s: up to the largest, down to the
 * smallest, then back to the resting state. Each state crossfades with its neighbour on a shared
 * timeline of 8 equal steps (12.5% each).
 */
.boco-us-map__dot.is-pulsing .boco-us-map__state {
	animation-duration: var(--boco-pulse-dur, 3600ms);
	animation-timing-function: linear;
	animation-iteration-count: 1;
}

.boco-us-map__dot.is-pulsing .boco-us-map__state--xs { animation-name: boco-us-map-xs; }
.boco-us-map__dot.is-pulsing .boco-us-map__state--s  { animation-name: boco-us-map-s; }
.boco-us-map__dot.is-pulsing .boco-us-map__state--mf { animation-name: boco-us-map-mf; }
.boco-us-map__dot.is-pulsing .boco-us-map__state--m  { animation-name: boco-us-map-m; }
.boco-us-map__dot.is-pulsing .boco-us-map__state--l  { animation-name: boco-us-map-l; }

@keyframes boco-us-map-s {
	0%, 75%, 100% { opacity: 1; }
	12.5%, 62.5%, 87.5% { opacity: 0; }
}

@keyframes boco-us-map-mf {
	0%, 25%, 50%, 75%, 100% { opacity: 0; }
	12.5%, 62.5% { opacity: 1; }
}

@keyframes boco-us-map-m {
	0%, 12.5%, 37.5%, 62.5%, 100% { opacity: 0; }
	25%, 50% { opacity: 1; }
}

@keyframes boco-us-map-l {
	0%, 25%, 50%, 100% { opacity: 0; }
	37.5% { opacity: 1; }
}

@keyframes boco-us-map-xs {
	0%, 75%, 100% { opacity: 0; }
	87.5% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.boco-us-map__dot.is-pulsing .boco-us-map__state {
		animation: none;
	}
}
