/* Photo lightbox — the overlay viewer from the Claude Design handoffs.
   Shared by every photo grid on the site (see assets/js/lightbox.js), so it lives
   in base/ rather than in one pattern's stylesheet. */

/* Tiles become interactive only once the script has wired them. */
.bsw-lightbox-trigger {
	cursor: pointer;
}

.bsw-lightbox-trigger:focus-visible {
	outline: 2px solid var(--wp--preset--color--blush, #d7a3ac);
	outline-offset: 3px;
}

body.bsw-lightbox-open {
	overflow: hidden;
}

/* ── Overlay ─────────────────────────────────────────────────────────── */

.bsw-lightbox {
	position: fixed;
	inset: 0;
	z-index: 200;
	background: rgba(35, 30, 30, 0.9);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.bsw-lightbox[hidden] {
	display: none;
}

.bsw-lightbox.is-open {
	opacity: 1;
}

/* ── Panel: photo + caption ──────────────────────────────────────────── */

.bsw-lightbox__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	transform: scale(0.94);
	transition: transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.bsw-lightbox.is-open .bsw-lightbox__panel {
	transform: scale(1);
}

/* The frame is what fades, so the credit crosses with its own photo rather than
   hanging over the next one. */
.bsw-lightbox__frame {
	position: relative;
	width: 1020px;
	height: 680px;
	max-width: calc(100vw - 260px);
	max-height: calc(100vh - 180px);
	opacity: 1;
	transition: opacity 0.24s ease;
}

.bsw-lightbox.is-fading .bsw-lightbox__frame {
	opacity: 0;
}

.bsw-lightbox__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Credit sits on the photo, caption under the panel */
p.bsw-lightbox__credit {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	padding: 8px 10px;
	text-align: center;
	font-family: var(--wp--preset--font-family--cardo, 'Cardo', serif);
	font-style: italic;
	font-size: 14px;
	line-height: 100%;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

p.bsw-lightbox__caption {
	margin: 0;
	font-family: var(--wp--preset--font-family--cardo, 'Cardo', serif);
	font-style: italic;
	font-size: 16px;
	line-height: 100%;
	color: rgba(255, 255, 255, 0.8);
}

/* ── Controls ────────────────────────────────────────────────────────── */

/* Desktop: the row dissolves so the arrows can pin to the screen edges. */
.bsw-lightbox__controls {
	display: contents;
}

.bsw-lightbox__nav {
	position: fixed;
	top: 50%;
	margin-top: -27px;
	width: 54px;
	height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.45);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.bsw-lightbox__nav--prev {
	left: 64px;
}

.bsw-lightbox__nav--next {
	right: 64px;
}

.bsw-lightbox__nav:hover,
.bsw-lightbox__nav:focus-visible {
	background: var(--wp--preset--color--blush, #d7a3ac);
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--blush, #d7a3ac);
}

.bsw-lightbox__counter {
	display: none;
}

.bsw-lightbox__close {
	position: fixed;
	right: 64px;
	top: 56px;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff;
	cursor: pointer;
	opacity: 0.75;
	transition: opacity 0.25s ease;
}

.bsw-lightbox__close:hover,
.bsw-lightbox__close:focus-visible {
	opacity: 1;
}

@media (max-width: 767px) {
	/* Mobile stacks photo → controls, with the arrows either side of a counter
	   instead of pinned to the edges. */
	.bsw-lightbox {
		flex-direction: column;
		gap: 18px;
		padding: 0 16px;
		background: rgba(35, 30, 30, 0.94);
	}

	.bsw-lightbox__frame {
		width: 100%;
		max-width: 400px;
		height: 62vh;
		max-height: none;
	}

	p.bsw-lightbox__credit {
		font-size: 12px;
	}

	p.bsw-lightbox__caption {
		display: none;
	}

	.bsw-lightbox__controls {
		display: flex;
		align-items: center;
		gap: 28px;
	}

	.bsw-lightbox__nav {
		position: static;
		margin-top: 0;
		width: 52px;
		height: 52px;
	}

	.bsw-lightbox__nav svg {
		width: 14px;
		height: 22px;
	}

	.bsw-lightbox__counter {
		display: block;
		font-family: var(--wp--preset--font-family--cardo, 'Cardo', serif);
		font-style: italic;
		font-size: 14px;
		line-height: 100%;
		color: rgba(255, 255, 255, 0.75);
	}

	.bsw-lightbox__close {
		right: 16px;
		top: 20px;
	}

	.bsw-lightbox__close svg {
		width: 18px;
		height: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bsw-lightbox,
	.bsw-lightbox__panel,
	.bsw-lightbox__frame {
		transition: none;
	}
}

/* Tile captions are the lightbox's credit source, not grid furniture. */
.bsw-lightbox-trigger figcaption,
.bsw-gallery-venues__tile figcaption,
.bsw-hotel-gallery__tile figcaption {
	display: none;
}
