/* NLS gallery — CSS multi-column masonry + album list */

.nls-album-grid,
.fg-album-grid.nls-album-grid {
	display: grid;
	gap: 20px;
	align-items: start;
	width: 100%;
	box-sizing: border-box;
	grid-template-columns: repeat(var(--nls-album-cols, 3), minmax(0, 1fr));
}

.nls-album-card,
.fg-album-card.nls-album-card {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 6px 0;
}

.nls-album-thumb,
.fg-album-thumb.nls-album-thumb {
	overflow: hidden;
	width: 100%;
	height: var(--nls-album-thumb-h, 160px);
	border-radius: 6px;
	background: #f5f5f5;
	display: block;
	position: relative;
}

.nls-album-thumb img,
.fg-album-thumb.nls-album-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nls-album-title,
.fg-album-title.nls-album-title {
	margin: 10px 0 4px;
	font-size: 1rem;
	line-height: 1.08;
	text-transform: uppercase;
	overflow-wrap: break-word;
}

.nls-album-title a {
	color: inherit;
	text-decoration: none;
}

.nls-album-count,
.fg-album-count.nls-album-count {
	color: #666;
	font-size: 0.9rem;
	margin-top: 4px;
}

.nls-album-desc {
	margin: 6px 0 0;
	color: #555;
	font-size: 0.92rem;
	line-height: 1.4;
}

.nls-gallery-wrap,
.fg-album-wrap.nls-gallery-wrap {
	max-width: 1200px;
	margin: 30px auto;
	padding: 18px;
	box-sizing: border-box;
}

.nls-gallery-header {
	margin-bottom: 16px;
}

.nls-gallery-title {
	margin: 0 0 10px;
	font-size: 30px;
	color: #0b2340;
}

.nls-gallery-date {
	margin: 0 0 8px;
	color: #666;
	font-size: 0.95rem;
}

.nls-gallery-description {
	color: #444;
	line-height: 1.5;
}

/* CSS multi-column masonry: preserve natural aspect ratios */
.nls-gallery-grid,
.nls-gallery-masonry {
	column-count: 3;
	column-gap: 14px;
	width: 100%;
}

.nls-gallery-item {
	display: inline-block;
	width: 100%;
	margin: 0 0 14px;
	break-inside: avoid;
	page-break-inside: avoid;
	-webkit-column-break-inside: avoid;
	overflow: hidden;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
	position: relative;
	vertical-align: top;
}

.nls-gallery-link {
	display: block;
	position: relative;
	color: inherit;
	text-decoration: none;
	line-height: 0;
}

.nls-gallery-item img,
.nls-gallery-item .nls-gallery-image {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto !important;
	margin: 0;
	border: 0;
	object-fit: unset;
	transition: opacity 0.25s ease;
	opacity: 1;
}

.js .nls-gallery-item:not(.is-resolved) img {
	opacity: 0.45;
}

.nls-gallery-item img.is-loaded,
.nls-gallery-item img.is-error,
.nls-gallery-item.is-resolved img {
	opacity: 1;
}

.nls-gallery-spinner {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 2px solid rgba(11, 35, 64, 0.15);
	border-top-color: #0b2340;
	animation: nls-spin 0.7s linear infinite;
	pointer-events: none;
}

.nls-gallery-item.is-resolved .nls-gallery-spinner {
	display: none;
}

@keyframes nls-spin {
	to {
		transform: rotate(360deg);
	}
}

.nls-gallery-caption {
	margin: 0;
	padding: 8px 10px 10px;
	font-size: 0.9rem;
	line-height: 1.35;
	color: #333;
	background: #fff;
}

.nls-gallery-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 120px;
	background: linear-gradient(135deg, #e9eef5, #f7f7f7);
	color: #6b7280;
	text-align: center;
	padding: 12px;
	box-sizing: border-box;
	line-height: 1.3;
}

.nls-gallery-fallback__label {
	font-size: 0.95rem;
}

.nls-gallery-empty {
	margin: 24px 0;
	color: #444;
}

.nls-gallery-pagination,
.fg-pagination.nls-gallery-pagination {
	text-align: center;
	margin-top: 22px;
}

.nls-gallery-pagination .page-numbers {
	margin: 0 6px;
	padding: 8px 12px;
	background: #fff;
	border-radius: 6px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	text-decoration: none;
	color: #0b2340;
	display: inline-block;
}

.nls-gallery-pagination .current {
	background: #0b2340;
	color: #fff;
	border-color: #0b2340;
}

/* Hide WP Accessibility "alt" toggle inside NLS galleries (also excluded via selector filter). */
.nls-gallery-wrap .wpa-alt > .wpa-toggle,
.nls-album-grid .wpa-alt > .wpa-toggle,
.nls-gallery-wrap .wpa-alt-text,
.nls-album-grid .wpa-alt-text {
	display: none !important;
}

/* Lightbox */
.nls-lightbox,
.fg-lightbox.nls-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 24px;
	box-sizing: border-box;
}

.nls-lightbox[hidden] {
	display: none !important;
}

.nls-lightbox__figure {
	margin: 0;
	max-width: 90%;
	text-align: center;
}

.nls-lightbox__image {
	max-width: 100%;
	max-height: 80vh;
	width: auto;
	height: auto;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	border-radius: 4px;
	display: block;
	margin: 0 auto;
}

.nls-lightbox__caption {
	color: #fff;
	margin-top: 10px;
	font-size: 0.95rem;
	line-height: 1.4;
}

.nls-lightbox__caption:empty {
	display: none;
}

.nls-lightbox__close,
.nls-lightbox__prev,
.nls-lightbox__next,
.fg-lb-close,
.fg-lb-prev,
.fg-lb-next {
	position: absolute;
	color: #fff;
	font-size: 28px;
	background: rgba(0, 0, 0, 0.35);
	padding: 10px 12px;
	border-radius: 6px;
	cursor: pointer;
	border: 0;
	line-height: 1;
	user-select: none;
}

.nls-lightbox__close,
.fg-lb-close {
	right: 24px;
	top: 24px;
	font-size: 20px;
}

.nls-lightbox__prev,
.fg-lb-prev {
	left: 20px;
	top: 50%;
	transform: translateY(-50%);
}

.nls-lightbox__next,
.fg-lb-next {
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
}

.nls-lightbox__close:focus,
.nls-lightbox__prev:focus,
.nls-lightbox__next:focus {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (max-width: 900px) {
	.nls-gallery-grid,
	.nls-gallery-masonry {
		column-count: 2;
		column-gap: 12px;
	}

	.nls-gallery-item {
		margin-bottom: 12px;
	}

	.nls-album-grid,
	.fg-album-grid.nls-album-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.nls-gallery-grid,
	.nls-gallery-masonry {
		column-count: 1;
		column-gap: 12px;
	}

	.nls-album-grid,
	.fg-album-grid.nls-album-grid {
		grid-template-columns: 1fr;
	}

	.nls-album-thumb,
	.fg-album-thumb.nls-album-thumb {
		height: calc(var(--nls-album-thumb-h, 160px) * 0.75);
	}
}

.no-js .nls-gallery-item img,
html.no-js .nls-gallery-item img {
	opacity: 1;
}

.no-js .nls-gallery-spinner,
html.no-js .nls-gallery-spinner {
	display: none;
}
