/*
 * [pio_galerie] – Masonry-Galerie mit Lightbox (Ersatz fuer Divi Essential dnxte_masonary).
 * Vorbild Shrek live, gemessen 29.09.2026: 2 Spalten auf allen Geraeten, 10 px Abstand,
 * randlos, Hover = Schwarz 50 % + duennes weisses Plus 32 px, Uebergang 0,5 s.
 * Die Spaltenverteilung macht PHP (kuerzeste Spalte nach Bildmassen), kein Masonry-JS.
 */

.pio-galerie {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	/* Live haengt unter der letzten Reihe 10 px an (margin-bottom der Items). */
	padding-bottom: 10px;
}

.pio-galerie__spalte {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pio-galerie__bild {
	position: relative;
	display: block;
	overflow: hidden;
	line-height: 0;
	cursor: pointer;
}

.pio-galerie__bild img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
}

.pio-galerie__bild::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 7v18M7 16h18' stroke='%23fff' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") center / 32px 32px no-repeat;
	opacity: 0;
	transition: opacity 0.5s;
	pointer-events: none;
}

.pio-galerie__bild:hover::after,
.pio-galerie__bild:focus-visible::after {
	opacity: 1;
}

/* Keine Galeriebilder: die ganze Divi-Sektion ausblenden (Marker kommt aus PHP). */
.et_pb_section:has(.pio-leer) {
	display: none !important;
}

/* Bildnachweis wie Adlerherzen: Open Sans 14 px / 500, #666, Abstand = Divi-Modulabstand */
.pio-galerie__nachweis {
	margin: 39px 0 0;
	padding: 0 !important;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.7;
	color: #666;
}

@media (max-width: 980px) {
	.pio-galerie__nachweis {
		margin-top: 30px;
	}
}

/* ------------------------------------------------------------------ Lightbox */

html.pio-lb-aktiv {
	overflow: hidden;
}

.pio-lb {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.8);
	opacity: 0;
	transition: opacity 0.3s;
	-webkit-user-select: none;
	user-select: none;
}

.pio-lb[hidden] {
	display: none;
}

.pio-lb--offen {
	opacity: 1;
}

.pio-lb__figur {
	position: relative;
	margin: 0;
	line-height: 0;
}

.pio-lb__bild {
	display: block;
	width: auto;
	height: auto;
	max-width: calc(100vw - 180px);
	max-height: calc(100vh - 80px);
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
	cursor: pointer;
}

.pio-lb__zaehler {
	position: absolute;
	right: 8px;
	bottom: 6px;
	font: 12px/18px "Open Sans", Arial, sans-serif;
	white-space: nowrap;
	color: #ccc;
	text-shadow: 0 0 3px #000;
}

.pio-lb__knopf {
	position: fixed;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	opacity: 0.65;
	cursor: pointer;
	transition: opacity 0.2s;
	line-height: 0;
}

.pio-lb__knopf:hover,
.pio-lb__knopf:focus-visible {
	opacity: 1;
}

.pio-lb__knopf svg {
	width: 100%;
	height: 100%;
}

.pio-lb__schliessen {
	top: 8px;
	right: 8px;
	width: 44px;
	height: 44px;
}

.pio-lb__zurueck,
.pio-lb__weiter {
	top: 50%;
	width: 90px;
	height: 110px;
	padding: 35px 30px;
	transform: translateY(-50%);
}

.pio-lb__zurueck {
	left: 0;
}

.pio-lb__weiter {
	right: 0;
}

.pio-lb__knopf[hidden] {
	display: none;
}

@media (max-width: 767px) {
	.pio-lb__bild {
		max-width: calc(100vw - 20px);
		max-height: calc(100vh - 120px);
	}

	.pio-lb__zurueck,
	.pio-lb__weiter {
		width: 50px;
		height: 80px;
		padding: 25px 15px;
	}
}
