/* Newest First Gallery — front end */
.nfg {
	--nfg-c: var(--nfg-cols, 4);
	margin: 1.5em 0;
}
@media (max-width: 600px) {
	.nfg {
		--nfg-c: var(--nfg-cols-m, 2);
	}
}
.nfg-item {
	position: relative;
	margin: 0;
	min-width: 0;
}
.nfg-item[hidden] {
	display: none !important;
}
.nfg-media {
	display: block;
	overflow: hidden;
	border-radius: var(--nfg-radius, 0);
	line-height: 0;
}
.nfg-img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	transition: transform .35s ease, opacity .25s ease;
}

/* ---- Grid ---- */
.nfg-layout-grid .nfg-grid {
	display: grid;
	grid-template-columns: repeat(var(--nfg-c), minmax(0, 1fr));
	gap: var(--nfg-gap, 10px);
}
.nfg-layout-grid .nfg-media {
	aspect-ratio: var(--nfg-ratio, 1/1);
}
.nfg-layout-grid .nfg-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---- Masonry (CSS-columns fallback; gallery.js upgrades it so the
        newest images read left-to-right across the top) ---- */
.nfg-layout-masonry .nfg-grid {
	column-count: var(--nfg-c);
	column-gap: var(--nfg-gap, 10px);
}
.nfg-layout-masonry .nfg-item {
	break-inside: avoid;
	margin-bottom: var(--nfg-gap, 10px);
}
.nfg-layout-masonry.nfg-js .nfg-grid {
	column-count: auto;
	display: flex;
	align-items: flex-start;
	gap: var(--nfg-gap, 10px);
}
.nfg-layout-masonry.nfg-js .nfg-col {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--nfg-gap, 10px);
}
.nfg-layout-masonry.nfg-js .nfg-item {
	margin-bottom: 0;
}

/* ---- Justified rows ---- */
.nfg-layout-justified .nfg-grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--nfg-gap, 10px);
}
.nfg-layout-justified .nfg-grid::after {
	content: "";
	flex-grow: 999999;
}
.nfg-layout-justified .nfg-item {
	flex: var(--r, 1) 1 calc(var(--r, 1) * var(--nfg-row, 220px));
}
.nfg-layout-justified .nfg-media {
	height: var(--nfg-row, 220px);
}
.nfg-layout-justified .nfg-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
@media (max-width: 600px) {
	.nfg-layout-justified .nfg-item {
		flex-basis: calc(var(--r, 1) * var(--nfg-row, 220px) * .55);
	}
	.nfg-layout-justified .nfg-media {
		height: calc(var(--nfg-row, 220px) * .55);
	}
}

/* ---- Carousel ---- */
.nfg-layout-carousel .nfg-grid {
	display: flex;
	gap: var(--nfg-gap, 10px);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 8px;
}
.nfg-layout-carousel .nfg-item {
	flex: 0 0 auto;
	scroll-snap-align: start;
	width: calc(var(--r, 1) * var(--nfg-row, 220px));
	max-width: 90%;
}
.nfg-layout-carousel .nfg-media {
	height: var(--nfg-row, 220px);
}
.nfg-layout-carousel .nfg-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ---- Hover effects ---- */
.nfg-hover-zoom .nfg-item:hover .nfg-img {
	transform: scale(1.07);
}
.nfg-hover-fade .nfg-item:hover .nfg-img {
	opacity: .75;
}
.nfg-hover-lift .nfg-media {
	transition: box-shadow .25s ease, transform .25s ease;
}
.nfg-hover-lift .nfg-item:hover .nfg-media {
	box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
	transform: translateY(-3px);
}

/* ---- Captions ---- */
.nfg-caption {
	font-size: .85em;
	line-height: 1.35;
}
.nfg-captions-below .nfg-caption {
	padding: 6px 2px 0;
	text-align: center;
}
.nfg-captions-hover .nfg-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 22px 10px 8px;
	color: #fff;
	background: linear-gradient(transparent, rgba(0, 0, 0, .75));
	border-radius: 0 0 var(--nfg-radius, 0) var(--nfg-radius, 0);
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease;
}
.nfg-captions-hover .nfg-item:hover .nfg-caption,
.nfg-captions-hover .nfg-item:focus-within .nfg-caption {
	opacity: 1;
}
@media (hover: none) {
	.nfg-captions-hover .nfg-caption {
		opacity: 1;
	}
}

/* ---- Load more ---- */
.nfg-more-wrap {
	margin-top: 16px;
	text-align: center;
}
.nfg-more {
	padding: .6em 1.6em;
	cursor: pointer;
}

/* ---- Lightbox ---- */
.nfg-lb {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .93);
	opacity: 0;
	transition: opacity .2s ease;
	-webkit-user-select: none;
	user-select: none;
}
.nfg-lb.nfg-open {
	opacity: 1;
}
.nfg-lb-stage {
	flex: 1;
	min-height: 0;
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 12px 8px;
	box-sizing: border-box;
}
.nfg-lb-img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	box-shadow: 0 4px 30px rgba(0, 0, 0, .6);
	transition: opacity .2s ease;
}
.nfg-lb-img.nfg-loading {
	opacity: .25;
}
.nfg-lb-bar {
	width: 100%;
	min-height: 44px;
	padding: 8px 60px 14px;
	box-sizing: border-box;
	color: #ddd;
	font: 14px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	text-align: center;
}
.nfg-lb-count {
	display: block;
	font-size: 12px;
	color: #999;
}
.nfg-lb button {
	position: absolute;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font: 26px/44px Arial, sans-serif;
	cursor: pointer;
	transition: background .15s;
}
.nfg-lb button:hover,
.nfg-lb button:focus-visible {
	background: rgba(255, 255, 255, .3);
}
.nfg-lb-close {
	top: 10px;
	right: 10px;
}
.nfg-lb-prev {
	left: 10px;
	top: 50%;
	margin-top: -22px;
}
.nfg-lb-next {
	right: 10px;
	top: 50%;
	margin-top: -22px;
}
.nfg-lb-single .nfg-lb-prev,
.nfg-lb-single .nfg-lb-next,
.nfg-lb-single .nfg-lb-count {
	display: none;
}
