.photo-gallery {
	padding: 24px 0 88px;
    background:#fbf8f2;
}
.photo-gallery > .wrap > h2 {
	font-size: 30px;
	margin-bottom: 36px;
}

/* This flex-wrap arrangement is only the pre-JS fallback state — the
   real row-justified sizing (exact px width/height per tile so each
   row fills the container edge-to-edge) is calculated in JS, since
   that math depends on which images end up grouped in the same row,
   which can't be known in advance from CSS alone. */
.gallery-flow {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}
.gallery-tile {
	position: relative;
	display: block;
	height: 260px;
	flex: 0 1 auto;
	overflow: hidden;
	background: var(--paper);
	cursor: zoom-in;
}
.gallery-tile img {
	height: 100%;
	width: 100%;
	object-fit: cover; /* box itself already matches the image's ratio via
	                       inline aspect-ratio, so this never crops —
	                       it's just a safety net against rounding */
	display: block;
	transition: transform 0.3s ease;
}
.gallery-tile:hover img {
	transform: scale(1.03);
}
.gallery-cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 8px 10px;
	background: linear-gradient(180deg, transparent, rgba(27,42,74,0.85));
	color: var(--cream);
	font-family: 'IBM Plex Mono', monospace;
	font-size: 11px;
	opacity: 0;
	transition: opacity 0.2s ease;
}
.gallery-tile:hover .gallery-cap {
	opacity: 1;
}

@media (max-width: 640px) {
	.gallery-tile {
		height: 140px;
	}
}

/* Lightbox */
.gallery-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(27, 42, 74, 0.95);
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	z-index: 9999;
	padding: 40px;
}
.gallery-lightbox.is-open {
	display: flex;
}
.gallery-lightbox-img {
	max-width: 90vw;
	max-height: 82vh;
	object-fit: contain;
	border: 1px solid rgba(247,243,234,0.2);
}
.gallery-lightbox-caption {
	color: var(--cream);
	font-family: 'IBM Plex Mono', monospace;
	font-size: 13px;
	margin-top: 16px;
	text-align: center;
	max-width: 600px;
}
.gallery-lightbox-close {
	position: absolute;
	top: 24px;
	right: 32px;
	background: transparent;
	border: none;
	color: var(--cream);
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
	padding: 8px;
}
.gallery-lightbox-close:hover {
	color: var(--gold);
}