/* =========================================================
   Creativ Preschool — Photo Gallery Section
   ========================================================= */

#gallery {
	padding: 70px 0;
}

.gallery-section-header {
	text-align: center;
	margin-bottom: 40px;
}

.gallery-section-header .section-subtitle {
	margin-top: 8px;
	font-size: 16px;
	color: #6c626d;
}

/* ---------- Grid ---------- */
.gallery-grid {
	display: grid;
	gap: 16px;
}

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

.gallery-item {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 12px;
	background: #f3f3f3;
	box-shadow: 0 4px 18px rgba(0,0,0,0.08);
	aspect-ratio: 1 / 1;
	cursor: default;
	text-decoration: none;
	transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.gallery-has-lightbox .gallery-item {
	cursor: zoom-in;
}

.gallery-item:hover,
.gallery-item:focus {
	transform: translateY(-4px);
	box-shadow: 0 10px 28px rgba(0,0,0,0.15);
}

.gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.gallery-item:hover img {
	transform: scale(1.06);
}

.gallery-item .gallery-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 14px 16px;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
	transform: translateY(100%);
	transition: transform 0.35s ease;
}

.gallery-item:hover .gallery-caption,
.gallery-item:focus .gallery-caption {
	transform: translateY(0);
}

/* Touch devices: caption always visible */
@media (hover: none) {
	.gallery-item .gallery-caption {
		transform: translateY(0);
	}
}

/* Responsive grid collapse */
@media (max-width: 992px) {
	.gallery-cols-4 .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 767px) {
	.gallery-cols-3 .gallery-grid,
	.gallery-cols-4 .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
	.gallery-cols-2 .gallery-grid,
	.gallery-cols-3 .gallery-grid,
	.gallery-cols-4 .gallery-grid { grid-template-columns: 1fr; }
}

/* ---------- Slideshow ---------- */
.gallery-slideshow-mode .gallery-slider {
	margin: 0 -8px;
}

.gallery-slideshow-mode .gallery-slide {
	padding: 0 8px;
	outline: none;
}

.gallery-slideshow-mode .gallery-slide-inner {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	box-shadow: 0 6px 22px rgba(0,0,0,0.10);
	background: #f3f3f3;
	aspect-ratio: 4 / 3;
}

.gallery-slideshow-mode .gallery-slide-inner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.gallery-slideshow-mode .gallery-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 12px 16px;
	color: #fff;
	font-size: 14px;
	font-weight: 500;
	background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
}

/* Slick arrow + dot styling for gallery context */
.gallery-slider .slick-prev,
.gallery-slider .slick-next {
	width: 38px;
	height: 38px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	z-index: 2;
}

.gallery-slider .slick-prev { left: -10px; }
.gallery-slider .slick-next { right: -10px; }

.gallery-slider .slick-prev:before,
.gallery-slider .slick-next:before {
	color: #333;
	opacity: 1;
	font-size: 22px;
}

.gallery-slider .slick-dots {
	bottom: -38px;
}

.gallery-slider .slick-dots li button:before {
	font-size: 10px;
	opacity: 0.4;
}

.gallery-slider .slick-dots li.slick-active button:before {
	opacity: 1;
	color: #ED7014;
}

/* ---------- Lightbox ---------- */
.gallery-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.92);
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.gallery-lightbox.is-open {
	display: flex;
	opacity: 1;
}

.gallery-lb-stage {
	max-width: 92vw;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.gallery-lb-image {
	max-width: 92vw;
	max-height: 80vh;
	border-radius: 6px;
	box-shadow: 0 12px 50px rgba(0,0,0,0.55);
	opacity: 0;
	transform: scale(0.96);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-lb-image.is-loaded {
	opacity: 1;
	transform: scale(1);
}

.gallery-lb-caption {
	color: #fff;
	margin-top: 14px;
	font-size: 15px;
	max-width: 80vw;
	text-align: center;
	min-height: 1em;
}

.gallery-lb-close,
.gallery-lb-prev,
.gallery-lb-next {
	position: absolute;
	background: rgba(255,255,255,0.12);
	color: #fff;
	border: 0;
	cursor: pointer;
	font-size: 28px;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
}

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

.gallery-lb-close {
	top: 20px;
	right: 20px;
	font-size: 32px;
	line-height: 1;
}

.gallery-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.gallery-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

.gallery-lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.gallery-lb-next:hover { transform: translateY(-50%) translateX(2px); }

@media (max-width: 600px) {
	.gallery-lb-prev, .gallery-lb-next { width: 40px; height: 40px; font-size: 22px; }
	.gallery-lb-prev { left: 8px; }
	.gallery-lb-next { right: 8px; }
	.gallery-lb-close { top: 10px; right: 10px; }
}

body.gallery-lb-open {
	overflow: hidden;
}
