/* Lightbox (assets/js/lightbox.js, eingebunden über snippet('bilder/lightbox')): Bildergalerie mit Blättern, Tastatur und Wischen */

/* Vorschaubild: beim Hover leicht hineinzoomen und Doppelpfeil einblenden */
[data-lightbox] {
	position: relative;
	display: block;
	overflow: hidden;
	cursor: zoom-in;
}

[data-lightbox] img {
	transition: transform 0.35s ease-out;
}

[data-lightbox]:hover img,
[data-lightbox]:focus-visible img {
	transform: scale(1.04);
}

.wl-zoom-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 2rem;
	height: 2rem;
	margin: -1rem 0 0 -1rem;
	color: rgba(255, 255, 255, 0.85);
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
	opacity: 0;
	transition: opacity 0.35s ease-out;
	pointer-events: none;
}

.wl-zoom-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* !important wegen style="opacity: 0" im HTML: ohne dieses CSS bleibt das Icon unsichtbar */
[data-lightbox]:hover .wl-zoom-icon,
[data-lightbox]:focus-visible .wl-zoom-icon {
	opacity: 1 !important;
}

.wl-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #0a0a0a;
	color: #fff;
	opacity: 0;
	transition: opacity 0.25s ease;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.wl-lightbox[hidden] {
	display: none;
}

.wl-lightbox.is-open {
	opacity: 1;
}

.wl-lightbox__stage {
	position: absolute;
	inset: 0;
	overflow: hidden;
}

.wl-lightbox__slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4rem 1rem 1.5rem;
	box-sizing: border-box;
	transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.35s ease;
	will-change: transform;
}

.wl-lightbox__slide[aria-hidden="true"] {
	visibility: hidden;
	pointer-events: none;
}

@media (min-width: 768px) {
	.wl-lightbox__slide {
		padding: 4rem 5rem 2rem;
	}
}

/* Bild mit Unterschrift darunter; die Bildgröße setzt lightbox.js (echte Pixel, höchstens der Platz) */
.wl-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
}

.wl-lightbox__slide img {
	display: block;
	max-width: 100%;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	opacity: 0;
	transition: opacity 0.2s ease;
	-webkit-user-drag: none;
}

.wl-lightbox__slide img.is-loaded {
	opacity: 1;
}

.wl-lightbox__slide picture {
	display: contents;
}

.wl-lightbox__spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 2.5rem;
	height: 2.5rem;
	margin: -1.25rem 0 0 -1.25rem;
	border: 2px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: wl-lightbox-spin 0.8s linear infinite;
}

.wl-lightbox__slide.is-loaded .wl-lightbox__spinner {
	display: none;
}

@keyframes wl-lightbox-spin {
	to { transform: rotate(360deg); }
}

/* Leiste oben (Zähler, Schließen) und Pfeile */
.wl-lightbox__toolbar,
.wl-lightbox__nav {
	position: absolute;
	z-index: 1;
	transition: opacity 0.3s ease;
}

.wl-lightbox.is-idle .wl-lightbox__toolbar,
.wl-lightbox.is-idle .wl-lightbox__nav {
	opacity: 0;
}

.wl-lightbox__toolbar {
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0.5rem 0.5rem 1rem;
	background: linear-gradient(rgba(0, 0, 0, 0.35), transparent);
	font-size: 0.875rem;
	font-variant-numeric: tabular-nums;
}

.wl-lightbox__caption {
	padding-top: 0.75rem;
	font-size: 0.95rem;
	line-height: 1.4;
	text-align: center;
	user-select: text;
	-webkit-user-select: text;
}

.wl-lightbox__caption p {
	margin: 0;
}

.wl-lightbox__photographer {
	margin-top: 0.25rem;
	font-size: 0.8rem;
	opacity: 0.7;
}

.wl-lightbox button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	opacity: 0.8;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.wl-lightbox button:hover,
.wl-lightbox button:focus-visible {
	opacity: 1;
	background: rgba(255, 255, 255, 0.12);
}

.wl-lightbox button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.wl-lightbox button svg {
	width: 1.5rem;
	height: 1.5rem;
}

.wl-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
}

.wl-lightbox__nav--prev {
	left: 0.5rem;
}

.wl-lightbox__nav--next {
	right: 0.5rem;
}

/* Auf Touch-Geräten wird gewischt, die Pfeile stören dort nur */
@media (hover: none) {
	.wl-lightbox__nav {
		display: none !important;
	}
}

.wl-lightbox.is-single .wl-lightbox__nav,
.wl-lightbox.is-single .wl-lightbox__counter {
	display: none;
}

.wl-lightbox-lock {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	[data-lightbox] img,
	.wl-lightbox,
	.wl-lightbox__slide,
	.wl-lightbox__slide img {
		transition: none;
	}
}
