/* =========================================================================
 * Module: Album Section (single album gallery + lightbox)
 * Auto-loaded on single album posts by the flexible-content module scanner.
 * ====================================================================== */

/* ----- Thumbnail grid ----- */
.album-gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.album-gallery-item {
	position: relative;
	display: block;
	padding: 0;
	border: 0;
	margin: 0;
	background: var(--fuchs-primary-100, #d0dfee);
	border-radius: 12px;
	overflow: hidden;
	cursor: pointer;
	aspect-ratio: 4 / 3;
	width: 100%;
}
.album-gallery-item img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}
.album-gallery-item::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(15, 31, 65, 0);
	transition: background 0.25s ease;
}
.album-gallery-item:hover img,
.album-gallery-item:focus-visible img {
	transform: scale(1.06);
}
.album-gallery-item:hover::after,
.album-gallery-item:focus-visible::after {
	background: rgba(15, 31, 65, 0.14);
}

@media (max-width: 767.98px) {
	.album-gallery-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 14px;
	}
}
@media (max-width: 479.98px) {
	.album-gallery-grid {
		grid-template-columns: 1fr;
	}
}

/* ----- Lightbox ----- */
.album-lightbox {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 72px;
}
.album-lightbox[hidden] {
	display: none;
}
.album-lightbox-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 18, 32, 0.92);
	cursor: zoom-out;
}

.album-lightbox-figure {
	position: relative;
	z-index: 1;
	margin: 0;
	max-width: 100%;
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}
.album-lightbox-img {
	max-width: min(1100px, 88vw);
	max-height: 80vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	background: #0a1220;
}
.album-lightbox-caption {
	color: rgba(255, 255, 255, 0.85);
	font-family: var(--fuchs-font, 'Montserrat', sans-serif);
	font-size: 0.95rem;
	font-weight: 300;
	text-align: center;
	max-width: 70ch;
	min-height: 1.2em;
}

/* Controls */
.album-lightbox-close,
.album-lightbox-nav {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	cursor: pointer;
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
	transition: background 0.2s ease, opacity 0.2s ease;
	border-radius: 50%;
}
.album-lightbox-close {
	top: 22px;
	right: 26px;
	width: 46px;
	height: 46px;
	font-size: 1.15rem;
}
.album-lightbox-nav {
	top: 50%;
	transform: translateY(-50%);
	width: 54px;
	height: 54px;
	font-size: 1.5rem;
}
.album-lightbox-prev {
	left: 22px;
}
.album-lightbox-next {
	right: 22px;
}
.album-lightbox-close:hover,
.album-lightbox-nav:hover {
	background: var(--fuchs-primary, #1260a9);
}
.album-lightbox-nav[hidden] {
	display: none;
}

.album-lightbox-counter {
	position: absolute;
	z-index: 2;
	bottom: 22px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.8);
	font-family: var(--fuchs-font, 'Montserrat', sans-serif);
	font-size: 0.9rem;
	letter-spacing: 1px;
}

@media (max-width: 575.98px) {
	.album-lightbox {
		padding: 20px 12px;
	}
	.album-lightbox-nav {
		width: 44px;
		height: 44px;
		font-size: 1.2rem;
	}
	.album-lightbox-prev {
		left: 8px;
	}
	.album-lightbox-next {
		right: 8px;
	}
	.album-lightbox-img {
		max-width: 94vw;
		max-height: 72vh;
	}
}

/* Prevent body scroll while the lightbox is open. */
body.album-lightbox-open {
	overflow: hidden;
}
