/**
 * Widget mapy Polski.
 *
 * Kolory województw ustawia Elementor przez selektory kontrolek stylu.
 * Tutaj zostaje wyłącznie układ, dostępność i skala nasycenia dla
 * kolorowania danymi.
 */

.cu-map {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	width: 100%;
}

.cu-map__svg {
	width: 100%;
	height: auto;
	display: block;
	overflow: visible;
}

.cu-map__region {
	fill: #7ee0b0;
	stroke: #ffffff;
	stroke-width: 1.5;
	stroke-linejoin: round;
	cursor: pointer;
	transition-property: fill, stroke, transform, filter;
	transition-duration: 180ms;
	transition-timing-function: ease;
	transform-origin: center;
	transform-box: fill-box;
}

.cu-map__region[aria-disabled="true"] {
	cursor: default;
}

.cu-map__region:focus {
	outline: none;
}

.cu-map__region:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
}

/* Efekty po najechaniu — dobierane kontrolką w Elementorze. */

.cu-map--hover-lift .cu-map__region:hover:not([aria-disabled="true"]) {
	transform: translateY(-3px);
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

.cu-map--hover-lighten .cu-map__region:hover:not([aria-disabled="true"]) {
	filter: brightness(1.12);
}

.cu-map--hover-outline .cu-map__region:hover:not([aria-disabled="true"]) {
	stroke-width: 3;
}

@media (prefers-reduced-motion: reduce) {
	.cu-map__region {
		transition: none;
	}

	.cu-map--hover-lift .cu-map__region:hover {
		transform: none;
	}
}

/*
 * Kolorowanie danymi. Zamiast liczyć osobne kolory w PHP, modulujemy
 * przezroczystość koloru podstawowego — dzięki temu skala zawsze pasuje
 * do koloru wybranego w Elementorze.
 */
.cu-map--choropleth .cu-map__region[data-bucket] {
	opacity: calc(0.42 + var(--cu-bucket, 0) * 0.145);
}

.cu-map__label {
	font-size: 11px;
	font-weight: 600;
	fill: #0d3f2e;
	pointer-events: none;
	user-select: none;
}

@media (max-width: 480px) {
	.cu-map__label {
		display: none;
	}
}

.cu-map__legend {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	flex-wrap: wrap;
	font-size: 0.8rem;
}

.cu-map__legend-scale {
	display: inline-flex;
	gap: 2px;
}

.cu-map__legend-step {
	width: 22px;
	height: 10px;
	border-radius: 2px;
	background: currentColor;
	opacity: calc(0.42 + var(--cu-bucket, 0) * 0.145);
}

.cu-map__notice {
	max-width: 46rem;
	margin: 0;
	padding: 0.7rem 0.9rem;
	border-left: 3px solid #15795a;
	background: rgba(21, 121, 90, 0.08);
	font-size: 0.82rem;
	line-height: 1.5;
}

.cu-map__notice--warning {
	border-left-color: #b4652a;
	background: rgba(180, 101, 42, 0.1);
}

/* Placeholder dla przycisku, którego dokument nie istnieje. */
.cu-dyn-link--empty {
	pointer-events: none;
	opacity: 0.45;
}
