/*
 * gallery-page.css — the dedicated Gallery page: the photo grid, its
 * lightbox, and the video playlist below it.
 *
 * No Figma frame exists for this page. The tokens, radii and eyebrow/heading
 * treatment are the theme's own — the same "eyebrow, heading, then content"
 * rhythm every other section here uses — rather than inventing a new one.
 */

/* ------------------------------------------------------------ The grid */

.galleryGrid {
	background: var(--bg);
	color: var(--ink);
}

.galleryGridInner {
	width: min(100% - (var(--gutter) * 2), var(--container));
	margin-inline: auto;
	padding-block: clamp(56px, 6.2vw, 110px);
}

.galleryGridEyebrow {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 12px;
	line-height: 28px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--ink);
}

.galleryGridEyebrow .eyebrowRule {
	color: var(--accent);
}

.galleryGridTitle {
	margin-top: 26px;
	max-width: 20em;
	font-size: 44px;
	line-height: 1.364;
	font-weight: 400;
	text-transform: capitalize;
	text-wrap: balance;
	color: var(--ink);
}

.galleryGridTitle span {
	color: inherit;
}

.galleryGridList {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
	margin: clamp(40px, 4.4vw, 64px) 0 0;
	padding: 0;
	list-style: none;
}

.galleryGridItem {
	aspect-ratio: 3 / 2;
}

.galleryGridLink {
	position: relative;
	display: block;
	overflow: hidden;
	width: 100%;
	height: 100%;
	border-radius: 20px;
}

.galleryGridImg {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s var(--ease);
}

.galleryGridLink:hover .galleryGridImg,
.galleryGridLink:focus-visible .galleryGridImg {
	transform: scale(1.05);
}

/* The zoom glyph sits centred over a darkening scrim — the same "reveal on
   hover, always present for touch and keyboard" affordance as .blogCard,
   just spelled with an icon instead of an underline since there is no label
   here to carry it. */
.galleryGridZoom {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(18, 49, 44, 0);
	color: #fff;
	opacity: 0;
	transition: background-color 0.25s var(--ease), opacity 0.25s var(--ease);
}

.galleryGridLink:hover .galleryGridZoom,
.galleryGridLink:focus-visible .galleryGridZoom {
	background: rgba(18, 49, 44, 0.45);
	opacity: 1;
}

.galleryGridLink:focus-visible {
	outline: 2px solid var(--accent-on-dark);
	outline-offset: 2px;
}

/* ------------------------------------------------------------ Lightbox */

.galleryLightbox {
	width: min(100% - 32px, 1400px);
	max-height: min(100% - 32px, 90vh);
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: 16px;
	background: transparent;
}

.galleryLightbox::backdrop {
	background: rgba(6, 26, 22, 0.85);
}

.galleryLightboxClose {
	position: absolute;
	top: -48px;
	right: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--warm-sand);
	color: var(--forest-ink);
	transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}

.galleryLightboxClose:hover,
.galleryLightboxClose:focus-visible {
	background: var(--accent-deep);
	color: #fff;
}

/*
 * max-height leaves firm room below the image for the Prev/Next row and the
 * counter — sized against the dialog's own 90vh cap, not the viewport, so the
 * two numbers can never overflow each other and force the dialog to scroll.
 */
.galleryLightboxImg {
	display: block;
	width: 100%;
	max-height: min(78vh, 820px);
	object-fit: contain;
	border-radius: 16px;
}

/*
 * Prev/Next sit over the image's own left and right edges rather than
 * outside the dialog like the close button — pushing them fully outside
 * would need more horizontal room than a narrow viewport has, and this is
 * the same on-image placement the homepage carousel's own controls avoid
 * only because that carousel has three visible slides to place them between.
 */
.galleryLightboxNav {
	position: absolute;
	top: 50%;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	transform: translateY(-50%);
	border-radius: 50%;
	background: rgba(18, 49, 44, 0.55);
	transition: background-color 0.2s var(--ease);
}

.galleryLightboxNav:hover,
.galleryLightboxNav:focus-visible {
	background: var(--accent-deep);
}

.galleryLightboxPrev {
	left: 12px;
}

.galleryLightboxNext {
	right: 12px;
}

.galleryLightboxCounter {
	margin-top: 12px;
	text-align: center;
	font-family: var(--font-body);
	font-size: 13px;
	letter-spacing: 0.08em;
	color: var(--warm-sand);
}

/* ------------------------------------------------------------- Videos */

.galleryVideos {
	background: var(--surface-light);
	color: var(--ink);
}

.galleryVideosInner {
	width: min(100% - (var(--gutter) * 2), var(--container));
	margin-inline: auto;
	padding-block: clamp(56px, 6.2vw, 110px);
}

.galleryVideosTitle {
	max-width: 20em;
	font-size: 36px;
	line-height: 1.3;
	font-weight: 400;
	text-transform: capitalize;
	color: var(--ink);
}

.galleryVideosList {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
	margin: clamp(32px, 3.6vw, 48px) 0 0;
	padding: 0;
	list-style: none;
}

.galleryVideoLink {
	display: block;
	color: inherit;
}

.galleryVideoThumb {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 16px;
	background: var(--surface-deep);
}

.galleryVideoImg {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s var(--ease);
}

.galleryVideoLink:hover .galleryVideoImg,
.galleryVideoLink:focus-visible .galleryVideoImg {
	transform: scale(1.05);
}

.galleryVideoPlay {
	position: absolute;
	top: 50%;
	left: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	background: rgba(246, 242, 234, 0.92);
	color: var(--forest-ink);
	/* Nudged one pixel right of dead centre — a triangle's own visual weight
	   sits left of its bounding box, so true centring reads as off-centre. */
	padding-left: 3px;
	transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.galleryVideoLink:hover .galleryVideoPlay,
.galleryVideoLink:focus-visible .galleryVideoPlay {
	background: var(--accent-deep);
	color: #fff;
	transform: translate(-50%, -50%) scale(1.08);
}

.galleryVideoDuration {
	position: absolute;
	right: 10px;
	bottom: 10px;
	padding: 3px 9px;
	border-radius: 6px;
	background: rgba(18, 49, 44, 0.85);
	font-family: var(--font-body);
	font-size: 13px;
	color: #fff;
}

.galleryVideoTitle {
	display: block;
	margin-top: 14px;
	font-size: 17px;
	line-height: 1.4;
	color: var(--ink);
}

.galleryVideoLink:hover .galleryVideoTitle,
.galleryVideoLink:focus-visible .galleryVideoTitle {
	color: var(--accent-deep);
}

/* --------------------------------------------------------------- Small */

@media (max-width: 900px) {
	.galleryGridList,
	.galleryVideosList {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.galleryGridTitle {
		font-size: 34px;
	}
}

@media (max-width: 560px) {
	.galleryGridList,
	.galleryVideosList {
		grid-template-columns: minmax(0, 1fr);
	}

	.galleryGridTitle {
		font-size: 28px;
	}

	.galleryVideosTitle {
		font-size: 28px;
	}

	.galleryLightboxClose {
		top: 8px;
		right: 8px;
	}

	.galleryLightboxNav {
		width: 40px;
		height: 40px;
	}
}
