/* Marmota Gallery – Frontend styles */

/* Thumbnail grid */
.mg-gallery {
	margin: 20px auto;
	text-align: center;
}

.mg-grid {
	display: grid;
	grid-template-columns: repeat( var( --mg-columns, 4 ), 1fr );
	gap: 12px;
}

@media ( max-width: 768px ) {
	.mg-grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( max-width: 480px ) {
	.mg-grid {
		grid-template-columns: 1fr;
	}
}

.mg-thumb {
	cursor: pointer;
	overflow: hidden;
	border-radius: 6px;
	position: relative;
}

.mg-thumb img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.mg-thumb:hover img {
	transform: scale( 1.04 );
}

.mg-thumb-caption {
	margin: 4px 0 0;
	font-size: 0.8em;
	color: #fff;
	text-align: center;
}

/* Pagination */
.mg-pagination {
	margin-top: 16px;
	text-align: center;
}

.mg-page-link {
	display: inline-block;
	margin: 0 3px;
	padding: 4px 10px;
	border-radius: 4px;
	text-decoration: none;
	color: #0073aa;
}

.mg-page-link.mg-page-current {
	background: #0073aa;
	color: #fff;
}

/* Lightbox */
.mg-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.mg-lightbox-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba( 0, 0, 0, 0.85 );
}

.mg-lightbox-content {
	position: relative;
	text-align: center;
	max-width: 95vw;
	max-height: 95vh;
}

.mg-lb-img {
	max-width: 90vw;
	max-height: 85vh;
	display: block;
	margin: 0 auto;
	border-radius: 4px;
	box-shadow: 0 4px 24px rgba( 0, 0, 0, 0.6 );
}

.mg-lb-caption {
	color: #fff;
	margin: 10px 0 0;
	font-size: 0.95em;
}

/* Close / prev / next / pause buttons */
.mg-lb-close,
.mg-lb-prev,
.mg-lb-next,
.mg-lb-pause {
	position: absolute;
	background: #000;
	color: #fff;
	/*border: 2px solid #fff;*/
	cursor: pointer;
	/*font-size: 24px;*/
	line-height: 1;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
	z-index: 1;
}

.mg-lb-close:hover,
.mg-lb-prev:hover,
.mg-lb-next:hover,
.mg-lb-pause:hover {
	background: #333;
	background-color: #555 !important;

}

.mg-lb-close {
	top: -22px;
	right: -22px;
	background-color: #000 !important;
}

.mg-lb-prev {
	top: 50%;
	left: -52px;
	transform: translateY( -50% );
	background-color: #000 !important;
}

.mg-lb-next {
	top: 50%;
	right: -57px;
	transform: translateY( -50% );
	background-color: #000 !important;
}

.mg-lb-pause {
	/* offset = half button height (44px / 2) so the button peeks below the content */
	bottom: -52px;
	left: 50%;
	transform: translateX( -50% );
	background-color: #000 !important;
}

@media ( max-width: 600px ) {
	.mg-lb-prev { left: -10px; }
	.mg-lb-next { right: -10px; }
	.mg-lb-close { top: -10px; right: -10px; }
	.mg-lb-pause { bottom: -50px; }
}
