/* =============================================================
   Mithila Galleries — gallery.css  v1.1.0
   ============================================================= */

/* ── Reset ──────────────────────────────────────────────────── */
.mg-page *,
.mg-page *::before,
.mg-page *::after { box-sizing: border-box; }
.mg-page img  { max-width: 100%; height: auto; display: block; }
.mg-page ul   { list-style: none; margin: 0; padding: 0; }

.mg-container {
	width: 100%;
	max-width: 1366px;
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 3rem);
}

/* =============================================================
   1. PAGE HERO
   ============================================================= */
.mg-hero {
	position: relative;
	height: clamp(260px, 38vw, 440px);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	background: var(--wdtSecondaryColor, #363e5a);
}

.mg-hero__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 30%;
	display: block;
}

.mg-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(10,14,30,.55) 0%, rgba(10,14,30,.7) 100%);
}

.mg-hero__inner {
	position: relative;
	z-index: 2;
	text-align: center;
	padding-inline: 1.5rem;
}

.mg-hero__title {
	font-family: var(--wdtFontTypo_Alt, 'Oswald', sans-serif);
	font-size: clamp(2.25rem, 6vw, 4rem);
	font-weight: 700;
	color: #fff;
	margin: 0 0 .75rem;
	line-height: 1.1;
}

.mg-hero__breadcrumb {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	font-size: .9rem;
	color: rgba(255,255,255,.75);
}
.mg-hero__breadcrumb a {
	color: rgba(255,255,255,.75);
	text-decoration: none;
	transition: color .2s;
}
.mg-hero__breadcrumb a:hover { color: #fff; }
.mg-hero__breadcrumb span { color: var(--wdtPrimaryColor, #d88e7d); }

/* =============================================================
   2. GALLERY BODY
   ============================================================= */
.mg-body {
	background: var(--wdtTertiaryColor, #f8eae1);
	padding-top: clamp(3rem, 6vw, 5rem);
	padding-bottom: clamp(4rem, 8vw, 7rem);
}

.mg-body__intro-wrap {
	text-align: center;
	max-width: 820px;
	margin: 0 auto 2.5rem;
}

.mg-body__heading {
	font-family: var(--wdtFontTypo_Alt, 'Oswald', sans-serif);
	font-size: clamp(2rem, 4.5vw, 3rem);
	font-weight: 700;
	color: var(--wdtSecondaryColor, #363e5a);
	margin: 0 0 1.25rem;
	line-height: 1.15;
}

.mg-body__desc {
	font-size: .97rem;
	line-height: 1.8;
	color: #5a6070;
	margin: 0;
}

/* ── Gallery grid (single view, media-page style) ── */
.mg-masonry {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-auto-rows: 240px;
	grid-auto-flow: dense;
	gap: clamp(.75rem, 1.5vw, 1rem);
}

.mg-masonry__item {
	position: relative;
	overflow: hidden;
	border-radius: .6rem;
	cursor: pointer;
	background: #e8ddd4;
}

.mg-masonry__item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}

.mg-masonry__item:hover img { transform: scale(1.06); }

.mg-masonry__item--tall { grid-row: span 2; }
.mg-masonry__item--wide { grid-column: span 2; }

/* Caption overlay on hover */
.mg-masonry__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(26,15,8,.72) 0%, transparent 55%);
	display: flex;
	align-items: flex-end;
	padding: 1rem 1.1rem;
	opacity: 0;
	transition: opacity .25s;
}
.mg-masonry__item:hover .mg-masonry__overlay { opacity: 1; }
.mg-masonry__overlay span {
	font-family: var(--wdtFontTypo_Alt, 'Oswald', sans-serif);
	font-size: .88rem;
	letter-spacing: .03em;
	color: #fff;
}

.mg-masonry__item--hidden {
	display: none;
}

/* ── Lightbox ── */
.mg-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(0,0,0,.92);
	align-items: center;
	justify-content: center;
}
.mg-lightbox.is-open { display: flex; }

.mg-lightbox__img {
	max-width: 90vw;
	max-height: 88vh;
	object-fit: contain;
	border-radius: 6px;
	display: block;
}

.mg-lightbox__close {
	position: absolute;
	top: 1.25rem;
	right: 1.5rem;
	background: none;
	border: none;
	color: #fff;
	font-size: 2rem;
	cursor: pointer;
	line-height: 1;
	padding: .25rem .5rem;
	transition: color .2s;
}
.mg-lightbox__close:hover { color: var(--wdtPrimaryColor, #d88e7d); }

.mg-lightbox__prev,
.mg-lightbox__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255,255,255,.12);
	border: 1.5px solid rgba(255,255,255,.25);
	color: #fff;
	border-radius: 50%;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .2s;
}
.mg-lightbox__prev { left: 1.5rem; }
.mg-lightbox__next { right: 1.5rem; }
.mg-lightbox__prev:hover,
.mg-lightbox__next:hover { background: rgba(255,255,255,.25); }

/* ── Responsive ── */
@media (max-width: 900px) {
	.mg-masonry { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
	.mg-masonry {
		grid-template-columns: 1fr;
		grid-auto-rows: 220px;
	}
	.mg-masonry__item--tall,
	.mg-masonry__item--wide {
		grid-row: span 1;
		grid-column: span 1;
	}
}
