/* ------------------------------------------------------------------
   Lightbox (replaces Highslide)
   Same visual design as the old Highslide viewer: 75% black dimmer,
   white card with a soft shadow, grey prev / next / close toolbar.
   ------------------------------------------------------------------ */

.lb-backdrop {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1000;
	background: #fdf6e3;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.lb-backdrop.is-open {
	opacity: 0.75;
}

.lb-root {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.lb-root[hidden] {
	display: none;
}

.lb-root.is-open {
	opacity: 1;
}

.lb-card {
	position: relative;
	box-sizing: border-box;
	max-width: calc(100vw - 40px);
	max-height: calc(100vh - 40px);
	padding: 29px 5px 5px;
	background: #fdf6e3;
	border-radius: 12px;
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.45), 0 3px 10px rgba(0, 0, 0, 0.22);
	transform: scale(0.96);
	transition: transform 0.25s ease;
}

.lb-root.is-open .lb-card {
	transform: scale(1);
}

.lb-toolbar {
	position: absolute;
	top: 8px;
	right: 10px;
	display: flex;
	gap: 8px;
	line-height: 1;
}

.lb-toolbar button {
	display: block;
	width: 16px;
	height: 16px;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	color: #999;
	cursor: pointer;
	transition: color 0.15s ease;
}

.lb-toolbar button:hover,
.lb-toolbar button:focus {
	color: #333;
}

.lb-toolbar button:focus-visible {
	outline: 2px solid #900;
	outline-offset: 2px;
}

.lb-toolbar button:disabled {
	opacity: 0.25;
	cursor: default;
}

.lb-toolbar svg {
	display: block;
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.lb-img {
	display: block;
	width: auto;
	height: auto;
	max-width: calc(100vw - 60px);
	max-height: calc(100vh - 80px);
	border: 0;
	background: transparent;
}

/* Thumbnails keep the pointer affordance of the old gallery links */
a.lightbox {
	cursor: zoom-in;
	outline: none;
}

a.lightbox img {
	-webkit-transition: opacity 0.2s ease;
	transition: opacity 0.2s ease;
}

a.lightbox:hover img,
a.lightbox:focus img {
	opacity: 0.85;
}

body.lb-locked {
	overflow: hidden;
	padding-right: var(--lb-scrollbar, 0px);
}

html.lb-locked {
	overflow: hidden;
}

@media (max-width: 600px) {
	.lb-root {
		padding: 10px;
	}

	.lb-card {
		max-width: calc(100vw - 20px);
		max-height: calc(100vh - 20px);
		padding: 26px 4px 4px;
		border-radius: 8px;
	}

	.lb-toolbar {
		top: 4px;
		right: 4px;
		gap: 4px;
	}

	.lb-toolbar button {
		width: 24px;
		height: 24px;
	}

	.lb-img {
		max-width: calc(100vw - 36px);
		max-height: calc(100vh - 54px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.lb-backdrop,
	.lb-root,
	.lb-card {
		transition: none;
	}
}
