/**
 * `.wh-lightbox` — Wandhaus image lightbox.
 *
 * Built for the order-view "Jouw foto's" gallery (`.wccb-photo-card`),
 * but generic: any anchor carrying `data-wh-lightbox` is auto-bound by
 * `js/wandhaus-lightbox.js`. Fixed-position overlay, focus-trapped,
 * ESC + click-backdrop + close-button to dismiss; arrow keys to walk
 * through the group when grouped via `data-wh-lightbox-group`.
 *
 * Tokens-only — every value reads from `tokens.css`.
 */

/* ---------- Overlay ---------- */
.wh-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	place-items: center;
	background: color-mix(in srgb, var(--ink) 88%, transparent);
	padding: var(--s-5, var(--s-5));
	opacity: 0;
	pointer-events: none;
	transition: opacity .18s var(--ease, ease-out);
}
.wh-lightbox.is-open {
	opacity: 1;
	pointer-events: auto;
}
.wh-lightbox[hidden] {
	display: none !important;
}

/* ---------- Stage ---------- */
.wh-lightbox__stage {
	position: relative;
	max-width: min(100%, 1280px);
	max-height: 100%;
	display: grid;
	grid-template-rows: 1fr auto;
	gap: var(--s-3, var(--s-3));
	min-width: 0;
}
.wh-lightbox__media {
	display: grid;
	place-items: center;
	min-height: 0;
}
.wh-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 160px);
	object-fit: contain;
	background: var(--surface);
}

/* ---------- Caption ---------- */
.wh-lightbox__caption {
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--on-ink-muted, #C8C8C5);
	text-align: center;
	margin: 0;
	min-height: 1.4em;
}

/* ---------- Close ---------- */
.wh-lightbox__close {
	position: absolute;
	top: calc(-1 * var(--s-5, 24px));
	right: 0;
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	background: transparent;
	color: var(--on-ink, #FFFFFF);
	border: 0;
	cursor: pointer;
	transition: opacity .15s var(--ease, ease-out);
}
.wh-lightbox__close:hover { opacity: .75; }
.wh-lightbox__close:focus-visible {
	outline: 2px solid var(--on-ink, #FFFFFF);
	outline-offset: 2px;
}

/* ---------- Prev / Next ---------- */
.wh-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	background: transparent;
	color: var(--on-ink, #FFFFFF);
	border: 0;
	cursor: pointer;
	transition: opacity .15s var(--ease, ease-out);
}
.wh-lightbox__nav:hover { opacity: .75; }
.wh-lightbox__nav:focus-visible {
	outline: 2px solid var(--on-ink, #FFFFFF);
	outline-offset: 2px;
}
.wh-lightbox__nav[disabled] {
	opacity: .25;
	cursor: not-allowed;
}
.wh-lightbox__nav--prev { left: calc(-1 * var(--s-7, 48px)); }
.wh-lightbox__nav--next { right: calc(-1 * var(--s-7, 48px)); }

/* Mobile: collapse the side nav into the bottom of the stage. */
@media (max-width: 639px) {
	.wh-lightbox__nav--prev { left: var(--s-3, 12px); }
	.wh-lightbox__nav--next { right: var(--s-3, 12px); }
	.wh-lightbox__close     { top: var(--s-3, 12px); right: var(--s-3, 12px); }
}

/* Lock body scroll while a lightbox is open. */
body.wh-lightbox-locked { overflow: hidden; }
