/* ============================================================
   GALLERY / MOMENTS SECTION — gallery.css
   ============================================================ */

/* ── Section wrapper ── */
#moments {
	padding: 100px 0 80px;
	background: #ebe9e4;
	color: #001666;
	overflow: hidden;
}

.gallery-container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ── Section header ── */
.gallery-header {
	text-align: center;
	margin-bottom: 56px;
}

.gallery-title {
	font-family: "Big Shoulders Display", sans-serif;
	font-size: clamp(40px, 5vw, 62px);
	font-weight: 800;
	text-transform: none;
	letter-spacing: 0.01em;
	color: #001666;
	line-height: 1;
	margin-bottom: 12px;
}

.gallery-subtitle {
	font-family: "Inter", sans-serif;
	font-size: clamp(14px, 1.1vw, 16px);
	color: rgba(0, 22, 102, 0.72);
	max-width: 60ch;
	margin: 0 auto;
	line-height: 1.65;
}

/* ── Mosaic grid — matching reference image layout ── */
.gallery-mosaic {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	grid-template-rows: repeat(3, auto);
	gap: 10px;
}

.gallery-mosaic__item {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	background: #ebe9e4;
	border: 1px solid rgba(0, 22, 102, 0.12);
	box-shadow: 0 14px 28px -20px rgba(0, 22, 102, 0.28);
}

.gallery-mosaic__item::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		transparent 50%,
		rgba(0, 22, 102, 0.2) 100%
	);
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
	border-radius: 10px;
}

.gallery-mosaic__item:hover::after {
	opacity: 1;
}

.gallery-mosaic__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition:
		transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		filter 0.4s ease;
}

.gallery-mosaic__item:hover img {
	transform: scale(1.06);
	filter: brightness(1.02) saturate(0.98);
}

/* ── Grid placement — mosaic pattern ── */
/* Big hero image — center top, spans 2 cols × 2 rows */
.gallery-mosaic__item:nth-child(1) {
	grid-column: 2 / 4;
	grid-row: 1 / 3;
	min-height: 360px;
}

/* Top-left — smaller square */
.gallery-mosaic__item:nth-child(2) {
	grid-column: 1 / 2;
	grid-row: 1 / 2;
	min-height: 175px;
}

/* Top-right — smaller square */
.gallery-mosaic__item:nth-child(3) {
	grid-column: 4 / 5;
	grid-row: 1 / 2;
	min-height: 175px;
}

/* Bottom-left — tall */
.gallery-mosaic__item:nth-child(4) {
	grid-column: 1 / 2;
	grid-row: 2 / 4;
	min-height: 280px;
}

/* Bottom-center-left */
.gallery-mosaic__item:nth-child(5) {
	grid-column: 2 / 3;
	grid-row: 3 / 4;
	min-height: 175px;
}

/* Bottom-center-right */
.gallery-mosaic__item:nth-child(6) {
	grid-column: 3 / 4;
	grid-row: 3 / 4;
	min-height: 175px;
}

/* Bottom-right — stacked small (right col, rows 2 and 3) */
.gallery-mosaic__item:nth-child(7) {
	grid-column: 4 / 5;
	grid-row: 2 / 3;
	min-height: 140px;
}

.gallery-mosaic__item:nth-child(8) {
	grid-column: 4 / 5;
	grid-row: 3 / 4;
	min-height: 140px;
}

/* ── Expand icon overlay ── */
.gallery-mosaic__item .gallery-expand-icon {
	position: absolute;
	bottom: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(0, 22, 102, 0.75);
	backdrop-filter: blur(8px);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transform: translateY(6px);
	transition:
		opacity 0.35s ease,
		transform 0.35s ease;
	z-index: 2;
	pointer-events: none;
}

.gallery-mosaic__item .gallery-expand-icon svg {
	width: 16px;
	height: 16px;
	stroke: #ebe9e4;
	stroke-width: 2;
	fill: none;
}

.gallery-mosaic__item:hover .gallery-expand-icon {
	opacity: 1;
	transform: translateY(0);
}

/* ============================================================
   LIGHTBOX — fullscreen image viewer
   ============================================================ */
.gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(235, 233, 228, 0.96);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.4s ease,
		visibility 0.4s ease;
}

.gallery-lightbox.is-active {
	opacity: 1;
	visibility: visible;
}

/* ── Lightbox image ── */
.gallery-lightbox__img-wrap {
	position: relative;
	max-width: 85vw;
	max-height: 85vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

.gallery-lightbox__img {
	max-width: 85vw;
	max-height: 85vh;
	object-fit: contain;
	border-radius: 12px;
	box-shadow: 0 32px 80px rgba(0, 22, 102, 0.22);
	transform: scale(0.92);
	opacity: 0;
	transition:
		transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		opacity 0.4s ease;
}

.gallery-lightbox.is-active .gallery-lightbox__img {
	transform: scale(1);
	opacity: 1;
}

/* ── Close button ── */
.gallery-lightbox__close {
	position: absolute;
	top: 24px;
	right: 28px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1.5px solid rgba(0, 22, 102, 0.14);
	background: rgba(235, 233, 228, 0.68);
	backdrop-filter: blur(12px);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
	transition:
		background 0.25s ease,
		border-color 0.25s ease,
		transform 0.25s ease;
}

.gallery-lightbox__close:hover {
	background: rgba(139, 53, 53, 0.12);
	border-color: rgba(139, 53, 53, 0.35);
	transform: rotate(90deg);
}

.gallery-lightbox__close svg {
	width: 20px;
	height: 20px;
	stroke: #001666;
	stroke-width: 2;
	fill: none;
}

/* ── Navigation arrows ── */
.gallery-lightbox__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 1.5px solid rgba(0, 22, 102, 0.14);
	background: rgba(235, 233, 228, 0.68);
	backdrop-filter: blur(12px);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
	transition:
		background 0.25s ease,
		border-color 0.25s ease,
		transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-lightbox__nav svg {
	width: 20px;
	height: 20px;
	stroke: #001666;
	stroke-width: 2;
	fill: none;
}

.gallery-lightbox__nav--prev {
	left: 28px;
}

.gallery-lightbox__nav--next {
	right: 28px;
}

.gallery-lightbox__nav--prev:hover {
	background: rgba(139, 53, 53, 0.12);
	border-color: rgba(139, 53, 53, 0.35);
	transform: translateY(-50%) translateX(-3px);
}

.gallery-lightbox__nav--next:hover {
	background: rgba(139, 53, 53, 0.12);
	border-color: rgba(139, 53, 53, 0.35);
	transform: translateY(-50%) translateX(3px);
}

/* ── Counter ── */
.gallery-lightbox__counter {
	position: absolute;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	font-family: "Inter", sans-serif;
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.15em;
	color: rgba(0, 22, 102, 0.68);
	z-index: 10;
}

.gallery-lightbox__counter span {
	color: #001666;
	font-weight: 700;
}

/* ── Thumbnail strip ── */
.gallery-lightbox__thumbs {
	position: absolute;
	bottom: 58px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 8px;
	z-index: 10;
}

.gallery-lightbox__thumb {
	width: 52px;
	height: 38px;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	border: 2px solid transparent;
	opacity: 0.45;
	transition:
		opacity 0.3s ease,
		border-color 0.3s ease,
		transform 0.3s ease;
}

.gallery-lightbox__thumb:hover {
	opacity: 0.75;
	transform: translateY(-2px);
}

.gallery-lightbox__thumb.is-active {
	opacity: 1;
	border-color: #001666;
	transform: translateY(-2px);
}

.gallery-lightbox__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
	.gallery-mosaic {
		grid-template-columns: repeat(3, 1fr);
		grid-template-rows: auto;
		gap: 8px;
	}

	.gallery-mosaic__item:nth-child(1) {
		grid-column: 1 / 3;
		grid-row: 1 / 3;
		min-height: 280px;
	}

	.gallery-mosaic__item:nth-child(2) {
		grid-column: 3 / 4;
		grid-row: 1 / 2;
		min-height: 136px;
	}

	.gallery-mosaic__item:nth-child(3) {
		grid-column: 3 / 4;
		grid-row: 2 / 3;
		min-height: 136px;
	}

	.gallery-mosaic__item:nth-child(4) {
		grid-column: 1 / 2;
		grid-row: 3 / 4;
		min-height: 180px;
	}

	.gallery-mosaic__item:nth-child(5) {
		grid-column: 2 / 3;
		grid-row: 3 / 4;
		min-height: 180px;
	}

	.gallery-mosaic__item:nth-child(6) {
		grid-column: 3 / 4;
		grid-row: 3 / 4;
		min-height: 180px;
	}

	.gallery-mosaic__item:nth-child(7),
	.gallery-mosaic__item:nth-child(8) {
		grid-column: auto;
		grid-row: auto;
		min-height: 160px;
	}

	.gallery-lightbox__nav {
		width: 44px;
		height: 44px;
	}

	.gallery-lightbox__nav--prev {
		left: 14px;
	}

	.gallery-lightbox__nav--next {
		right: 14px;
	}
}

@media (max-width: 600px) {
	#moments {
		padding: 72px 0 56px;
	}

	.gallery-container {
		padding: 0 16px;
	}

	.gallery-mosaic {
		grid-template-columns: repeat(2, 1fr);
		gap: 6px;
	}

	.gallery-mosaic__item:nth-child(1) {
		grid-column: 1 / 3;
		grid-row: 1 / 2;
		min-height: 220px;
	}

	.gallery-mosaic__item:nth-child(n + 2) {
		grid-column: auto;
		grid-row: auto;
		min-height: 150px;
	}

	.gallery-lightbox__close {
		top: 16px;
		right: 16px;
		width: 40px;
		height: 40px;
	}

	.gallery-lightbox__nav {
		width: 40px;
		height: 40px;
	}

	.gallery-lightbox__nav--prev {
		left: 8px;
	}

	.gallery-lightbox__nav--next {
		right: 8px;
	}

	.gallery-lightbox__thumbs {
		bottom: 50px;
		gap: 5px;
	}

	.gallery-lightbox__thumb {
		width: 40px;
		height: 28px;
	}

	.gallery-lightbox__img {
		max-width: 94vw;
		max-height: 70vh;
	}
}

/* ── Entrance animations ── */
@keyframes galleryFadeUp {
	from {
		opacity: 0;
		transform: translateY(30px) scale(0.97);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.gallery-mosaic__item {
	opacity: 0;
	animation: galleryFadeUp 0.65s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.gallery-mosaic__item:nth-child(1) {
	animation-delay: 0.08s;
}
.gallery-mosaic__item:nth-child(2) {
	animation-delay: 0.16s;
}
.gallery-mosaic__item:nth-child(3) {
	animation-delay: 0.24s;
}
.gallery-mosaic__item:nth-child(4) {
	animation-delay: 0.32s;
}
.gallery-mosaic__item:nth-child(5) {
	animation-delay: 0.4s;
}
.gallery-mosaic__item:nth-child(6) {
	animation-delay: 0.48s;
}
.gallery-mosaic__item:nth-child(7) {
	animation-delay: 0.56s;
}
.gallery-mosaic__item:nth-child(8) {
	animation-delay: 0.64s;
}
