/* Photograph theme – improved NextGEN Gallery layout in posts */

/* 1) Posts that contain a NextGEN gallery use the full width (no sidebar). */
body.single:has(.ngg-galleryoverview) #primary {
	float: none;
	width: 100%;
	max-width: none;
	padding-right: 0; /* gutter reserved for the sidebar */
}
body.single:has(.ngg-galleryoverview) #secondary {
	display: none;
}

/* 2) Responsive grid that fills the content width. */
.entry-content .ngg-galleryoverview {
	display: grid !important; /* NextGEN forces display:block !important */
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 6px;
	margin: 30px 0;
	padding: 0;
	overflow: visible;
}
.entry-content .ngg-galleryoverview::after,
.entry-content .ngg-galleryoverview .ngg-clear {
	display: none;
}
.entry-content .ngg-galleryoverview .ngg-gallery-thumbnail-box {
	float: none;
	width: auto !important;
	margin: 0;
}
.entry-content .ngg-galleryoverview .ngg-gallery-thumbnail {
	margin: 0;
	border: 0;
	background: none;
	overflow: hidden;
}
.entry-content .ngg-galleryoverview .ngg-gallery-thumbnail a {
	display: block;
	margin: 0;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}
.entry-content .ngg-galleryoverview .ngg-gallery-thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none !important;
	object-fit: cover;
	margin: 0;
	padding: 0;
	border: 0;
	transition: transform .4s ease, opacity .3s ease;
}
.entry-content .ngg-galleryoverview .ngg-gallery-thumbnail a:hover img,
.entry-content .ngg-galleryoverview .ngg-gallery-thumbnail a:focus img {
	transform: scale(1.06);
	opacity: .9;
}

/* Two columns on phones. */
@media (max-width: 600px) {
	.entry-content .ngg-galleryoverview {
		grid-template-columns: repeat(2, 1fr);
		gap: 4px;
	}
}

/* NextGEN pagination, if the owner enables "images per page". */
.entry-content .ngg-galleryoverview .ngg-navigation {
	grid-column: 1 / -1;
}

/* Lightbox (theme's fancyBox 3): darker backdrop for photos. */
.fancybox-is-open .fancybox-bg {
	opacity: .96;
}
