/* ===== GALLERY PAGE ===== */

/* Hero Banner */
.gal-hero {
	aspect-ratio: 1920 / 300;
	display: flex;
	align-items: center;
	background-image: url("../../images/banner-hospital-kps-image.webp");
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
	background-color: #f4fafb;
	padding: 0 40px;
	border-radius: 20px;
	position: relative;
}

.gal-hero .gal-container {
	margin: 0;
	margin-left: 24px;
}

@media (min-width: 641px) {
	.gal-hero {
		width: 100%;
		height: 170px;
		box-sizing: border-box;
	}
}

.gal-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
		radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
	pointer-events: none;
}

.gal-hero h1 {
	color: #0d9faa;
	font-family: "Sora", sans-serif;
	font-size: 2.6rem;
	font-weight: 700;
	margin: 0;
	position: relative;
}

/* Container */
.gal-container {
	max-width: 1200px;
	margin: 0 auto;
}

/* Grid Section */
.gal-grid-section {
	padding: 60px 40px;
	background: #fff;
}

.gal-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.gal-item {
	border-radius: 12px;
	overflow: hidden;
	position: relative;
	box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
}

.gal-item::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #e0196e, #0d9faa);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 1;
}

.gal-item:hover::before {
	transform: scaleX(1);
}

.gal-item img {
	width: 100%;
	height: 260px;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
	cursor: pointer;
}

.gal-item:hover img {
	transform: scale(1.08);
}

/* Lightbox */
.gal-lightbox {
	display: flex;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	z-index: 10000;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gal-lightbox.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.gal-lightbox-img {
	max-width: 90vw;
	max-height: 85vh;
	border-radius: 8px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
	transform: scale(0.85);
	opacity: 0;
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

.gal-lightbox.is-open .gal-lightbox-img {
	transform: scale(1);
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.gal-lightbox,
	.gal-lightbox-img {
		transition: none;
	}
}

.gal-lightbox-close,
.gal-lightbox-prev,
.gal-lightbox-next {
	position: absolute;
	z-index: 2;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.4);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}

.gal-lightbox-close:hover,
.gal-lightbox-prev:hover,
.gal-lightbox-next:hover {
	background: rgba(224, 25, 110, 0.85);
	border-color: #e0196e;
	transform: scale(1.08);
}

.gal-lightbox-prev:hover,
.gal-lightbox-next:hover {
	transform: translateY(-50%) scale(1.08);
}

.gal-lightbox-close {
	top: 20px;
	right: 20px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	font-size: 1.8rem;
	line-height: 1;
}

.gal-lightbox-prev,
.gal-lightbox-next {
	top: 50%;
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	border-radius: 50%;
	font-size: 1.2rem;
}

.gal-lightbox-prev {
	left: 20px;
}

.gal-lightbox-next {
	right: 20px;
}

@media (max-width: 640px) {
	.gal-lightbox-prev,
	.gal-lightbox-next {
		width: 40px;
		height: 40px;
	}

	.gal-lightbox-close {
		width: 38px;
		height: 38px;
		top: 12px;
		right: 12px;
	}

	.gal-lightbox-prev {
		left: 8px;
	}

	.gal-lightbox-next {
		right: 8px;
	}
}

/* Scroll-reveal: bottom-to-up fade for the gallery grid */
.gal-reveal > * {
	opacity: 0;
	transform: translateY(55px);
	transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
	will-change: transform, opacity;
}

.gal-reveal.is-visible > * {
	opacity: 1;
	transform: translateY(0);
}

.gal-reveal.is-visible > *:nth-child(3n+1) { transition-delay: 0s; }
.gal-reveal.is-visible > *:nth-child(3n+2) { transition-delay: 0.12s; }
.gal-reveal.is-visible > *:nth-child(3n) { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
	.gal-reveal > * {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.gal-item img {
		transition: none;
	}

	.gal-item:hover img {
		transform: none;
	}
}

/* Responsive */
@media (max-width: 900px) {
	.gal-hero {
		margin-top: 16px;
		padding: 0 20px;
		border-radius: 0;
	}

	.gal-hero h1 {
		font-size: 1.4rem;
	}

	.gal-grid-section {
		padding: 40px 20px;
	}

	.gal-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 560px) {
	.gal-grid {
		grid-template-columns: 1fr;
	}

	.gal-item img {
		height: 220px;
	}
}
