/* ===========================================================
   CDN Fitness — Media Gallery page
   Plain CSS. Reuses the same brand tokens as the landing page.
   =========================================================== */

:root {
	--cream: #f7f3ea;
	--sand: #ece5d3;
	--charcoal: #1e2620;
	--charcoal-90: rgba(30, 38, 32, 0.95);
	--charcoal-40: rgba(30, 38, 32, 0.4);
	--brand-green: #7aff47;
	--brand-green-dark: #3fa72a;
	--brand-green-30: rgba(122, 255, 71, 0.3);
	--brand-green-10: rgba(122, 255, 71, 0.1);
	--text: #1e2620;
	--muted: #6b7266;
	--border: #d9d2bf;
	--display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
html {
	scroll-behavior: smooth;
}
body {
	font-family: var(--body);
	background: var(--cream);
	color: var(--text);
	-webkit-font-smoothing: antialiased;
	line-height: 1.5;
}
img {
	display: block;
	max-width: 100%;
	height: auto;
}
a {
	color: inherit;
	text-decoration: none;
}
h1,
h2,
h3 {
	font-family: var(--display);
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

/* ---------- Header ---------- */
.header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 50;
	padding: 20px 24px;
	display: flex;
	justify-content: center;
	align-items: center;
	background: transparent;
	transition:
		background 0.4s ease,
		padding 0.4s ease,
		box-shadow 0.4s ease;
}
.header.scrolled {
	background: var(--charcoal-90);
	backdrop-filter: blur(8px);
	padding: 12px 24px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}
.header img {
	height: 80px;
	width: auto;
	object-fit: contain;
}
@media (min-width: 768px) {
	.header img {
		height: 120px;
	}
}

/* ---------- Gallery hero ---------- */
.gallery-hero {
	background: var(--charcoal);
	color: var(--cream);
	padding: 140px 24px 80px;
	text-align: center;
}
@media (min-width: 768px) {
	.gallery-hero {
		padding: 180px 24px 112px;
	}
}

.gallery-hero__inner {
	max-width: 720px;
	margin: 0 auto;
}

.eyebrow {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.25em;
	color: var(--brand-green);
	margin-bottom: 16px;
}

.gallery-hero h1 {
	font-size: clamp(3rem, 8vw, 6rem);
	color: var(--cream);
}

.gallery-hero__lead {
	margin-top: 20px;
	font-size: 1.125rem;
	color: rgba(247, 243, 234, 0.75);
	max-width: 560px;
	margin-left: auto;
	margin-right: auto;
}
@media (min-width: 768px) {
	.gallery-hero__lead {
		font-size: 1.25rem;
	}
}

/* ---------- Gallery grid ---------- */
.gallery {
	padding: 64px 24px 96px;
	max-width: 1400px;
	margin: 0 auto;
}
@media (min-width: 768px) {
	.gallery {
		padding: 96px 24px 128px;
	}
}

.gallery__grid {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) {
	.gallery__grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 16px;
	}
}
@media (min-width: 1024px) {
	.gallery__grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 20px;
	}
}
@media (min-width: 1400px) {
	.gallery__grid {
		grid-template-columns: repeat(5, 1fr);
	}
}

.gallery__item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	background: var(--sand);
	aspect-ratio: 1 / 1;
	cursor: pointer;
	outline: none;
}

.gallery__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s ease;
}

.gallery__item:hover img,
.gallery__item:focus-visible img {
	transform: scale(1.08);
}

.gallery__item:focus-visible {
	box-shadow: 0 0 0 3px var(--brand-green);
}

.gallery__overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(30, 38, 32, 0.45);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.gallery__item:hover .gallery__overlay,
.gallery__item:focus-visible .gallery__overlay {
	opacity: 1;
}

.gallery__overlay span {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	color: var(--cream);
	padding: 10px 18px;
	border: 1px solid rgba(247, 243, 234, 0.6);
	border-radius: 9999px;
	backdrop-filter: blur(4px);
}

.gallery__loader {
	margin-top: 48px;
	text-align: center;
	font-size: 0.875rem;
	color: var(--muted);
	letter-spacing: 0.05em;
}

/* ---------- Lightbox ---------- */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 100;
	background: rgba(30, 38, 32, 0.96);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.lightbox[hidden] {
	display: none;
}

.lightbox__img {
	max-width: 90vw;
	max-height: 85vh;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.lightbox__close,
.lightbox__nav {
	position: absolute;
	background: transparent;
	border: none;
	color: var(--cream);
	cursor: pointer;
	transition:
		color 0.2s,
		transform 0.2s;
}

.lightbox__close {
	top: 16px;
	right: 24px;
	font-size: 2.5rem;
	line-height: 1;
}

.lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	font-size: 3rem;
	padding: 16px;
	opacity: 0.7;
}

.lightbox__nav:hover {
	opacity: 1;
	color: var(--brand-green);
}
.lightbox__close:hover {
	color: var(--brand-green);
}

.lightbox__nav--prev {
	left: 8px;
}
.lightbox__nav--next {
	right: 8px;
}

@media (min-width: 768px) {
	.lightbox__nav--prev {
		left: 24px;
	}
	.lightbox__nav--next {
		right: 24px;
	}
}

/* ---------- Footer ---------- */
.footer {
	background: var(--charcoal);
	color: var(--cream);
	padding: 64px 24px;
}
.footer__inner {
	max-width: 1200px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 40px;
	text-align: center;
}
@media (min-width: 768px) {
	.footer__inner {
		flex-direction: row;
		justify-content: space-between;
		text-align: left;
	}
}
.footer__logo {
	height: 48px;
	width: auto;
	object-fit: contain;
}
@media (min-width: 768px) {
	.footer__logo {
		height: 56px;
	}
}
.footer__brand p {
	margin-top: 16px;
	font-size: 0.875rem;
	color: rgba(247, 243, 234, 0.7);
	max-width: 20rem;
}
.footer nav ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	justify-content: center;
}
@media (min-width: 768px) {
	.footer nav ul {
		gap: 32px;
	}
}
.footer nav a {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	color: var(--cream);
	transition: color 0.2s;
}
.footer nav a:hover {
	color: var(--brand-green);
}
.footer__legal {
	margin-top: 40px;
	text-align: center;
	font-size: 0.75rem;
	color: rgba(247, 243, 234, 0.5);
}
