.energo-mapa {
	/* Bez wlasnej szerokosci: o niej decyduje kontener albo klasa alignfull
	   motywu. Ustawienie width: 100% bilo sie z alignfull i na telefonie
	   dawalo za szeroki blok. */
	max-width: none;
	box-sizing: border-box;
	color: var( --energo-ink );
	/* Leaflet rozdaje swoim warstwom z-index od 400 do 800. Bez wlasnego
	   kontekstu ukladania te liczby licza sie globalnie i mapa wychodzi nad
	   przyklejony naglowek motywu. */
	isolation: isolate;
}

.energo-mapa *,
.energo-mapa *::before,
.energo-mapa *::after {
	box-sizing: border-box;
}

.energo-mapa__plotno {
	border: 1px solid var( --energo-line );
	border-radius: 6px;
	background: var( --energo-white );
}

.energo-mapa__status {
	margin: 12px 0 0;
	color: var( --energo-muted );
	font-size: 0.9em;
}

.energo-mapa__status--blad {
	color: var( --energo-red );
}

/* ---- Układ dwukolumnowy ---- */

.energo-mapa__uklad {
	display: flex;
	gap: 16px;
	align-items: stretch;
}

.energo-mapa__panel {
	flex: 0 0 260px;
	height: var( --energo-mapa-wysokosc );
	overflow-y: auto;
	padding: 12px 14px;
	border: 1px solid var( --energo-line );
	border-radius: 6px;
	background: var( --energo-white );
}

.energo-mapa__uklad .energo-mapa__plotno {
	flex: 1 1 auto;
	min-width: 0;
	height: var( --energo-mapa-wysokosc );
}

/* Na telefonie kolumna filtrow zajmowala caly pierwszy ekran, a mapa lezala
   pod zgieciem. Mapa idzie wiec na gore, a filtry pod nia — nadal w calosci
   widoczne, bez zwijania. */
@media ( max-width: 782px ) {
	.energo-mapa__uklad {
		flex-direction: column;
		gap: 12px;
	}

	.energo-mapa__uklad .energo-mapa__plotno {
		order: 1;
		height: min( var( --energo-mapa-wysokosc ), 42vh );
	}

	.energo-mapa__panel {
		order: 2;
		flex: 0 0 auto;
		height: auto;
		max-height: none;
		overflow: visible;
	}

	/* Cel dotykowy nigdy ponizej 44 px. */
	.energo-mapa__filtr {
		min-height: 48px;
		padding: 12px 0;
	}

	.energo-mapa__filtr input {
		width: 22px;
		height: 22px;
	}

	.energo-mapa__filtr input:checked::after {
		top: 2px;
		left: 6px;
		width: 5px;
		height: 11px;
	}
}

/* ---- Filtry ---- */

.energo-mapa__grupa {
	margin: 0 0 18px;
	padding: 0;
	border: 0;
}

.energo-mapa__grupa:last-of-type {
	margin-bottom: 0;
}

/* Nagłówek sekcji z podkresleniem w kolorze akcentu. */
.energo-mapa__legenda {
	display: block;
	margin: 0 0 12px;
	padding: 0 0 8px;
	position: relative;
	color: var( --energo-ink );
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.07em;
	line-height: 1.3;
	text-transform: uppercase;
}

.energo-mapa__legenda::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 26px;
	height: 2px;
	border-radius: 2px;
	background: var( --energo-orange );
}

.energo-mapa__filtr {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 10px 0;
	border-bottom: 1px solid #f1f1ef;
	cursor: pointer;
	font-size: 13.5px;
	line-height: 1.35;
}

.energo-mapa__filtr:last-child {
	border-bottom: 0;
}

/* Odznaczony wiersz gasnie, zeby stan bylo widac bez szukania ptaszka. */
.energo-mapa__filtr--wylaczony {
	opacity: 0.45;
}

.energo-mapa__nazwa {
	flex: 1 1 auto;
	min-width: 0;
	font-weight: 600;
}

/* Pole wyboru wyrownane do prawej krawedzi wiersza.
   Wlasny ksztalt zamiast accent-color, bo ten daje pomaranczowe tlo z bialym
   ptaszkiem, a potrzebne jest odwrotnie: biale pole z pomaranczowym ptaszkiem. */
.energo-mapa__filtr input {
	flex: 0 0 auto;
	order: 2;
	position: relative;
	width: 18px;
	height: 18px;
	margin: 0;
	padding: 0;
	appearance: none;
	-webkit-appearance: none;
	border: 2px solid var( --energo-line );
	border-radius: 3px;
	background: var( --energo-white );
	cursor: pointer;
}

.energo-mapa__filtr input:checked {
	border-color: var( --energo-orange );
}

.energo-mapa__filtr input:checked::after {
	content: "";
	position: absolute;
	top: 1px;
	left: 5px;
	width: 4px;
	height: 9px;
	border: solid var( --energo-orange );
	border-width: 0 2.5px 2.5px 0;
	transform: rotate( 45deg );
}

.energo-mapa__filtr input:hover {
	border-color: var( --energo-orange );
}

.energo-mapa__filtr input:focus-visible {
	outline: 2px solid var( --energo-orange );
	outline-offset: 2px;
}

.energo-mapa__filtr:hover .energo-mapa__nazwa {
	color: var( --energo-orange );
}

/* Podglad znacznika: ten sam ksztalt, ktory stoi na mapie. */
.energo-mapa__pin {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
}

.energo-mapa__pin > span {
	display: block;
	width: 16px;
	height: 16px;
	border: 2px solid var( --energo-white );
	border-radius: 50% 50% 50% 0;
	transform: rotate( -45deg );
	box-shadow: 0 1px 3px rgba( 0, 0, 0, 0.35 );
}

.energo-mapa__pin--oddzial {
	width: 24px;
	height: 24px;
	border: 2px solid var( --energo-orange );
	border-radius: 50%;
	background: var( --energo-white );
}

.energo-mapa__pin--oddzial img {
	display: block;
	width: 15px;
	height: auto;
}

/* Podsumowanie: ile punktow zostalo po filtrach. */
.energo-mapa__licznik {
	margin: 16px 0 0;
	padding: 14px 0 0;
	border-top: 1px solid #ececea;
	color: var( --energo-muted );
	font-size: 12px;
	line-height: 1.4;
}

.energo-mapa__licznik strong {
	color: var( --energo-ink );
	font-weight: 700;
}

/* ---- Pinezki ---- */

.energo-pin {
	display: flex;
	align-items: center;
	justify-content: center;
}

.energo-pin span {
	display: block;
	width: 28px;
	height: 28px;
	border: 3px solid var( --energo-white );
	border-radius: 50% 50% 50% 0;
	transform: rotate( -45deg );
	box-shadow: 0 2px 5px rgba( 0, 0, 0, 0.4 );
}

/* Oddzial: sygnet z logo w bialym kolku z pomaranczowa obwodka. Znak firmowy
   odroznia go od realizacji mocniej niz sam kolor, czego wymaga umowa. */
.energo-pin-oddzial {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border: 3px solid var( --energo-orange );
	border-radius: 50%;
	background: var( --energo-white );
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.35 );
}

.leaflet-marker-icon .energo-pin-oddzial img,
.energo-pin-oddzial img {
	display: block;
	width: 32px;
	height: auto;
	max-width: 32px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

/* Wariant maly: na telefonie pinezka 46 px zaslaniala pol wojewodztwa.
   Musi isc po regule przebijajacej Leaflet, inaczej dostaje szerokosc z niej
   zamiast wlasnej. */
.energo-pin-oddzial--maly {
	width: 36px;
	height: 36px;
	border-width: 2px;
}


.leaflet-marker-icon .energo-pin-oddzial--maly img,
.energo-pin-oddzial--maly img {
	width: 22px;
	max-width: 22px;
}

/* ---- Klastry ---- */

/* Klaster to licznik, nie punkt. Rozroznienie idzie przez wypelnienie, nie
   przez kolor: klaster jest pomaranczowy w srodku z biala cyfra, a pinezka
   oddzialu odwrotnie — biala w srodku z pomaranczowa obwodka i sygnetem.
   Wczesniejsze ciemne wypelnienie odroznialo je, ale wypadalo z palety. */
.energo-klaster {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 2px solid var( --energo-white );
	border-radius: 50%;
	background: var( --energo-orange );
	color: var( --energo-white );
	font-weight: 700;
	font-size: 0.85em;
	font-variant-numeric: tabular-nums;
	box-shadow: 0 2px 6px rgba( 0, 0, 0, 0.3 );
}

/* ---- Dymek ---- */

/* Wszystkie regulacje dymka sa scalone pod `.energo-mapa`, zeby przebic
   motyw: `.wp-block-post-content a` ma specyficznosc 0-2-0 i bez tego
   narzuca wlasny kolor, podkreslenie i rozmiar odnosnikom w karcie. */

.energo-mapa .leaflet-popup-content-wrapper {
	padding: 0;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 6px 22px rgba( 0, 0, 0, 0.22 );
}

.energo-mapa .leaflet-popup-content {
	margin: 0;
	line-height: 1.4;
}

/* Zamkniecie: motyw stylowal je jak zwykly odnosnik tresci. Bez tla, zeby nie
   powtarzac kolka — pinezka oddzialu i klaster juz sa okragle. */
.energo-mapa .leaflet-container a.leaflet-popup-close-button {
	top: 4px;
	right: 6px;
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: #6b6b6b;
	font: 400 30px/1 Manrope, system-ui, sans-serif;
	text-decoration: none;
}

.energo-mapa .leaflet-container a.leaflet-popup-close-button:hover {
	background: none;
	color: var( --energo-orange );
	text-decoration: none;
}

.energo-mapa .energo-dymek {
	width: 280px;
	font-family: inherit;
	font-size: 13px;
	color: var( --energo-ink );
	line-height: 1.4;
}

.energo-mapa .energo-dymek__media {
	position: relative;
	display: block;
	height: 132px;
	background: #dfe4dc;
}

.energo-mapa .energo-dymek__media img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
}

.energo-mapa .energo-dymek__pas {
	padding: 13px 16px 0;
}

.energo-mapa .energo-dymek__pigulka {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba( 255, 255, 255, 0.94 );
	font-size: 11px;
	font-weight: 600;
	line-height: 1.3;
	color: var( --energo-ink );
	white-space: nowrap;
}

.energo-mapa .energo-dymek__media .energo-dymek__pigulka {
	position: absolute;
	left: 12px;
	top: 12px;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.18 );
}

.energo-mapa .energo-dymek__pas .energo-dymek__pigulka {
	padding-left: 0;
	background: none;
}

.energo-mapa .energo-dymek__kropka {
	flex: 0 0 auto;
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.energo-mapa .energo-dymek__tresc {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 13px 16px 16px;
}

.energo-mapa .energo-dymek__tytul {
	display: block;
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: var( --energo-ink );
	text-decoration: none;
	text-wrap: pretty;
}

.energo-mapa a.energo-dymek__tytul:hover {
	color: var( --energo-orange );
	text-decoration: none;
}

.energo-mapa .energo-dymek__chipy {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.energo-mapa .energo-dymek__chip {
	padding: 4px 9px;
	border-radius: 5px;
	background: #f4f5f2;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.3;
	color: #4a4a4a;
}

/* Odnosnik tekstowy, nie przycisk — na zyczenie klienta. */
.energo-mapa .energo-dymek__wiecej {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 6px;
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.3;
	color: var( --energo-orange );
	text-decoration: none;
}

.energo-mapa .energo-dymek__wiecej:hover {
	color: #c65600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.energo-mapa .energo-dymek__ikona {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	color: #9aa295;
}

.energo-mapa .energo-dymek__ikona--strzalka {
	width: 14px;
	height: 14px;
	color: currentColor;
	stroke-width: 2.2;
}

/* ---- Dymek oddzialu ---- */

.energo-mapa .energo-dymek__naglowek {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 14px 40px 14px 16px;
	background: #fff6ee;
	border-bottom: 1px solid #f6e2d2;
}

.energo-mapa .energo-dymek__sygnet {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border: 2px solid var( --energo-orange );
	border-radius: 50%;
	background: var( --energo-white );
}

.energo-mapa .energo-dymek__sygnet img {
	display: block;
	width: 21px;
	height: auto;
	margin: 0;
}

.energo-mapa .energo-dymek__podpis {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.energo-mapa .energo-dymek__nadtytul {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.07em;
	line-height: 1.3;
	text-transform: uppercase;
	color: #c65600;
}

.energo-mapa .energo-dymek--oddzial .energo-dymek__tresc {
	gap: 0;
	padding: 4px 16px 12px;
}

.energo-mapa .energo-dymek__wiersz {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 0;
	border-top: 1px solid #f0f0ee;
	color: #4a4a4a;
	font-size: 12.5px;
	line-height: 1.4;
	text-decoration: none;
}

.energo-mapa .energo-dymek__wiersz:first-child {
	border-top: 0;
}

.energo-mapa .energo-dymek__wiersz--klik {
	color: var( --energo-ink );
	font-weight: 600;
}

.energo-mapa .energo-dymek__wiersz--klik .energo-dymek__ikona {
	color: var( --energo-orange );
}

.energo-mapa .energo-dymek__wiersz--klik:hover {
	color: var( --energo-orange );
	text-decoration: none;
}

.energo-mapa .energo-dymek__wiersz--klik:hover .energo-dymek__wartosc {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.energo-mapa .energo-dymek__wiersz--mocny {
	font-size: 13.5px;
	font-weight: 700;
}

.energo-mapa .energo-dymek__wartosc {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* Wyjscie poza ograniczenie szerokosci tresci narzucone przez motyw.
   W motywach blokowych robi to klasa alignfull dokladana w szablonie: uklad
   constrained wyklucza ja regula :not(.alignfull), a robienie tego samego
   wlasnym selektorem wymagaloby przebicia specyficznosci motywu.
   Ponizsze jest zapasem dla motywow klasycznych, ktore alignfull nie znaja —
   dlatego margines liczy sie wzgledem 100vw, a nie wzgledem rodzica. */
.energo-mapa--pelna:not( .wp-block-post-content .energo-mapa--pelna ) {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc( 50% - 50vw );
	margin-right: calc( 50% - 50vw );
}

.energo-mapa--pelna {
	padding-left: clamp( 16px, 4vw, 64px );
	padding-right: clamp( 16px, 4vw, 64px );
}
