.spg-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 30px 15px;
}

.spg-heading {
	text-align: center;
	color: #8b0000;
	font-size: 28px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 20px;
	margin-bottom: 30px;
}
.spg-heading::before,
.spg-heading::after {
	content: "";
	flex: 1;
	height: 2px;
	background: #8b0000;
}

.spg-album-title {
	text-align: center;
	font-weight: 400;
	margin: 0 0 20px;
}

.spg-back {
	text-align: center;
	margin-bottom: 20px;
}
.spg-back a {
	color: #8b0000;
	text-decoration: none;
}

.spg-grid,
.spg-thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 20px;
}

.spg-card {
	border: 1px solid #ddd;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	text-decoration: none;
	color: inherit;
	display: block;
}
.spg-card-thumb img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}
.spg-card-title {
	text-align: center;
	padding: 10px 8px;
	font-size: 14px;
	color: #333;
}

.spg-thumb {
	position: relative;
	display: block;
	border: 1px solid #ddd;
	background: #fff;
}
.spg-thumb img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}
.spg-thumb-num {
	display: block;
	text-align: center;
	font-size: 13px;
	color: #333;
	padding: 6px 0;
}

/* Lightbox */
.spg-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.spg-lightbox[hidden] {
	display: none;
}
.spg-lb-image {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	user-select: none;
}
.spg-lightbox button {
	position: absolute;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
	padding: 10px 14px;
}
.spg-lb-close { top: 15px; right: 15px; }
.spg-lb-fullscreen { top: 15px; right: 65px; }
.spg-lb-prev { left: 15px; top: 50%; transform: translateY(-50%); }
.spg-lb-next { right: 15px; top: 50%; transform: translateY(-50%); }
.spg-lb-counter {
	position: absolute;
	bottom: 15px;
	left: 50%;
	transform: translateX(-50%);
	color: #fff;
	background: rgba(0, 0, 0, 0.5);
	padding: 4px 12px;
	font-size: 13px;
}

/* Admin meta box */
.spg-admin-preview {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}
.spg-admin-thumb {
	position: relative;
	width: 80px;
	height: 80px;
}
.spg-admin-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.spg-admin-remove {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 20px;
	height: 20px;
	line-height: 18px;
	border-radius: 50%;
	background: #a00;
	color: #fff;
	border: none;
	cursor: pointer;
	padding: 0;
}

@media (max-width: 480px) {
	.spg-heading { font-size: 22px; }
	.spg-lb-prev, .spg-lb-next { padding: 8px 10px; font-size: 16px; }
}
