/*
 gula-lightbox.css
 Author: SteckDesign
 Eigenständige Lightbox — Farben/Abstände via CSS-Variablen überschreibbar.
*/

.gula-lb {
	/* --lightbox-bg: Feld "Lightbox, Hintergrund" in den Theme Options (gula5-
	   Palette, seit 1.3.0). Ohne Wert die bisherige Vorgabe. */
	--gula-lb-bg:      var(--lightbox-bg, rgba(15, 15, 18, 0.92));
	--gula-lb-fg:      #fff;
	--gula-lb-btn:     rgba(255, 255, 255, 0.85);
	--gula-lb-btn-hov: #fff;

	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	background: var(--gula-lb-bg);
}
.gula-lb.is-open {
	display: flex;
}
body.gula-lb-open {
	overflow: hidden;
}

.gula-lb__stage {
	margin: 0;
	max-width: 92vw;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}
.gula-lb__img {
	display: block;
	max-width: 92vw;
	max-height: 82vh;
	width: auto;
	height: auto;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	background: #00000022;
}
.gula-lb__cap {
	color: var(--gula-lb-fg);
	margin-top: 12px;
	text-align: center;
	font-size: 14px;
	line-height: 1.4;
	max-width: 80ch;
}

/* Buttons */
.gula-lb__close,
.gula-lb__nav {
	position: absolute;
	background: none;
	border: 0;
	color: var(--gula-lb-btn);
	cursor: pointer;
	line-height: 1;
	transition: color .2s ease, transform .2s ease;
	-webkit-tap-highlight-color: transparent;
}
.gula-lb__close:hover,
.gula-lb__nav:hover,
.gula-lb__close:focus-visible,
.gula-lb__nav:focus-visible {
	color: var(--gula-lb-btn-hov);
	outline: none;
}
.gula-lb__close {
	top: 14px;
	right: 20px;
	font-size: 38px;
}
.gula-lb__nav {
	top: 50%;
	transform: translateY(-50%);
	font-size: 56px;
	padding: 0 14px;
	user-select: none;
}
.gula-lb__nav:hover {
	transform: translateY(-50%) scale(1.1);
}
.gula-lb__prev { left: 8px; }
.gula-lb__next { right: 8px; }

/* Vollbild (data-gula-fullscreen am Link) */
.gula-lb__full {
	position: absolute;
	top: 18px;
	right: 70px;
	background: none;
	border: 1px solid currentColor;
	border-radius: 4px;
	color: var(--gula-lb-btn);
	font: 14px/1 inherit;
	padding: 7px 10px;
	cursor: pointer;
	opacity: .85;
}
.gula-lb__full:hover,
.gula-lb__full:focus-visible {
	color: var(--gula-lb-btn-hov);
	opacity: 1;
	outline: none;
}
.gula-lb:fullscreen .gula-lb__stage { max-width: 100vw; max-height: 100vh; }
.gula-lb:fullscreen .gula-lb__img   { max-width: 100vw; max-height: calc(100vh - 44px); box-shadow: none; }
.gula-lb:fullscreen .gula-lb__cap   { margin-top: 6px; }

/* Eigener Hintergrund (data-gula-bg am Link): keine graue Bildflaeche, kein
   Schatten – freigestellte Bilder stuenden sonst auf einer grauen Buehne. */
.gula-lb--eigen .gula-lb__img { background: transparent; box-shadow: none; }
.gula-lb--hell {
	--gula-lb-fg:      #222;
	--gula-lb-btn:     rgba(0, 0, 0, 0.65);
	--gula-lb-btn-hov: #000;
}

@media (max-width: 600px) {
	.gula-lb__full { top: 10px; right: 52px; }
	.gula-lb__nav  { font-size: 40px; padding: 0 8px; }
	.gula-lb__close{ font-size: 32px; top: 8px; right: 12px; }
	.gula-lb__img  { max-height: 76vh; }
}

@media (prefers-reduced-motion: reduce) {
	.gula-lb__close,
	.gula-lb__nav { transition: none; }
	.gula-lb__nav:hover { transform: translateY(-50%); }
}
