/* Die Klasse landet je nach Editor entweder direkt am <img> oder (Standard beim
   Gutenberg-Bild-Block: "Zusätzliche CSS-Klasse(n)") an einem umschließenden Element
   (z.B. <figure class="wp-block-image sbb-lightbox">) - beide Fälle abgedeckt. Bilder in einer
   Jetpack Tiled Gallery bekommen den Cursor automatisch, ganz ohne eigene Klasse (siehe lightbox.js). */
img.sbb-lightbox,
.sbb-lightbox img,
.tiled-gallery__item img {
	cursor: zoom-in;
}

body.sbb-lightbox-locked {
	overflow: hidden;
}

.sbb-lightbox-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.9);
	padding: 20px;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease;
}

.sbb-lightbox-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.sbb-lightbox-overlay img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.sbb-lightbox-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sbb-lightbox-close:hover,
.sbb-lightbox-close:focus {
	background: rgba(255, 255, 255, 0.3);
}

.sbb-lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Eigene Regel nötig, weil "display: flex" oben sonst das UA-Standardverhalten von [hidden]
   (display: none) überschreiben und den Pfeil trotz hidden-Attribut sichtbar lassen würde. */
.sbb-lightbox-nav[hidden] {
	display: none;
}

.sbb-lightbox-nav:hover,
.sbb-lightbox-nav:focus {
	background: rgba(255, 255, 255, 0.3);
}

.sbb-lightbox-prev {
	left: 12px;
}

.sbb-lightbox-next {
	right: 12px;
}

@media (max-width: 600px) {
	.sbb-lightbox-nav {
		width: 44px;
		height: 44px;
		font-size: 28px;
	}
}
