.nss-epg-gallery {
	--nss-epg-gap: 14px;
	max-width: 1400px;
	margin: 0 auto;
	padding: 10px 0 40px;
	box-sizing: border-box;
}

.nss-epg-gallery * {
	box-sizing: border-box;
}

/* Full-width wrapper used by the plugin's own page template
   (templates/template-event-photos.php). Harmless if the shortcode is
   instead placed inside a normal, theme-constrained page. */
.nss-epg-template-wrap {
	max-width: 1400px;
	margin: 0 auto;
	padding: 40px 24px 20px;
}

.nss-epg-template-header {
	text-align: center;
	margin-bottom: 24px;
}

.nss-epg-template-title {
	margin: 0 0 8px;
	font-size: 2rem;
}

.nss-epg-template-intro {
	color: #555;
	max-width: 700px;
	margin: 0 auto;
}

@media (max-width: 640px) {
	.nss-epg-template-wrap {
		padding: 24px 16px 10px;
	}

	.nss-epg-template-title {
		font-size: 1.5rem;
	}
}

/* Grid: 5 / 4 / 2 columns at desktop / tablet / mobile */
.nss-epg-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: var(--nss-epg-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1024px) {
	.nss-epg-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 640px) {
	.nss-epg-grid {
		grid-template-columns: repeat(2, 1fr);
		--nss-epg-gap: 8px;
	}
}

.nss-epg-item {
	margin: 0;
	padding: 0;
}

.nss-epg-thumb-btn {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	padding: 0;
	border: none;
	border-radius: 8px;
	overflow: hidden;
	background: #eee;
	cursor: pointer;
	position: relative;
}

.nss-epg-thumb-btn img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.nss-epg-thumb-btn:hover img,
.nss-epg-thumb-btn:focus-visible img {
	transform: scale(1.05);
}

.nss-epg-thumb-btn:focus-visible {
	outline: 3px solid #2271b1;
	outline-offset: 2px;
}

.nss-epg-thumb-btn.is-downloaded img {
	opacity: 0.55;
}

.nss-epg-downloaded-badge {
	position: absolute;
	inset: auto 0 0 0;
	padding: 6px 4px;
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	letter-spacing: 0.02em;
}

/* Loading placeholder shimmer while an <img> loads */
.nss-epg-thumb-btn img[loading] {
	background: #eee;
}

/* Load more */
.nss-epg-loadmore-wrap {
	text-align: center;
	margin-top: 32px;
}

.nss-epg-count {
	color: #555;
	font-size: 0.95rem;
	margin-bottom: 14px;
}

.nss-epg-loadmore {
	display: inline-block;
	padding: 12px 32px;
	font-size: 1rem;
	font-weight: 600;
	color: #fff;
	background: #1d2327;
	border: none;
	border-radius: 999px;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.1s ease;
}

.nss-epg-loadmore:hover {
	background: #2c3338;
}

.nss-epg-loadmore:active {
	transform: scale(0.98);
}

.nss-epg-loadmore:disabled {
	opacity: 0.6;
	cursor: default;
}

.nss-epg-spinner,
.nss-epg-lightbox-spinner {
	width: 28px;
	height: 28px;
	margin: 16px auto 0;
	border: 3px solid rgba(0, 0, 0, 0.15);
	border-top-color: #1d2327;
	border-radius: 50%;
	animation: nss-epg-spin 0.8s linear infinite;
}

.nss-epg-lightbox-spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -14px 0 0 -14px;
	border-color: rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
}

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

.nss-epg-empty-state {
	text-align: center;
	padding: 60px 20px;
	color: #666;
	font-size: 1.1rem;
}

/* Lightbox */
.nss-epg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(10, 10, 10, 0.95);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.nss-epg-lightbox[hidden] {
	display: none;
}

.nss-epg-lightbox-stage {
	position: relative;
	width: 100%;
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 70px 70px 10px;
	min-height: 0;
}

.nss-epg-lightbox-stage img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.nss-epg-lightbox-stage img.is-loaded {
	opacity: 1;
}

.nss-epg-lightbox-close,
.nss-epg-lightbox-prev,
.nss-epg-lightbox-next {
	position: absolute;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	transition: background 0.15s ease;
}

.nss-epg-lightbox-close:hover,
.nss-epg-lightbox-prev:hover,
.nss-epg-lightbox-next:hover {
	background: rgba(255, 255, 255, 0.2);
}

.nss-epg-lightbox-close {
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	font-size: 26px;
	border-radius: 50%;
	z-index: 2;
}

.nss-epg-lightbox-prev,
.nss-epg-lightbox-next {
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	font-size: 34px;
	border-radius: 50%;
}

.nss-epg-lightbox-prev {
	left: 12px;
}

.nss-epg-lightbox-next {
	right: 12px;
}

.nss-epg-lightbox-prev[disabled],
.nss-epg-lightbox-next[disabled] {
	opacity: 0.25;
	cursor: default;
}

.nss-epg-lightbox-footer {
	flex: 0 0 auto;
	padding: 16px 0 28px;
}

.nss-epg-lightbox-download {
	display: inline-block;
	padding: 12px 30px;
	background: #fff;
	color: #1d2327;
	font-weight: 600;
	text-decoration: none;
	border-radius: 999px;
	transition: background 0.2s ease;
}

.nss-epg-lightbox-download:hover {
	background: #e2e2e2;
	color: #1d2327;
}

.nss-epg-lightbox-note {
	margin: 10px 0 0;
	color: rgba(255, 255, 255, 0.6);
	font-size: 12px;
	text-align: center;
}

@media (max-width: 640px) {
	.nss-epg-lightbox-stage {
		padding: 60px 12px 10px;
	}

	.nss-epg-lightbox-prev,
	.nss-epg-lightbox-next {
		width: 42px;
		height: 42px;
		font-size: 26px;
	}

	.nss-epg-lightbox-prev {
		left: 4px;
	}

	.nss-epg-lightbox-next {
		right: 4px;
	}
}
