/* KBH album lightbox — branded full-screen photo viewer (assets/js/lightbox.js).
   Scoped to album galleries; core WordPress lightbox is left off for albums so
   this one owns the interaction. On-brand koningsblauw controls, white glyphs. */

:root {
	--kbh-lb-blue: var(--wp--preset--color--koningsblauw, #23388e);
	--kbh-lb-red: var(--wp--preset--color--venetiaans-rood, #a42a04);
}

/* Album photos advertise that they enlarge. */
.kbh-album-single .wp-block-gallery img.kbh-lb-trigger {
	cursor: zoom-in;
}
.kbh-album-single .wp-block-gallery img.kbh-lb-trigger:focus-visible {
	outline: 3px solid var(--kbh-lb-blue);
	outline-offset: 2px;
}

/* Lock the page behind the open viewer. */
.kbh-lb-open {
	overflow: hidden;
}

/* ---- Overlay -------------------------------------------------------- */
.kbh-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(1rem, 4vw, 3rem);
	background: rgba(9, 12, 30, 0.93);
	animation: kbh-lb-fade 0.18s ease;
}
.kbh-lightbox[hidden] {
	display: none;
}

@keyframes kbh-lb-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* ---- Image stage ---------------------------------------------------- */
.kbh-lb-stage {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	max-width: 100%;
	max-height: 100%;
}
/* Shrinks to the image so the absolutely-positioned prev/next buttons are
   centred on the photo and aligned with each other (caption sits below it). */
.kbh-lb-frame {
	position: relative;
	display: flex;
	max-width: 100%;
	min-height: 0;
}
.kbh-lb-img {
	max-width: 100%;
	max-height: 82vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 4px;
	background: #111;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.55);
}
.kbh-lb-caption {
	margin: 0;
	max-width: 60ch;
	color: #fff;
	opacity: 0.85;
	font-size: 0.9rem;
	text-align: center;
}
.kbh-lb-caption[hidden] {
	display: none;
}

/* ---- Controls ------------------------------------------------------- */
.kbh-lb-btn {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	color: #fff;
	background: var(--kbh-lb-blue);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	opacity: 0.9;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}
.kbh-lb-icon {
	display: block;
	width: 1.5rem;
	height: 1.5rem;
}
.kbh-lb-btn:hover,
.kbh-lb-btn:focus-visible {
	background: var(--kbh-lb-red);
	opacity: 1;
	outline: 2px solid #fff;
	outline-offset: 2px;
}
.kbh-lb-btn[hidden] {
	display: none;
}
.kbh-lb-close {
	top: clamp(0.75rem, 3vw, 1.5rem);
	right: clamp(0.75rem, 3vw, 1.5rem);
}
.kbh-lb-prev {
	left: clamp(0.5rem, 3vw, 1.5rem);
	top: 50%;
	transform: translateY(-50%);
}
.kbh-lb-next {
	right: clamp(0.5rem, 3vw, 1.5rem);
	top: 50%;
	transform: translateY(-50%);
}
.kbh-lb-counter {
	position: absolute;
	bottom: clamp(0.75rem, 3vw, 1.5rem);
	left: 0;
	right: 0;
	margin: 0;
	text-align: center;
	color: #fff;
	opacity: 0.8;
	font-size: 0.875rem;
	letter-spacing: 0.03em;
}

@media (prefers-reduced-motion: reduce) {
	.kbh-lightbox { animation: none; }
	.kbh-lb-btn { transition: none; }
}
