/* ============================================================
   Shared Gallery + Lightbox styles
   Used by: clinic-tour.html & patient's-gallery.html
   ============================================================ */

/* ---------- Card grid ---------- */
.gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 24px;
}

@media (max-width: 900px) {
	.gallery-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 600px) {
	.gallery-grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- Individual card ---------- */
.gl-card {
	border-radius: 14px;
	overflow: hidden;
	cursor: pointer;
	position: relative;
	box-shadow: 0 6px 18px rgba(20, 30, 40, 0.07);
	transition:
		transform 0.22s ease,
		box-shadow 0.22s ease;
	background: #000;
	outline: none;
}

.gl-card:hover,
.gl-card:focus-visible {
	transform: translateY(-6px);
	box-shadow: 0 18px 40px rgba(12, 24, 40, 0.14);
}

/* Thumbnail wrapper — fixed aspect ratio */
.gl-card-thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

/* Image inside card */
.gl-card-thumb img,
.gl-card-thumb video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.gl-card:hover .gl-card-thumb img,
.gl-card:hover .gl-card-thumb video,
.gl-card:focus-visible .gl-card-thumb img,
.gl-card:focus-visible .gl-card-thumb video {
	transform: scale(1.06);
}

/* Overlay — visible by default, hides on hover */
.gl-card-overlay {
	position: absolute;
	inset: 0;
	background: rgba(26, 77, 126, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.gl-card:hover .gl-card-overlay,
.gl-card:focus-visible .gl-card-overlay {
	opacity: 0;
}

.gl-card-overlay h3 {
	color: #fff;
	font-size: clamp(16px, 2.5vw, 22px);
	font-weight: 700;
	text-align: center;
	margin: 0;
	padding: 0 12px;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Play badge on video cards */
.gl-card[data-type="video"] .gl-card-overlay::after {
	content: "▶";
	position: absolute;
	bottom: 14px;
	right: 14px;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(4px);
	border-radius: 50%;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	color: #fff;
}

/* ---------- Lightbox overlay ---------- */
.gl-lightbox {
	position: fixed;
	inset: 0;
	z-index: 1200;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(8, 12, 18, 0.82);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	padding: 20px;
	opacity: 0;
	visibility: hidden;
	transition:
		opacity 0.28s ease,
		visibility 0.28s ease;
}

.gl-lightbox.gl-open {
	opacity: 1;
	visibility: visible;
}

/* Panel */
.gl-lb-panel {
	width: min(1300px, 96vw);
	max-height: 96vh;
	background: #0e1217;
	border-radius: 14px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
	position: relative;
	transform: scale(0.96);
	transition: transform 0.28s ease;
}

.gl-lightbox.gl-open .gl-lb-panel {
	transform: scale(1);
}

/* Close button */
.gl-lb-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 10;
	background: rgba(255, 255, 255, 0.12);
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #fff;
	font-size: 20px;
	transition: background 0.2s ease;
}

.gl-lb-close:hover {
	background: rgba(255, 255, 255, 0.25);
}

/* Media area */
.gl-lb-media {
	position: relative;
	background: #000;
	height: min(75vh, 850px);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.gl-lb-media img,
.gl-lb-media video {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	display: block;
}

.gl-lb-media video {
	width: 100%;
	height: 100%;
}

/* Prev / Next arrows */
.gl-lb-prev,
.gl-lb-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	background: rgba(255, 255, 255, 0.14);
	backdrop-filter: blur(4px);
	border: none;
	border-radius: 50%;
	width: 46px;
	height: 46px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #fff;
	font-size: 22px;
	transition: background 0.2s ease;
}

.gl-lb-prev {
	left: 12px;
}
.gl-lb-next {
	right: 12px;
}

.gl-lb-prev:hover,
.gl-lb-next:hover {
	background: rgba(255, 255, 255, 0.28);
}

/* Caption area */
.gl-lb-caption {
	padding: 18px 22px;
	background: #0e1217;
	flex-shrink: 0;
}

.gl-lb-caption-title {
	display: block;
	color: #fff;
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0 0 8px;
}

.gl-lb-caption-desc {
	margin: 0;
	color: #b8d4f0;
	font-size: 0.92rem;
	line-height: 1.55;
	opacity: 0.92;
}

/* Responsive */
@media (max-width: 600px) {
	.gl-lb-media {
		height: 46vw;
		min-height: 200px;
	}

	.gl-lb-caption {
		padding: 14px 16px;
	}

	.gl-lb-prev,
	.gl-lb-next {
		width: 36px;
		height: 36px;
		font-size: 17px;
	}
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
	.gl-card-thumb img,
	.gl-card-thumb video {
		transition: none !important;
		transform: none !important;
	}
	.gl-lightbox,
	.gl-lb-panel {
		transition: none !important;
	}
}
