/**
 * Gallery page — hero + intro are real blocks; the photo grid itself
 * is the dynamic nashon/gallery-list pattern (patterns/gallery-list.php),
 * a paginated "gallery_photo" CPT query (16/page) rather than one
 * unbounded fetch. An admin adds/removes/reorders photos entirely from
 * wp-admin → Gallery, no code or page edit required.
 * .section-eyebrow, .page-hero-cover, and .nashon-pager are shared
 * sitewide (style.css).
 */
.gallery-intro-section {
	padding: clamp(40px, 5vw, 64px) 8.75vw clamp(16px, 2vw, 24px);
	background: var(--wp--preset--color--base);
	text-align: center;
}
.gallery-intro-section .section-eyebrow {
	margin-left: auto;
	margin-right: auto;
}
.gallery-intro-section h2 {
	margin: 0 0 16px;
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2rem, 3.6vw, 2.9rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1.1;
	text-transform: uppercase;
	text-wrap: balance;
}
.gallery-intro-section h2 span {
	color: transparent;
	-webkit-text-stroke: 1.5px #000;
}
.gallery-intro-text {
	max-width: 40rem;
	margin: 0 auto;
	color: var(--wp--preset--color--muted);
	font-size: 1.05rem;
	line-height: 1.7;
}

/* The photo grid — plain <button> tiles (not <a>, since clicking opens
   the lightbox rather than navigating) in a CSS grid. Extra bottom
   clearance since this is the last section before the footer's
   torn-paper divider. */
.gallery-photo-section {
	padding: clamp(16px, 2vw, 24px) 8.75vw clamp(88px, 10vw, 150px);
	background: var(--wp--preset--color--base);
}
.gallery-photo-section__empty {
	color: var(--wp--preset--color--muted);
	text-align: center;
}
.gallery-photo-grid {
	max-width: 1320px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}
.gallery-photo-card {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	padding: 0;
	border: 0;
	border-radius: 14px;
	overflow: hidden;
	background: var(--wp--preset--color--border);
	cursor: zoom-in;
	box-shadow: 0 10px 24px rgba(40, 40, 40, 0.1);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gallery-photo-card:hover,
.gallery-photo-card:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 16px 32px rgba(40, 40, 40, 0.2);
}
.gallery-photo-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}
.gallery-photo-card:hover .gallery-photo-card__img {
	transform: scale(1.06);
}
/* Caption overlay — hidden until hover/focus, same dark-gradient +
   slide-up convention as .team-card__overlay. */
.gallery-photo-card__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 14px 12px;
	background: linear-gradient(to top, rgba(20, 20, 20, 0.85), transparent);
	color: var(--wp--preset--color--base);
	font-size: 0.82rem;
	font-weight: 700;
	text-align: left;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.gallery-photo-card:hover .gallery-photo-card__caption,
.gallery-photo-card:focus-visible .gallery-photo-card__caption {
	opacity: 1;
	transform: translateY(0);
}

@media (max-width: 1100px) {
	.gallery-photo-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
@media (max-width: 780px) {
	.gallery-photo-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 420px) {
	.gallery-photo-grid {
		grid-template-columns: 1fr;
	}
}

/* ===== Lightbox (assets/js/gallery-lightbox.js) ===== */
body.gallery-lightbox-open {
	overflow: hidden;
}
.gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
	align-items: center;
	justify-content: center;
	gap: 16px;
	padding: clamp(16px, 4vw, 48px);
	background: rgba(15, 15, 18, 0.92);
}
.gallery-lightbox.is-open {
	display: flex;
}
.gallery-lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	max-width: min(90vw, 1200px);
	max-height: 90vh;
	margin: 0;
}
.gallery-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: 78vh;
	border-radius: 10px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
	object-fit: contain;
}
.gallery-lightbox__caption {
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.95rem;
	font-weight: 700;
	text-align: center;
}
.gallery-lightbox__close {
	position: absolute;
	top: clamp(12px, 3vw, 28px);
	right: clamp(12px, 3vw, 28px);
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: var(--wp--preset--color--base);
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}
.gallery-lightbox__close:hover {
	background: rgba(255, 255, 255, 0.24);
}
.gallery-lightbox__nav {
	flex: none;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: var(--wp--preset--color--base);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}
.gallery-lightbox__nav:hover {
	background: var(--wp--preset--color--primary);
	transform: scale(1.06);
}
@media (max-width: 700px) {
	.gallery-lightbox {
		gap: 8px;
	}
	.gallery-lightbox__nav {
		width: 40px;
		height: 40px;
		font-size: 1.1rem;
	}
}
