.brixx-dynamic-map-block {
	width: 100%;
}

.brixx-dynamic-map__layout {
	width: 100%;
	position: relative;
}

.brixx-dynamic-map__stage {
	width: 100%;
	position: relative;
	overflow: hidden;
}

.brixx-dynamic-map__stage .brixx-dynamic-map {
	position: relative;
}

.brixx-dynamic-map {
	width: 100%;
	position: relative;
}

/* Mapbox GL: keep marker layer positioning (do not set position:relative on the marker element). */
.brixx-dynamic-map .mapboxgl-map {
	width: 100%;
	height: 100%;
	overflow: hidden;
}

.brixx-dynamic-map .mapboxgl-marker {
	position: absolute;
	top: 0;
	left: 0;
	will-change: transform;
}

.brixx-dynamic-map.leaflet-container {
	font-family: inherit;
}

.brixx-dynamic-map .mapboxgl-canvas {
	outline: none;
}

/* Attribution hidden by default (see brixx_dynamic_map_show_attribution filter). */
.brixx-dynamic-map:not(.brixx-dynamic-map--show-attribution) .mapboxgl-ctrl-attrib,
.brixx-dynamic-map:not(.brixx-dynamic-map--show-attribution) .leaflet-control-attribution {
	display: none !important;
}

.brixx-dynamic-map--show-attribution .mapboxgl-ctrl-attrib {
	background: color-mix(in srgb, var(--wp--preset--color--white, #fff) 92%, transparent);
	color: var(--wp--preset--color--dark-grey, #1a1a1a);
	font-size: 0.6875rem;
	line-height: 1.4;
	max-width: min(100% - 1rem, 22rem);
	border-radius: 0.25rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.brixx-dynamic-map--show-attribution .mapboxgl-ctrl-attrib a,
.brixx-dynamic-map--show-attribution .leaflet-control-attribution a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.12em;
}

.brixx-dynamic-map--show-attribution .leaflet-control-attribution {
	background: color-mix(in srgb, var(--wp--preset--color--white, #fff) 92%, transparent);
	color: var(--wp--preset--color--dark-grey, #1a1a1a);
	font-size: 0.6875rem;
	line-height: 1.4;
	max-width: min(100% - 1rem, 22rem);
	padding: 0.2rem 0.45rem;
	border-radius: 0.25rem;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.brixx-dynamic-map-block--regatta-dark .brixx-dynamic-map--show-attribution .mapboxgl-ctrl-attrib,
.brixx-dynamic-map-block--regatta-dark .brixx-dynamic-map--show-attribution .leaflet-control-attribution {
	background: color-mix(in srgb, var(--wp--preset--color--dark-grey, #2a2a2a) 88%, transparent);
	color: var(--wp--preset--color--light-grey, #e8e8e8);
}

/* Fixed pixel pin size on the map so anchors match the visible shape (rem sizes differ in legend). */
.brixx-dynamic-map .brixx-dynamic-map__pin-css {
	width: 22px;
	height: 22px;
	--brixx-dm-pin-size: 22px;
}

.brixx-dynamic-map-block--has-default-pin-svg .brixx-dynamic-map .brixx-dynamic-map__pin-default,
.brixx-dynamic-map-block--has-default-pin-svg .brixx-dynamic-map__legend-marker-pin .brixx-dynamic-map__pin-default {
	width: 24px;
	height: 24px;
}

.brixx-dynamic-map-block:not(.brixx-dynamic-map-block--has-default-pin-svg) .brixx-dynamic-map .brixx-dynamic-map__pin-default,
.brixx-dynamic-map-block:not(.brixx-dynamic-map-block--has-default-pin-svg) .brixx-dynamic-map__legend-marker-pin .brixx-dynamic-map__pin-default {
	width: 22px;
	height: 22px;
}

/* Leaflet divIcon */
.brixx-dynamic-map .leaflet-div-icon.brixx-dynamic-map__div-icon {
	background: transparent;
	border: none;
	margin-left: 0;
	margin-top: 0;
}

.brixx-dynamic-map__leaflet-pin-wrap {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.brixx-dynamic-map__leaflet-pin-wrap img {
	display: block;
	max-width: none;
}

.brixx-dynamic-map__leaflet-pin-core {
	position: relative;
	display: inline-flex;
	align-items: flex-end;
	justify-content: center;
}

.brixx-dynamic-map__mapbox-pin-inner {
	display: flex;
	align-items: flex-end;
	justify-content: center;
}

.brixx-dynamic-map__pin-default {
	display: block;
	flex-shrink: 0;
}

/* Theme SVG (mask + background-color = --brixx-dm-pin-color) */
.brixx-dynamic-map-block--has-default-pin-svg .brixx-dynamic-map__pin-default {
	background-color: var(--brixx-dm-pin-color, #2563eb);
	border: none;
	border-radius: 0;
	box-shadow: none;
	-webkit-mask-image: var(--brixx-dm-pin-svg);
	mask-image: var(--brixx-dm-pin-svg);
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center bottom;
	mask-position: center bottom;
}

.brixx-dynamic-map-block:not(.brixx-dynamic-map-block--has-default-pin-svg) .brixx-dynamic-map__pin-default {
	width: 1.375rem;
	height: 1.375rem;
	border-radius: 50%;
	background: #2563eb;
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.brixx-dynamic-map__pin-default--legend {
	width: 1.25rem;
	height: 1.25rem;
}

.brixx-dynamic-map__pin-css {
	display: block;
	width: var(--brixx-dm-pin-size, 1.375rem);
	height: var(--brixx-dm-pin-size, 1.375rem);
	border-radius: 50%;
	background: var(--brixx-dm-pin-color, #2563eb);
	border: var(--brixx-dm-pin-border, 2px solid #fff);
	box-shadow: var(--brixx-dm-pin-shadow, 0 1px 3px rgba(0, 0, 0, 0.35));
	flex-shrink: 0;
	box-sizing: border-box;
}

.brixx-dynamic-map__pin-css--legend {
	width: var(--brixx-dm-pin-size-legend, 1.25rem);
	height: var(--brixx-dm-pin-size-legend, 1.25rem);
}

.brixx-dynamic-map__pin-number {
	position: absolute;
	top: -0.125rem;
	right: -0.125rem;
	min-width: 1.125rem;
	height: 1.125rem;
	padding: 0 0.25rem;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font-size: 0.625rem;
	font-weight: 700;
	line-height: 1.125rem;
	text-align: center;
	box-sizing: border-box;
	font-family: system-ui, -apple-system, Segoe UI, sans-serif;
	pointer-events: none;
}

.brixx-dynamic-map__pin-numeric {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.75rem;
	height: 1.75rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
	box-sizing: border-box;
	font-family: system-ui, -apple-system, Segoe UI, sans-serif;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
	border: 2px solid #fff;
	flex-shrink: 0;
}

.brixx-dynamic-map__pin-numeric--legend {
	min-width: 1.5rem;
	height: 1.5rem;
	font-size: 0.6875rem;
}

.brixx-dynamic-map__mapbox-pin-root {
	display: inline-block;
	cursor: pointer;
	line-height: 0;
}

.brixx-dynamic-map__mapbox-pin-root--no-popup {
	cursor: default;
}

.brixx-dynamic-map__mapbox-pin-anchor {
	position: relative;
	display: inline-block;
	line-height: 0;
}

.brixx-dynamic-map__mapbox-pin-root--labeled .brixx-dynamic-map__pin-label {
	position: absolute;
	left: calc(100% + 0.35rem);
	bottom: 0;
	transform: translateY(-15%);
	max-width: 10rem;
	line-height: 1.25;
}

.brixx-dynamic-map__leaflet-pin-wrap--labeled {
	width: auto;
	height: auto;
}

.brixx-dynamic-map__leaflet-pin-wrap--labeled .brixx-dynamic-map__pin-label {
	position: absolute;
	left: calc(100% + 0.35rem);
	top: 50%;
	transform: translateY(-50%);
}

.brixx-dynamic-map .leaflet-div-icon.brixx-dynamic-map__div-icon--labeled {
	width: auto !important;
	height: auto !important;
	overflow: visible;
}

.brixx-dynamic-map__pin-label {
	display: inline-block;
	max-width: 10rem;
	padding: 0.2rem 0.45rem;
	border-radius: 0.25rem;
	background: rgba(255, 255, 255, 0.95);
	color: #111;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.25;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	pointer-events: none;
	font-family: system-ui, -apple-system, Segoe UI, sans-serif;
}

/* CSS pin + title on pin: callout (body + tip), styled like map popups */
.brixx-dynamic-map__pin-callout {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	max-width: 12rem;
	line-height: 1.25;
	font-family: inherit;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
	--brixx-dm-callout-bg: var(--wp--preset--color--white, #fff);
	--brixx-dm-callout-color: var(--wp--preset--color--dark-grey, #1a1a1a);
	--brixx-dm-callout-radius: 0.25rem;
	pointer-events: none;
}

.brixx-dynamic-map__pin-callout__body {
	display: block;
	box-sizing: border-box;
	max-width: 100%;
	padding: 0.2rem 0.45rem;
	border-radius: var(--brixx-dm-callout-radius);
	background: var(--brixx-dm-callout-bg);
	color: var(--brixx-dm-callout-color);
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.brixx-dynamic-map__pin-callout__tip {
	display: block;
	width: 0;
	height: 0;
	margin-top: -1px;
	border-left: 6px solid transparent;
	border-right: 6px solid transparent;
	border-top: 7px solid var(--brixx-dm-callout-bg);
}

.brixx-dynamic-map__mapbox-pin-root--callout .brixx-dynamic-map__mapbox-pin-inner {
	width: auto;
	height: auto;
}

.brixx-dynamic-map__mapbox-pin-root--callout .brixx-dynamic-map__mapbox-pin-anchor {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
}

.brixx-dynamic-map__leaflet-pin-wrap--callout {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	transform: translate(-50%, -100%);
}

.brixx-dynamic-map__leaflet-pin-wrap--callout .brixx-dynamic-map__leaflet-pin-core {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
}

.brixx-dynamic-map .leaflet-div-icon.brixx-dynamic-map__div-icon--callout {
	width: auto !important;
	height: auto !important;
	overflow: visible;
}

.brixx-dynamic-map__pin-callout--legend {
	max-width: 8rem;
}

.brixx-dynamic-map__pin-callout--legend .brixx-dynamic-map__pin-callout__body {
	font-size: 0.6875rem;
}

/* Legend — layout shell */
.brixx-dynamic-map__legend-toggle,
.brixx-dynamic-map__legend-backdrop,
.brixx-dynamic-map__legend-close {
	display: none;
}

.brixx-dynamic-map__legend-toggle {
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	margin: 0;
	padding: 0.5rem 0.875rem;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 999px;
	background: #fff;
	color: inherit;
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.brixx-dynamic-map__legend-toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.brixx-dynamic-map__legend-panel {
	min-width: 0;
}

.brixx-dynamic-map__legend {
	box-sizing: border-box;
}

.brixx-dynamic-map__legend-toolbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.brixx-dynamic-map__legend-title {
	margin: 0;
	font-size: 1.125rem;
	line-height: 1.3;
	flex: 1;
	min-width: 0;
}

.brixx-dynamic-map__legend-close {
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.brixx-dynamic-map__legend-close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.brixx-dynamic-map__legend-body {
	max-height: inherit;
	overflow-y: auto;
}

/* Mobile legend layouts (< 1024px) */
@media (max-width: 1023px) {
	/* Below the map (stacked) */
	.brixx-dynamic-map-block--legend-mobile-below .brixx-dynamic-map__layout {
		display: flex;
		flex-direction: column;
		gap: 0;
	}

	.brixx-dynamic-map-block--legend-mobile-below .brixx-dynamic-map__legend-panel {
		margin-top: 1rem;
	}

	.brixx-dynamic-map-block--legend-mobile-below .brixx-dynamic-map__legend {
		padding-top: 1rem;
		border-top: 1px solid rgba(0, 0, 0, 0.12);
	}

	/* Slide-out drawer */
	.brixx-dynamic-map-block--legend-mobile-drawer .brixx-dynamic-map__legend-toggle {
		display: inline-flex;
		position: absolute;
		z-index: 3;
		right: 0.75rem;
		bottom: 0.75rem;
	}

	.brixx-dynamic-map-block--legend-mobile-drawer .brixx-dynamic-map__legend-backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 40;
		background: rgba(0, 0, 0, 0.45);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 0.2s ease, visibility 0.2s ease;
	}

	.brixx-dynamic-map-block--legend-mobile-drawer.brixx-dynamic-map-block--legend-open .brixx-dynamic-map__legend-backdrop {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}

	.brixx-dynamic-map-block--legend-mobile-drawer .brixx-dynamic-map__legend-panel {
		position: fixed;
		z-index: 41;
		top: 0;
		right: 0;
		width: min(100%, 20rem);
		height: 100%;
		max-height: 100dvh;
		margin: 0;
		padding: 0;
		transform: translateX(100%);
		visibility: hidden;
		pointer-events: none;
		transition: transform 0.25s ease, visibility 0.25s ease;
	}

	.brixx-dynamic-map-block--legend-mobile-drawer.brixx-dynamic-map-block--legend-open .brixx-dynamic-map__legend-panel {
		transform: translateX(0);
		visibility: visible;
		pointer-events: auto;
	}

	.brixx-dynamic-map-block--legend-mobile-drawer .brixx-dynamic-map__legend {
		height: 100%;
		margin: 0;
		padding: 1rem;
		overflow-y: auto;
		border-top: 0;
		background: #fff;
		box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
	}

	.brixx-dynamic-map-block--legend-mobile-drawer .brixx-dynamic-map__legend-close {
		display: inline-flex;
	}

	.brixx-dynamic-map-block--legend-mobile-drawer.brixx-dynamic-map-block--legend-open {
		overflow: hidden;
	}
}

/* Desktop (1024px+): reset mobile drawer chrome */
@media (min-width: 1024px) {
	.brixx-dynamic-map-block[class*='brixx-dynamic-map-block--legend-'] .brixx-dynamic-map__legend-toggle,
	.brixx-dynamic-map-block[class*='brixx-dynamic-map-block--legend-'] .brixx-dynamic-map__legend-backdrop {
		display: none !important;
	}

	.brixx-dynamic-map-block[class*='brixx-dynamic-map-block--legend-'] .brixx-dynamic-map__legend-close {
		display: none !important;
	}

	.brixx-dynamic-map-block--legend-mobile-drawer .brixx-dynamic-map__legend-panel {
		position: static;
		width: auto;
		height: auto;
		max-height: none;
		transform: none;
		visibility: visible;
		pointer-events: auto;
		box-shadow: none;
	}

	.brixx-dynamic-map-block--legend-mobile-drawer .brixx-dynamic-map__legend {
		height: auto;
		padding: 0;
		overflow: visible;
		background: transparent;
		box-shadow: none;
	}

	.brixx-dynamic-map-block--legend-mobile-drawer.brixx-dynamic-map-block--legend-open {
		overflow: visible;
	}

	/* Below + outside */
	.brixx-dynamic-map-block--legend-desktop-below-outside .brixx-dynamic-map__layout {
		display: flex;
		flex-direction: column;
	}

	.brixx-dynamic-map-block--legend-desktop-below-outside .brixx-dynamic-map__legend-panel {
		margin-top: 1rem;
	}

	.brixx-dynamic-map-block--legend-desktop-below-outside .brixx-dynamic-map__legend {
		padding-top: 1rem;
		border-top: 1px solid rgba(0, 0, 0, 0.12);
	}

	/* Below + inside */
	.brixx-dynamic-map-block--legend-desktop-below-inside .brixx-dynamic-map__legend-panel {
		position: absolute;
		z-index: 2;
		left: 0.75rem;
		right: 0.75rem;
		bottom: 0.75rem;
		max-height: min(40%, 16rem);
		pointer-events: none;
	}

	.brixx-dynamic-map-block--legend-desktop-below-inside .brixx-dynamic-map__legend {
		max-height: min(40vh, 16rem);
		overflow-y: auto;
		padding: 0.75rem 1rem;
		border-top: 0;
		border-radius: 0.5rem;
		background: rgba(255, 255, 255, 0.96);
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
		pointer-events: auto;
	}

	/* Left/right + outside */
	.brixx-dynamic-map-block--legend-desktop-left-outside .brixx-dynamic-map__layout,
	.brixx-dynamic-map-block--legend-desktop-right-outside .brixx-dynamic-map__layout {
		display: flex;
		flex-direction: row;
		align-items: stretch;
		gap: 1rem;
	}

	.brixx-dynamic-map-block--legend-desktop-left-outside .brixx-dynamic-map__layout {
		flex-direction: row-reverse;
	}

	.brixx-dynamic-map-block--legend-desktop-left-outside .brixx-dynamic-map__stage,
	.brixx-dynamic-map-block--legend-desktop-right-outside .brixx-dynamic-map__stage {
		flex: 1 1 auto;
		min-width: 0;
	}

	.brixx-dynamic-map-block--legend-desktop-left-outside .brixx-dynamic-map__legend-panel,
	.brixx-dynamic-map-block--legend-desktop-right-outside .brixx-dynamic-map__legend-panel {
		flex: 0 0 min(100%, 17.5rem);
		width: min(100%, 17.5rem);
		max-height: none;
	}

	.brixx-dynamic-map-block--legend-desktop-left-outside .brixx-dynamic-map__legend,
	.brixx-dynamic-map-block--legend-desktop-right-outside .brixx-dynamic-map__legend {
		height: 100%;
		max-height: 28rem;
		overflow-y: auto;
		padding: 0 0 0 1rem;
		border-top: 0;
		border-left: 1px solid rgba(0, 0, 0, 0.12);
	}

	.brixx-dynamic-map-block--legend-desktop-left-outside .brixx-dynamic-map__legend {
		padding: 0 1rem 0 0;
		border-left: 0;
		border-right: 1px solid rgba(0, 0, 0, 0.12);
	}

	/* Left/right + inside (floating on map) */
	.brixx-dynamic-map-block--legend-desktop-left-inside .brixx-dynamic-map__legend-panel,
	.brixx-dynamic-map-block--legend-desktop-right-inside .brixx-dynamic-map__legend-panel {
		position: absolute;
		z-index: 2;
		top: 0.75rem;
		bottom: 0.75rem;
		width: min(17.5rem, calc(100% - 1.5rem));
		max-height: calc(100% - 1.5rem);
		pointer-events: none;
	}

	.brixx-dynamic-map-block--legend-desktop-left-inside .brixx-dynamic-map__legend-panel {
		left: 0.75rem;
	}

	.brixx-dynamic-map-block--legend-desktop-right-inside .brixx-dynamic-map__legend-panel {
		right: 0.75rem;
	}

	.brixx-dynamic-map-block--legend-desktop-left-inside .brixx-dynamic-map__legend,
	.brixx-dynamic-map-block--legend-desktop-right-inside .brixx-dynamic-map__legend {
		height: 100%;
		max-height: 100%;
		overflow-y: auto;
		padding: 0.75rem 1rem;
		border-top: 0;
		border-radius: 0.5rem;
		background: rgba(255, 255, 255, 0.96);
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
		pointer-events: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.brixx-dynamic-map-block--legend-mobile-drawer .brixx-dynamic-map__legend-panel,
	.brixx-dynamic-map-block--legend-mobile-drawer .brixx-dynamic-map__legend-backdrop {
		transition: none;
	}
}

.brixx-dynamic-map__legend-group + .brixx-dynamic-map__legend-group {
	margin-top: 1.25rem;
}

.brixx-dynamic-map__legend-group-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0 0 0.5rem;
}

.brixx-dynamic-map__legend-group-title {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.3;
}

.brixx-dynamic-map__legend-type-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	min-height: 2rem;
	flex-shrink: 0;
}

.brixx-dynamic-map__legend-type-preview img {
	display: block;
	max-width: 3rem;
	height: auto;
}

.brixx-dynamic-map__legend-markers {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: brixx-dm-leg;
}

.brixx-dynamic-map__legend-marker {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0;
	padding: 0.35rem 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	cursor: default;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.brixx-dynamic-map__legend-marker--has-popup {
	cursor: pointer;
}

.brixx-dynamic-map__legend-marker--has-popup:hover,
.brixx-dynamic-map__legend-marker--has-popup:focus-visible {
	background-color: rgba(0, 0, 0, 0.04);
}

.brixx-dynamic-map__legend-marker-pin {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	max-width: min(100%, 14rem);
}

.brixx-dynamic-map__legend-marker-pin .brixx-dynamic-map__leaflet-pin-wrap--legend-item {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	max-width: 100%;
}

.brixx-dynamic-map__legend-marker-pin .brixx-dynamic-map__leaflet-pin-wrap--legend-item.brixx-dynamic-map__leaflet-pin-wrap--callout {
	align-items: flex-end;
}

.brixx-dynamic-map__legend-marker-pin .brixx-dynamic-map__leaflet-pin-core {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.brixx-dynamic-map__legend-marker-pin .brixx-dynamic-map__leaflet-pin-core img {
	display: block;
	width: auto;
	height: auto;
	max-width: 2rem;
	max-height: 2rem;
}

.brixx-dynamic-map__legend-marker-pin .brixx-dynamic-map__pin-css {
	width: 22px;
	height: 22px;
	--brixx-dm-pin-size: 22px;
}

.brixx-dynamic-map__legend-icon-pin {
	display: block;
	flex-shrink: 0;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center bottom;
}

.brixx-dynamic-map__legend-marker-pin .brixx-dynamic-map__pin-label {
	font-size: 0.8125rem;
	line-height: 1.25;
	max-width: 10rem;
}

/* Theme hook: style legend row when its map pin is hovered/focused */
.brixx-dynamic-map__legend-marker--highlight {
	/* intentionally minimal — override in the theme */
}

.brixx-dynamic-map__legend-marker:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.brixx-dynamic-map__legend-marker:last-child {
	border-bottom: none;
}

.brixx-dynamic-map__legend-marker-num {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	height: 1.5rem;
	padding: 0 0.25rem;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
}

.brixx-dynamic-map__legend-marker-body {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}

.brixx-dynamic-map__legend-marker-title {
	font-size: 0.9375rem;
	line-height: 1.35;
}

.brixx-dynamic-map__legend-marker-title--empty {
	color: #64748b;
	font-style: italic;
}

.brixx-dynamic-map__legend-marker-type {
	font-size: 0.8125rem;
	color: #64748b;
}

@keyframes brixx-dm-pin-bounce {
	0%,
	100% {
		transform: translateY(0);
	}
	35% {
		transform: translateY(-10px);
	}
	55% {
		transform: translateY(0);
	}
	75% {
		transform: translateY(-4px);
	}
}

.brixx-dynamic-map__pin--bounce {
	animation: brixx-dm-pin-bounce 0.55s ease;
	transform-origin: center bottom;
}

@media (prefers-reduced-motion: reduce) {
	.brixx-dynamic-map__pin--bounce {
		animation: none;
	}
}

/* Marker popup (Mapbox GL + Leaflet) */
.brixx-dynamic-map__popup-shell.mapboxgl-popup .mapboxgl-popup-content,
.brixx-dynamic-map .leaflet-popup.brixx-dynamic-map__popup-shell .leaflet-popup-content {
	padding: 0.75rem 0.875rem;
	font-family: inherit;
	font-size: 0.875rem;
	line-height: 1.45;
	color: var(--wp--preset--color--dark-grey, #1a1a1a);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.brixx-dynamic-map__popup {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-width: 0;
}

.brixx-dynamic-map__popup-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.3;
}

.brixx-dynamic-map__popup-identity {
	--brixx-dm-popup-identity-logo-size: 1.5em;
	--brixx-dm-popup-identity-size-offset: 0.8;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 0.35em;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1;
}

.brixx-dynamic-map__popup-identity__logo {
	display: block;
	height: calc(var(--brixx-dm-popup-identity-logo-size) * var(--brixx-dm-popup-identity-size-offset));
	flex-shrink: 0;
}

.brixx-dynamic-map__popup-identity__logo img {
	display: block;
	width: auto;
	height: 100%;
	max-height: calc(var(--brixx-dm-popup-identity-logo-size) * var(--brixx-dm-popup-identity-size-offset));
	object-fit: contain;
}

.brixx-dynamic-map__popup-identity__name {
	font-size: calc((var(--brixx-dm-popup-identity-logo-size) * var(--brixx-dm-popup-identity-size-offset)) * 1.25);
	font-weight: 600;
	line-height: 1.1;
	font-family: inherit;
}

.brixx-dynamic-map__popup-identity--with-name .brixx-dynamic-map__popup-identity__logo {
	height: var(--brixx-dm-popup-identity-logo-size);
}

.brixx-dynamic-map__popup-identity--name-only .brixx-dynamic-map__popup-identity__name {
	font-size: 1rem;
}

.brixx-dynamic-map__popup-status {
	margin: 0;
	display: inline-block;
}

.brixx-dynamic-map__popup-status--on-media {
	position: absolute;
	top: var(--wp--preset--spacing--xxxs, 0.5rem);
	right: var(--wp--preset--spacing--xxxs, 0.5rem);
	z-index: 2;
}

.brixx-dynamic-map__popup-media {
	margin: 0;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	position: relative;
}

.brixx-dynamic-map__popup-media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	border-radius: 0.25rem;
}

.brixx-dynamic-map__popup-description {
	margin: 0;
}

.brixx-dynamic-map__popup-description p:first-child {
	margin-top: 0;
}

.brixx-dynamic-map__popup-description p:last-child {
	margin-bottom: 0;
}

.brixx-dynamic-map__popup-actions {
	margin: 0;
}

.brixx-dynamic-map-block--regatta-dark .brixx-dynamic-map__popup-shell.mapboxgl-popup .mapboxgl-popup-content,
.brixx-dynamic-map-block--regatta-dark .brixx-dynamic-map .leaflet-popup.brixx-dynamic-map__popup-shell .leaflet-popup-content {
	background: var(--wp--preset--color--dark-grey, #2a2a2a);
	color: var(--wp--preset--color--light-grey, #e8e8e8);
}

/* Popup close — theme SVG via mask (assets/images/map-markers/popup-close.svg) */
.brixx-dynamic-map-block--has-popup-close-svg .mapboxgl-popup-close-button,
.brixx-dynamic-map-block--has-popup-close-svg .leaflet-popup-close-button {
	display: block;
	width: 1.5rem;
	height: 1.5rem;
	padding: 0;
	border: 0;
	font-size: 0;
	line-height: 0;
	color: transparent;
	overflow: hidden;
	cursor: pointer;
	background-color: var(--brixx-dm-popup-close-color, var(--wp--preset--color--dark-grey, #1a1a1a));
	-webkit-mask-image: var(--brixx-dm-popup-close-svg);
	mask-image: var(--brixx-dm-popup-close-svg);
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

.brixx-dynamic-map-block--has-popup-close-svg .mapboxgl-popup-close-button:hover,
.brixx-dynamic-map-block--has-popup-close-svg .leaflet-popup-close-button:hover {
	opacity: 0.75;
}

.brixx-dynamic-map-block--has-popup-close-svg .leaflet-popup-close-button {
	text-decoration: none;
}

.brixx-dynamic-map-block--regatta-dark.brixx-dynamic-map-block--has-popup-close-svg .mapboxgl-popup-close-button,
.brixx-dynamic-map-block--regatta-dark.brixx-dynamic-map-block--has-popup-close-svg .leaflet-popup-close-button {
	background-color: var(--brixx-dm-popup-close-color, var(--wp--preset--color--dark-grey, #1a1a1a));
}

/* Mobile popup modal (marker tooltips detached from map position) */
.brixx-dynamic-map__popup-modal {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
	pointer-events: none;
}

.brixx-dynamic-map__popup-modal[aria-hidden='false'] {
	pointer-events: auto;
}

.brixx-dynamic-map__popup-modal[aria-hidden='true'] {
	visibility: hidden;
}

.brixx-dynamic-map__popup-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.brixx-dynamic-map__popup-modal-dialog {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: min(100%, 22rem);
	max-height: min(85dvh, 28rem);
	overflow-y: auto;
	padding: 0.75rem 0.875rem;
	border-radius: 0.5rem;
	background: var(--wp--preset--color--white, #fff);
	color: var(--wp--preset--color--dark-grey, #1a1a1a);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
	font-family: inherit;
	font-size: 0.875rem;
	line-height: 1.45;
}

.brixx-dynamic-map__popup-modal-close {
	position: absolute;
	top: 0.35rem;
	right: 0.35rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

@media (max-width: 767px) {
	.brixx-dynamic-map__popup-modal-close {
		width: 1.25rem;
		height: 1.25rem;
		top: 0.75rem;
		right: 0.75rem;
	}
}

.brixx-dynamic-map__popup-modal-close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.brixx-dynamic-map__popup-modal-body .brixx-dynamic-map__popup {
	gap: 0.5rem;
}

.brixx-dynamic-map-block--regatta-dark .brixx-dynamic-map__popup-modal-dialog {
	background: var(--wp--preset--color--dark-grey, #2a2a2a);
	color: var(--wp--preset--color--light-grey, #e8e8e8);
}

.brixx-dynamic-map-block--regatta-dark.brixx-dynamic-map-block--has-popup-close-svg .brixx-dynamic-map__popup-modal-close {
	background-color: var(--brixx-dm-popup-close-color, var(--wp--preset--color--dark-grey, #1a1a1a));
	-webkit-mask-image: var(--brixx-dm-popup-close-svg);
	mask-image: var(--brixx-dm-popup-close-svg);
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	font-size: 0;
	color: transparent;
}

@media (min-width: 768px) {
	.brixx-dynamic-map__popup-modal {
		display: none !important;
	}
}
