/* ============================================================
   Zap Galleries
   ============================================================ */
:root {
	--zap-brand: #002448;
	--zap-brand-hover: #003a6e;
	--zap-line: #e1e6ec;
	--zap-muted: #5b6b7a;
	--zap-text: #1f2933;
}

/* ----- Admin meta box ----- */
.zap-gallery-admin-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 10px 0 14px;
	padding: 0;
	list-style: none;
}
.zap-gallery-admin-list li {
	position: relative;
	width: 90px;
	height: 90px;
	margin: 0;
	border: 1px solid var(--zap-line);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	cursor: move;
}
.zap-gallery-admin-list li img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.zap-gallery-remove {
	position: absolute;
	top: 3px;
	right: 3px;
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .6);
	color: #fff;
	font-size: 15px;
	line-height: 22px;
	text-align: center;
	cursor: pointer;
}
.zap-gallery-remove:hover {
	background: rgba(0, 0, 0, .8);
}

/* ----- Listing slider ----- */
.zap-gallery-slider {
	position: relative;
	margin: 0 0 30px;
}
.zap-gallery-slider-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin: 14px 0 0;
}
.zap-gallery-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--zap-brand);
	color: #fff;
	cursor: pointer;
	transition: background .15s ease, opacity .15s ease;
}
.zap-gallery-arrow:hover {
	background: var(--zap-brand-hover);
}
.zap-gallery-arrow[disabled] {
	opacity: .35;
	cursor: default;
}
.zap-gallery-arrow svg {
	display: block;
	width: 30px;
	height: 30px;
}
.zap-gallery-viewport {
	overflow: hidden;
	padding: 24px 0 30px;
}
.zap-gallery-track {
	display: flex;
	gap: 24px;
	transition: transform .4s ease;
}
.zap-gallery-track .zap-gallery-card {
	flex: 0 0 calc((100% - (var(--zap-gallery-cols, 3) - 1) * 24px) / var(--zap-gallery-cols, 3));
}
@media (max-width: 992px) {
	.zap-gallery-slider {
		--zap-gallery-cols: 2 !important;
	}
}
@media (max-width: 600px) {
	.zap-gallery-slider {
		--zap-gallery-cols: 1 !important;
	}
}
.zap-gallery-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	padding: 0;
	border: 1px solid var(--zap-line);
	border-radius: 14px;
	overflow: visible;
	background: #fff;
	text-align: left;
	text-decoration: none;
	font: inherit;
	color: inherit;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: transform .15s ease, box-shadow .15s ease;
}
.zap-gallery-card:focus-visible {
	outline: 3px solid rgba(0, 36, 72, .35);
	outline-offset: 2px;
}
.zap-gallery-card:hover {
	z-index: 3;
	transform: translateY(-3px);
	box-shadow: 0 14px 30px rgba(0, 36, 72, .10);
}

/* Fanned backing photos, faint and blurred */
.zap-gallery-stack {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	aspect-ratio: 16 / 10;
	z-index: 0;
	pointer-events: none;
}
.zap-gallery-stack-item {
	position: absolute;
	inset: 0;
	border-radius: 12px;
	background-size: cover;
	background-position: center;
	box-shadow: 0 8px 18px rgba(0, 0, 0, .2);
	filter: blur(2px);
	opacity: 0;
	transform: rotate(0deg);
	transform-origin: 50% 88%;
	transition: transform .3s ease, opacity .3s ease;
}
.zap-gallery-card:hover .zap-gallery-stack-item {
	opacity: .5;
}
.zap-gallery-card:hover .zap-gallery-stack-item:nth-child(1) {
	transform: rotate(-9deg) translateY(-6px);
}
.zap-gallery-card:hover .zap-gallery-stack-item:nth-child(2) {
	transform: rotate(9deg) translateY(-6px);
}
.zap-gallery-card:hover .zap-gallery-stack-item:nth-child(3) {
	transform: rotate(-4deg) translateY(-11px);
}
.zap-gallery-card:hover .zap-gallery-stack-item:nth-child(4) {
	transform: rotate(4deg) translateY(-11px);
}
.zap-gallery-card-media {
	position: relative;
	z-index: 1;
	display: block;
	line-height: 0;
	overflow: hidden;
	border-radius: 14px;
}
.zap-gallery-card-media img,
.zap-gallery-card-noimg {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}
.zap-gallery-card-noimg {
	background: linear-gradient(135deg, var(--zap-brand), var(--zap-brand-hover));
}
.zap-gallery-card-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 2px;
	padding: 18px;
	border-radius: 14px;
	background: linear-gradient(to top, rgba(0, 36, 72, .88) 0%, rgba(0, 36, 72, .25) 45%, rgba(0, 36, 72, 0) 78%);
	opacity: 0;
	transition: opacity .25s ease;
}
.zap-gallery-card:hover .zap-gallery-card-overlay {
	opacity: 1;
}
.zap-gallery-card-title {
	display: block;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
}
.zap-gallery-card-count {
	display: block;
	margin-top: 2px;
	font-size: 13px;
	color: rgba(255, 255, 255, .82);
}

@media (max-width: 992px) {
	.zap-gallery-index {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 600px) {
	.zap-gallery-index {
		grid-template-columns: 1fr;
	}
}

/* ----- Single gallery banner (featured image + title) ----- */
/* White background and full-width content on gallery pages */
body.single-zap_gallery,
body.single-zap_gallery #inner-wrap,
body.single-zap_gallery .content-container.site-container,
body.single-zap_gallery #main,
body.single-zap_gallery .entry-content-wrap {
	background-color: #ffffff !important;
}
body.single-zap_gallery .entry-content-wrap {
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
}
body.single-zap_gallery .content-bg,
body.single-zap_gallery article.entry,
body.single-zap_gallery .single-entry {
	border: 0 !important;
	box-shadow: none !important;
	background: transparent !important;
}
body.single-zap_gallery .content-area {
	margin-top: 2rem !important;
}
.zap-gallery-banner {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 545px;
	margin: 0 0 28px;
	border-radius: 64px;
	overflow: hidden;
	background-color: var(--zap-brand);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}
.zap-gallery-sep {
	width: 150px;
	max-width: 60%;
	height: 15px;
	margin: 65px auto;
	background: var(--zap-brand);
	border-radius: 4px;
}
.zap-gallery-banner.has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, .6) 0%, rgba(0, 0, 0, .15) 42%, rgba(0, 0, 0, 0) 70%);
}
.zap-gallery-banner__inner {
	position: relative;
	z-index: 1;
	padding: 70px 70px;
}
.zap-gallery-banner__title {
	margin: 0;
	color: #fff;
	font-size: 64px;
	font-weight: 800;
	line-height: 1.1;
	letter-spacing: .01em;
	text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}
/* Title now lives on the banner, so hide the theme's heading */
.single-zap_gallery .entry-title {
	display: none;
}
@media (max-width: 600px) {
	.zap-gallery-banner {
		min-height: 200px;
		justify-content: center;
	}
	.zap-gallery-banner__inner {
		padding: 22px 24px;
		text-align: center;
	}
	.zap-gallery-banner__title {
		font-size: 28px;
	}
}

/* ----- Single gallery grid (masonry) ----- */
.zap-gallery-grid {
	column-count: 3;
	column-gap: 14px;
	margin: 24px 0;
}
.zap-gallery-item {
	display: block;
	width: 100%;
	margin: 0 0 14px;
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	border-radius: 10px;
	overflow: hidden;
	line-height: 0;
	cursor: zoom-in;
}
.zap-gallery-item img {
	width: 100%;
	height: auto;
	display: block;
	transition: transform .25s ease;
}
.zap-gallery-item:hover img {
	transform: scale(1.05);
}
/* Entrance animation */
.zap-gallery-grid.zap-anim-ready .zap-gallery-item {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .5s ease, transform .5s ease;
	will-change: opacity, transform;
}
.zap-gallery-grid.zap-anim-ready .zap-gallery-item.is-revealed {
	opacity: 1;
	transform: none;
}
.zap-gallery-banner {
	animation: zapBannerIn .6s ease both;
}
@keyframes zapBannerIn {
	from {
		opacity: 0;
		transform: scale(1.02);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}
@media (prefers-reduced-motion: reduce) {
	.zap-gallery-banner {
		animation: none;
	}
}

/* ----- Back to Galleries ----- */
.zap-gallery-foot {
	display: flex;
	justify-content: flex-end;
	margin: 36px 0 10px;
	padding-top: 26px;
	border-top: 1px solid var(--zap-line);
}
.zap-gallery-back {
	display: inline-flex;
	align-items: center;
	gap: 0;
	padding: 11px 20px;
	background: var(--zap-brand);
	color: #fff;
	font-weight: 800;
	font-size: 14px;
	border-radius: 999px;
	text-decoration: none;
	transition: background .15s ease;
}
.zap-gallery-back:hover,
.zap-gallery-back:focus {
	background: var(--zap-brand-hover);
	color: #fff;
}
.zap-gallery-back svg {
	width: 30px;
	height: 30px;
}
@media (max-width: 900px) {
	.zap-gallery-grid {
		column-count: 2;
	}
}
@media (max-width: 560px) {
	.zap-gallery-grid {
		column-count: 1;
	}
}

/* ----- Lightbox ----- */
body.zap-lightbox-lock {
	overflow: hidden;
}
.zap-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 30px;
	background: rgba(8, 16, 28, .92);
}
.zap-lightbox.is-open {
	display: flex;
}
.zap-lightbox-figure {
	margin: 0;
	max-width: 90vw;
	max-height: 86vh;
}
.zap-lightbox-figure img {
	max-width: 90vw;
	max-height: 86vh;
	object-fit: contain;
	border-radius: 8px;
	display: block;
}
.zap-lightbox-close,
.zap-lightbox-prev,
.zap-lightbox-next {
	position: absolute;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease;
}
.zap-lightbox-close:hover,
.zap-lightbox-prev:hover,
.zap-lightbox-next:hover {
	background: rgba(255, 255, 255, .25);
}
.zap-lightbox-close {
	top: 20px;
	right: 24px;
}
.zap-lightbox-prev {
	left: 24px;
	top: 50%;
	transform: translateY(-50%);
}
.zap-lightbox-next {
	right: 24px;
	top: 50%;
	transform: translateY(-50%);
}
.zap-lightbox-counter {
	position: absolute;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, .85);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .03em;
}
@media (max-width: 600px) {
	.zap-lightbox-prev {
		left: 10px;
	}
	.zap-lightbox-next {
		right: 10px;
	}
	.zap-lightbox-close,
	.zap-lightbox-prev,
	.zap-lightbox-next {
		width: 40px;
		height: 40px;
		font-size: 22px;
	}
}
