/* A quiet, image-led gallery that inherits the site's palette and serif type. */
.gallery-page header {
	position: relative;
	background: var(--cream);
	border-bottom: 1px solid var(--line);
}
.gallery-page a.brand { color: inherit; text-decoration: none; }

.gallery-intro {
	max-width: 920px;
	margin: 0 auto;
	padding: 74px 6% 58px;
	text-align: center;
}
.gallery-intro h1 {
	margin: 18px 0 16px;
	font-size: clamp(42px, 6vw, 70px);
	font-weight: 400;
	line-height: 1;
}
.gallery-intro > p:not(.eyebrow) {
	max-width: 570px;
	margin: 0 auto;
	font-size: 17px;
	line-height: 1.65;
}
.gallery-section { padding: 0 5% 84px; }
.gallery-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	max-width: 1480px;
	margin: 0 auto 20px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--line);
}
.gallery-help { margin: 0; font-size: 13px; color: #625e54; font-style: italic; }
.gallery-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: 105px;
	grid-auto-flow: dense;
	gap: 12px;
	max-width: 1480px;
	margin: 0 auto;
}
.gallery-item {
	position: relative;
	grid-column: span 1;
	grid-row: span 2;
	min-width: 0;
	padding: 0;
	overflow: hidden;
	border: 0;
	background: #ded9ce;
	color: #fff;
	cursor: zoom-in;
	text-align: left;
}
.gallery-item.gallery-wide { grid-column: span 2; grid-row: span 3; }
.gallery-item.gallery-tall { grid-row: span 3; }
.gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .55s ease;
}
.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.035); }
.gallery-item:focus-visible { outline: 3px solid #20231e; outline-offset: 2px; box-shadow: 0 0 0 6px var(--cream); z-index: 1; }
.gallery-caption {
	position: absolute;
	inset: auto 0 0;
	padding: 36px 18px 16px;
	background: linear-gradient(transparent, rgba(17, 20, 17, .7));
	font-size: 15px;
	letter-spacing: .4px;
	opacity: .92;
}
.gallery-book {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 52px 8%;
	background: var(--olive);
	color: white;
}
.gallery-book .eyebrow { color: #e2dfd4; }
.gallery-book h2 { margin: 12px 0 0; font-size: clamp(30px, 4vw, 46px); font-weight: 400; }
.gallery-book .cta { flex: 0 0 auto; border: 1px solid #dedbd2; background: transparent; color: white; }

.gallery-lightbox {
	position: fixed;
	inset: 0;
	width: min(96vw, 1400px);
	max-width: none;
	max-height: 94vh;
	margin: auto;
	padding: 52px 68px 28px;
	border: 1px solid rgba(255,255,255,.22);
	background: rgba(24, 27, 23, .97);
	color: #fff;
}
.gallery-lightbox::backdrop { background: rgba(15, 17, 15, .88); }
.gallery-lightbox figure { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; margin: 0; border: 0; }
.gallery-lightbox img { max-width: 100%; max-height: calc(94vh - 115px); width: auto; height: auto; object-fit: contain; }
.gallery-lightbox figcaption { padding: 16px 0 0; color: #f5f1e8; font-size: 16px; text-align: center; }
.gallery-lightbox button {
	position: absolute;
	z-index: 1;
	width: 48px;
	height: 48px;
	border: 1px solid rgba(255,255,255,.45);
	background: rgba(20,22,19,.45);
	color: #fff;
	font: 26px Georgia, serif;
	cursor: pointer;
}
.gallery-lightbox button:hover { background: var(--olive); }
.gallery-lightbox .lightbox-close { top: 12px; right: 12px; font-size: 32px; }
.gallery-lightbox .lightbox-prev { top: 50%; left: 12px; transform: translateY(-50%); }
.gallery-lightbox .lightbox-next { top: 50%; right: 12px; transform: translateY(-50%); }

@media (max-width: 900px) {
	.gallery-section { padding: 0 4% 58px; }
	.gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 95px; gap: 9px; }
	.gallery-item.gallery-wide { grid-column: span 2; }
}
@media (max-width: 600px) {
	.gallery-intro { padding: 50px 7% 42px; }
	.gallery-intro > p:not(.eyebrow) { font-size: 15px; }
	.gallery-toolbar { align-items: flex-start; flex-direction: column; gap: 6px; }
	.gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 100px; gap: 7px; }
	.gallery-item.gallery-wide { grid-column: span 2; grid-row: span 2; }
	.gallery-item.gallery-tall { grid-row: span 3; }
	.gallery-caption { padding: 30px 11px 11px; font-size: 13px; }
	.gallery-book { align-items: flex-start; flex-direction: column; padding: 38px 7%; }
	.gallery-lightbox { width: 100vw; max-height: 100dvh; padding: 58px 46px 20px; border: 0; }
	.gallery-lightbox img { max-height: calc(100dvh - 110px); }
	.gallery-lightbox .lightbox-prev { left: 5px; }
	.gallery-lightbox .lightbox-next { right: 5px; }
}
@media (prefers-reduced-motion: reduce) {
	.gallery-item img { transition: none; }
}
