/* ══ PROPERTY GALLERY: lightbox + mobile carousel ══
   Loaded after each property stylesheet so it can override their grid rules
   at mobile widths. Shared by Ext 39, Classic and Northam. */

/* ── Tiles are clickable ─────────────────────────────── */
.gallery-trigger { cursor: pointer; }
.gallery-trigger:focus-visible {
	outline: 2px solid var(--rose);
	outline-offset: 3px;
}

/* ── Lightbox ────────────────────────────────────────── */
.br-lightbox {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(12, 10, 9, 0.94);
	padding: 24px;
	opacity: 0;
	transition: opacity 0.25s ease;
}
.br-lightbox.is-open { display: flex; }
.br-lightbox.is-visible { opacity: 1; }

.br-lightbox__figure {
	margin: 0;
	max-width: min(1100px, 100%);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

.br-lightbox__img {
	max-width: 100%;
	max-height: calc(100vh - 150px);
	object-fit: contain;
	display: block;
	background: rgba(255, 255, 255, 0.04);
	transition: opacity 0.2s ease;
}
.br-lightbox.is-swapping .br-lightbox__img { opacity: 0.25; }

.br-lightbox__caption[hidden] { display: none; }
.br-lightbox__caption {
	font-family: 'Jost', sans-serif;
	font-size: 11px;
	font-weight: 300;
	letter-spacing: 2.5px;
	text-transform: uppercase;
	color: rgba(244, 239, 232, 0.75);
	text-align: center;
}
.br-lightbox__count {
	font-family: 'Cormorant Garamond', serif;
	font-size: 13px;
	letter-spacing: 2px;
	color: rgba(244, 239, 232, 0.5);
}

/* Controls */
.br-lightbox__btn {
	position: absolute;
	background: transparent;
	border: 1px solid rgba(244, 239, 232, 0.25);
	color: #F4EFE8;
	width: 46px;
	height: 46px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.br-lightbox__btn:hover { border-color: #8B1A2E; background: #8B1A2E; color: #fff; }
.br-lightbox__btn:focus-visible { outline: 2px solid #C9A84C; outline-offset: 2px; }
.br-lightbox__btn[hidden] { display: none; }

.br-lightbox__prev { left: 24px; top: 50%; transform: translateY(-50%); }
.br-lightbox__next { right: 24px; top: 50%; transform: translateY(-50%); }
.br-lightbox__close { top: 24px; right: 24px; }

/* ── Mobile: horizontal swipe carousel ───────────────── */
@media (max-width: 900px) {
	.gallery-grid[data-gallery],
	.gallery-mosaic[data-gallery] {
		display: flex;
		grid-template-columns: none;
		grid-template-rows: none;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		gap: 10px;
		padding-bottom: 12px;
		scrollbar-width: none;
	}
	.gallery-grid[data-gallery]::-webkit-scrollbar,
	.gallery-mosaic[data-gallery]::-webkit-scrollbar { display: none; }

	/* Neutralise each page's mosaic spans while scrolling horizontally. */
	.gallery-grid[data-gallery] > .g-item,
	.gallery-grid[data-gallery] > .gallery-item,
	.gallery-mosaic[data-gallery] > .g-item {
		flex: 0 0 82%;
		grid-column: auto;
		grid-row: auto;
		scroll-snap-align: center;
		aspect-ratio: 4 / 3;
		min-height: 0;
		position: relative;
	}
	.gallery-grid[data-gallery] > .g-item > .g-fill,
	.gallery-mosaic[data-gallery] > .g-item > .g-fill,
	.gallery-grid[data-gallery] > .gallery-item > .gallery-ph {
		height: 100%;
		min-height: 0;
	}

	/* Captions stay visible on touch, where there is no hover. */
	.gallery-grid[data-gallery] .g-label,
	.gallery-mosaic[data-gallery] .g-cap,
	.gallery-grid[data-gallery] .gallery-label { opacity: 1; }

	.br-lightbox { padding: 12px; }
	.br-lightbox__img { max-height: calc(100vh - 170px); }
	.br-lightbox__prev { left: 10px; }
	.br-lightbox__next { right: 10px; }
	.br-lightbox__close { top: 10px; right: 10px; }
	.br-lightbox__btn { width: 40px; height: 40px; }
}

/* Hint that the gallery scrolls, shown only on touch screens. */
.gallery-scroll-hint { display: none; }
@media (max-width: 900px) {
	.gallery-scroll-hint {
		display: block;
		margin-top: 10px;
		font-size: 9px;
		font-weight: 300;
		letter-spacing: 2.5px;
		text-transform: uppercase;
		color: var(--muted);
		text-align: center;
	}
}
