/* ── Minimal-Lightbox ────────────────────────────────────────────────────────
 * <dialog>-basiert, sanftes Fade + Zoom, respektiert reduced-motion. */

.jl-lightbox {
	max-width: none;
	max-height: none;
	width: 100vw;
	height: 100dvh;
	margin: 0;
	padding: clamp(1rem, 4vw, 3rem);
	border: none;
	background: transparent;
	display: none;
	align-items: center;
	justify-content: center;
}

.jl-lightbox[open] {
	display: flex;
}

.jl-lightbox::backdrop {
	background: color-mix(in oklab, var(--wp--preset--color--contrast, #26272B) 92%, transparent);
	backdrop-filter: none;
}

.jl-lightbox-figure {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	max-width: 100%;
	max-height: 100%;
	pointer-events: none;
}

.jl-lightbox-img {
	max-width: 100%;
	max-height: calc(100dvh - 8rem);
	object-fit: contain;
	border-radius: 4px;
	pointer-events: auto;
}

.jl-lightbox-caption {
	color: #FAF7F2;
	font-size: 0.875rem;
	opacity: 0.75;
	text-align: center;
	max-width: 60ch;
}

/* Öffnungs-Animation (Fallback ohne View-Transition-Support) */
.jl-lightbox[open] .jl-lightbox-figure {
	animation: jl-lightbox-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Läuft der View-Transition-Morph (JS setzt .jl-vt), übernimmt der den
 * Auftritt — die Fallback-Animation würde doppeln. */
.jl-lightbox.jl-vt[open] .jl-lightbox-figure {
	animation: none;
}

/* Morph Thumbnail ↔ Lightbox-Bild */
::view-transition-group(jl-lb) {
	animation-duration: 0.35s;
	animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes jl-lightbox-in {
	from {
		opacity: 0;
		transform: scale(0.96);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Buttons */
.jl-lightbox button {
	position: fixed;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	border: 1px solid rgba(250, 247, 242, 0.3);
	background: rgba(0, 0, 0, 0.35);
	color: #FAF7F2;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.75;
	transition: opacity 0.2s ease, transform 0.2s ease;
	padding: 0;
}

.jl-lightbox button:hover {
	opacity: 1;
	transform: scale(1.08);
}

.jl-lightbox-close {
	top: 1.25rem;
	right: 1.25rem;
}

.jl-lightbox-prev {
	left: 1.25rem;
	top: 50%;
	translate: 0 -50%;
}

.jl-lightbox-next {
	right: 1.25rem;
	top: 50%;
	translate: 0 -50%;
}

.jl-lightbox-prev:hover,
.jl-lightbox-next:hover {
	transform: none;
}

/* Cursor-Hinweis auf lightbox-fähigen Bildern */
.wp-block-post-content a img {
	cursor: zoom-in;
}

@media (prefers-reduced-motion: reduce) {
	.jl-lightbox[open] .jl-lightbox-figure {
		animation: none;
	}
	.jl-lightbox button {
		transition: none;
	}
}
