/* Photo Gallery Section */
.gallery-section {
  padding: 80px 0;
  background-color: #f8fafc;
  overflow: hidden;
}

.gallery-section .section-title {
  text-align: center;
  margin-bottom: 50px;
}

.gallery-section .section-title h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 12px;
}

.gallery-section .section-title p {
  color: var(--gray-color);
  font-size: 1rem;
}

/* Carousel wrapper */
.gallery-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.gallery-track-wrapper {
  overflow: hidden;
  border-radius: 12px;
  margin: 0 60px;
}

.gallery-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  gap: 16px;
}

/* Each slide */
.gallery-slide {
  flex: 0 0 calc(33.333% - 11px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  position: relative;
  cursor: pointer;
  background: #000;
}

.gallery-slide img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, opacity 0.4s ease;
  opacity: 0.92;
}

.gallery-slide:hover img {
  transform: scale(1.04);
  opacity: 1;
}

/* Caption overlay */
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(26, 35, 126, 0.82));
  color: #fff;
  padding: 32px 16px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  transform: translateY(100%);
  transition: transform 0.35s ease;
}

.gallery-slide:hover .gallery-caption {
  transform: translateY(0);
}

/* Nav arrows */
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-50%) scale(1.08);
}

.gallery-btn-prev { left: 6px; }
.gallery-btn-next { right: 6px; }

/* Dot indicators */
.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  border: none;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
  padding: 0;
}

.gallery-dot.active {
  background: var(--primary-color);
  transform: scale(1.35);
}

/* Lightbox */
.gallery-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.gallery-lightbox.open {
  display: flex;
}

.gallery-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.gallery-lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10000;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.gallery-lightbox-close:hover {
  opacity: 1;
}

/* Mobile */
@media (max-width: 768px) {
  .gallery-track-wrapper {
    margin: 0 44px;
  }

  .gallery-slide {
    flex: 0 0 calc(100% - 0px);
  }

  .gallery-slide img {
    height: 240px;
  }

  .gallery-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .gallery-slide {
    flex: 0 0 calc(50% - 8px);
  }
}
