/* urform Karte – Frontend */

.uf-map {
	position: relative;
	width: 100%;
	height: var(--uf-map-h, 450px);
	border-radius: var(--uf-map-radius, 0);
	overflow: hidden;
	isolation: isolate;
	background: #eeefec;
	font-family: var(--uf-map-font, inherit);
}

@media (max-width: 767px) {
	.uf-map {
		height: var(--uf-map-h-m, var(--uf-map-h, 360px));
	}
}

/* Höhere Spezifität nötig: MapLibre setzt auf dem Container .maplibregl-map { position: relative }. */
.uf-map .uf-map__canvas,
.uf-map-admin__preview .uf-map__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Pin */
.uf-map__pin {
	display: block;
	line-height: 0;
	cursor: pointer;
	text-decoration: none;
	border: 0;
	outline: none;
	/* Kein transform/transition hier – MapLibre positioniert das Element per transform. */
}

.uf-map__pin img {
	display: block;
	max-width: none;
	height: auto;
	pointer-events: none;
	user-select: none;
	filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
	transition: transform 0.2s ease;
}

a.uf-map__pin:hover img,
a.uf-map__pin:focus-visible img {
	transform: translateY(-3px);
}

.uf-map__pin--popup:hover img,
.uf-map__pin--popup:focus-visible img {
	transform: translateY(-3px);
}

.uf-map__pin--popup:focus-visible,
a.uf-map__pin:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	a.uf-map__pin:hover img,
	a.uf-map__pin:focus-visible img {
		transform: none;
	}
}

/* 2-Klick-Hinweis */
.uf-map__consent {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(238, 239, 236, 0.96);
	text-align: center;
}

.uf-map__consent-inner {
	max-width: 440px;
}

.uf-map__consent-text {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.5;
	color: #333;
}

.uf-map__consent-text a {
	color: inherit;
	text-decoration: underline;
}

.uf-map__consent-button {
	display: inline-block;
	padding: 10px 22px;
	border: 0;
	border-radius: 2px;
	background: #1d1d1b;
	color: #fff;
	font: inherit;
	font-family: var(--uf-map-font, inherit);
	font-size: 14px;
	cursor: pointer;
}

.uf-map__consent-button:hover,
.uf-map__consent-button:focus-visible {
	opacity: 0.85;
}

/* Fehler / ohne JavaScript */
.uf-map__error,
.uf-map__fallback {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 24px;
	font-size: 14px;
	text-align: center;
	color: #333;
}

.uf-map__error p {
	margin: 0;
}

.uf-map__error a {
	color: inherit;
}

/* Quellenangabe dezent, aber lesbar */
.uf-map .maplibregl-ctrl-attrib {
	font-size: 11px;
}

.uf-map .maplibregl-ctrl-attrib a.uf-map__credit {
	white-space: nowrap;
}

/* Diagnose – nur für eingeloggte Administratoren */
.uf-map__diag {
	position: absolute;
	top: 12px;
	left: 12px;
	right: 12px;
	z-index: 6;
	max-height: calc(100% - 24px);
	overflow: auto;
	padding: 12px 14px;
	background: #fff;
	border-left: 4px solid #d63638;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: #1d2327;
	text-align: left;
}

.uf-map__diag ul {
	margin: 6px 0;
	padding-left: 18px;
}

.uf-map__diag p {
	margin: 6px 0 0;
}

.uf-map__diag-meta {
	color: #646970;
	font-size: 11px;
}

/* Hinweis „Skript nicht ausgeführt“ erst nach einigen Sekunden zeigen */
.uf-map__diag--boot {
	opacity: 0;
	animation: uf-map-diag-in 0.3s ease 5s forwards;
}

@keyframes uf-map-diag-in {
	to {
		opacity: 1;
	}
}

/*
 * Schutz vor Theme-/Elementor-Button-Styles (z. B. globale „Buttons“ im Elementor-Kit):
 * Steuerelemente der Karte und das × des Infofensters bekommen ihr eigenes, festes Aussehen.
 */
.uf-map .maplibregl-map .maplibregl-ctrl-group button,
.uf-map .maplibregl-map button.maplibregl-popup-close-button,
.uf-map .maplibregl-map button.maplibregl-ctrl-attrib-button,
.uf-map-admin__preview .maplibregl-map .maplibregl-ctrl-group button,
.uf-map-admin__preview .maplibregl-map button.maplibregl-popup-close-button {
	box-sizing: border-box !important;
	margin: 0 !important;
	padding: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background-color: transparent !important;
	color: #333 !important;
	font-family: inherit !important;
	font-weight: 400 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	text-decoration: none !important;
	transform: none !important;
	transition: background-color 0.15s ease !important;
	cursor: pointer;
}

.uf-map .maplibregl-map .maplibregl-ctrl-group button,
.uf-map-admin__preview .maplibregl-map .maplibregl-ctrl-group button {
	display: block !important;
	width: 29px !important;
	height: 29px !important;
}

.uf-map .maplibregl-map .maplibregl-ctrl-group button + button,
.uf-map-admin__preview .maplibregl-map .maplibregl-ctrl-group button + button {
	border-top: 1px solid #ddd !important;
}

.uf-map .maplibregl-map .maplibregl-ctrl-group button:hover,
.uf-map .maplibregl-map .maplibregl-ctrl-group button:focus-visible,
.uf-map-admin__preview .maplibregl-map .maplibregl-ctrl-group button:hover {
	background-color: rgba(0, 0, 0, 0.05) !important;
}

.uf-map .maplibregl-map button.maplibregl-ctrl-attrib-button {
	width: 24px !important;
	height: 24px !important;
	border-radius: 12px !important;
	background-color: rgba(0, 0, 0, 0.05) !important;
}

/* × im Infofenster: dezent, rund, sauber zentriert */
.uf-map .maplibregl-map button.maplibregl-popup-close-button,
.uf-map-admin__preview .maplibregl-map button.maplibregl-popup-close-button {
	position: absolute !important;
	top: 8px !important;
	right: 8px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 26px !important;
	height: 26px !important;
	border-radius: 50% !important;
	color: #646970 !important;
	font-size: 0 !important; /* Textzeichen ausblenden, Kreuz kommt per CSS */
	line-height: 1 !important;
}

.uf-map .maplibregl-map button.maplibregl-popup-close-button::before,
.uf-map .maplibregl-map button.maplibregl-popup-close-button::after,
.uf-map-admin__preview .maplibregl-map button.maplibregl-popup-close-button::before,
.uf-map-admin__preview .maplibregl-map button.maplibregl-popup-close-button::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 1.5px;
	border-radius: 1px;
	background: currentColor;
}

.uf-map .maplibregl-map button.maplibregl-popup-close-button::before,
.uf-map-admin__preview .maplibregl-map button.maplibregl-popup-close-button::before {
	transform: translate(-50%, -50%) rotate(45deg);
}

.uf-map .maplibregl-map button.maplibregl-popup-close-button::after,
.uf-map-admin__preview .maplibregl-map button.maplibregl-popup-close-button::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.uf-map .maplibregl-map button.maplibregl-popup-close-button:hover,
.uf-map .maplibregl-map button.maplibregl-popup-close-button:focus-visible,
.uf-map-admin__preview .maplibregl-map button.maplibregl-popup-close-button:hover {
	background-color: rgba(0, 0, 0, 0.07) !important;
	color: #1d1d1b !important;
}

.uf-map .maplibregl-map button:focus-visible {
	outline: 2px solid var(--uf-map-accent, #1d1d1b) !important;
	outline-offset: 1px !important;
}

/* Infofenster am Pin */
.uf-map .uf-map__popup-wrap {
	z-index: 4;
}

.uf-map .uf-map__popup-wrap .maplibregl-popup-content {
	padding: 14px 34px 14px 16px;
	border-radius: 6px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	font-family: var(--uf-map-font, inherit);
	color: #1d1d1b;
	text-align: left;
}

.uf-map__popup p {
	margin: 0 0 6px;
	font-size: 14px;
	line-height: 1.45;
}

.uf-map__popup .uf-map__popup-title {
	margin-bottom: 4px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.uf-map__popup .uf-map__popup-extra a {
	color: inherit;
}

.uf-map__popup .uf-map__popup-link {
	display: inline-block;
	margin-top: 4px;
	color: var(--uf-map-accent, #1d1d1b);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.uf-map__popup .uf-map__popup-link::after {
	content: " \2197";
}

.uf-map__popup .uf-map__popup-link:hover,
.uf-map__popup .uf-map__popup-link:focus-visible {
	text-decoration: underline;
}
