/* ==========================================================================
   SmugMug Embed – Front-end gallery styles
   ========================================================================== */

/* ---- Grid ---- */
.sme-gallery {
	display: grid;
	gap: 12px;
	margin: 0 0 1.5rem;
}

.sme-cols-1 { grid-template-columns: repeat(1, 1fr); }
.sme-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sme-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sme-cols-4 { grid-template-columns: repeat(4, 1fr); }
.sme-cols-5 { grid-template-columns: repeat(5, 1fr); }
.sme-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 768px) {
	.sme-cols-4,
	.sme-cols-5,
	.sme-cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
	.sme-gallery { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
}

/* ---- Items ---- */
.sme-item {
	margin: 0;
	overflow: hidden;
	border-radius: 4px;
	background: #f0f0f0;
}

.sme-item a,
.sme-item img {
	display: block;
	width: 100%;
}

.sme-thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	aspect-ratio: 1 / 1;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.sme-lightbox-trigger:hover .sme-thumb,
.sme-lightbox-trigger:focus .sme-thumb {
	transform: scale(1.04);
	opacity: 0.9;
}

.sme-caption {
	padding: 6px 8px;
	font-size: 0.82em;
	line-height: 1.4;
	color: #555;
	background: rgba(255, 255, 255, 0.9);
}

.sme-gallery-empty,
.sme-error {
	color: #888;
	font-style: italic;
	padding: 12px 0;
}

.sme-error {
	color: #c00;
}

/* ==========================================================================
   Lightbox overlay
   ========================================================================== */
.sme-lb-overlay {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0, 0, 0, 0.92);
	align-items: center;
	justify-content: center;
}

.sme-lb-overlay.sme-lb-active {
	display: flex;
}

.sme-lb-inner {
	position: relative;
	max-width: 90vw;
	max-height: 90vh;
	text-align: center;
}

.sme-lb-img {
	max-width: 100%;
	max-height: 85vh;
	object-fit: contain;
	border-radius: 3px;
	display: block;
	margin: 0 auto;
}

.sme-lb-img.sme-lb-loading {
	opacity: 0.3;
}

.sme-lb-caption {
	color: #ddd;
	margin: 8px 0 0;
	font-size: 0.9em;
}

/* Buttons */
.sme-lb-close,
.sme-lb-prev,
.sme-lb-next {
	position: absolute;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	cursor: pointer;
	border-radius: 50%;
	line-height: 1;
	transition: background 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sme-lb-close:hover,
.sme-lb-prev:hover,
.sme-lb-next:hover {
	background: rgba(255, 255, 255, 0.3);
}

.sme-lb-close {
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	font-size: 24px;
}

.sme-lb-prev,
.sme-lb-next {
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	font-size: 32px;
}

.sme-lb-prev { left: 16px; }
.sme-lb-next { right: 16px; }
