/* =========================
   Gallery Section
========================= */

.gallery-section {
  width: 100%;
  padding: 30px 0;
  overflow: hidden;
  background: var(--bg-white);
}

.gallery-header {
  text-align: center;
  margin-bottom: 30px;
}

.gallery-header h2 {
  margin: 0 0 10px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-main);
}

.gallery-header p {
  margin: 0;
  font-size: 18px;
  color: var(--text-muted);
}

/* =========================
   Slider (compact design)
========================= */

.gallery-slider {
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 520px;
  overflow: visible;
  margin: 0 auto;
  padding: 0 20px;
}

.gallery-track {
  position: relative;
  width: 100%;
  height: 100%;
}

/* =========================
   Slides (with captions)
========================= */

.gallery-slide {
  position: absolute;
  top: 50%;
  left: 50%;

  width: 46%;
  min-height: 480px;

  transform: translate(-50%, -50%);
  transition:
    transform 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    z-index 0s linear;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  opacity: 0;
  visibility: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  overflow: visible;
  padding-bottom: 10px;
  z-index: 1;
}

.gallery-slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
  background: var(--bg-light);
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 10px 10px 0 0;
}

/* =========================
   Active Center Image
========================= */

.gallery-slide.active {
  opacity: 1;
  visibility: visible;

  transform: translate(-50%, -50%) scale(1);

  z-index: 5;
  filter: none;
  pointer-events: auto;
}

/* =========================
   Smooth z-index transition
========================= */

.gallery-slide.prev,
.gallery-slide.next {
  z-index: 2;
}

/* =========================
   Previous Image
========================= */

.gallery-slide.prev {
  opacity: 0.7;
  visibility: visible;
  pointer-events: none;

  transform: translate(calc(-50% - 260px), -50%) perspective(1000px)
    rotateY(6deg) scale(0.9);

  z-index: 2;
  filter: brightness(0.8);
}

/* =========================
   Next Image
========================= */

.gallery-slide.next {
  opacity: 0.7;
  visibility: visible;
  pointer-events: none;

  transform: translate(calc(-50% + 260px), -50%) perspective(1000px)
    rotateY(-6deg) scale(0.9);

  z-index: 2;
  filter: brightness(0.8);
}

/* =========================
   GPU Acceleration
========================= */

@supports (transform: translateZ(0)) {
  .gallery-slide {
    transform: translate(-50%, -50%) translateZ(0);
  }

  .gallery-slide.active {
    transform: translate(-50%, -50%) scale(1) translateZ(0);
  }

  .gallery-slide.prev {
    transform: translate(calc(-50% - 260px), -50%) perspective(1000px)
      rotateY(6deg) scale(0.9) translateZ(0);
  }

  .gallery-slide.next {
    transform: translate(calc(-50% + 260px), -50%) perspective(1000px)
      rotateY(-6deg) scale(0.9) translateZ(0);
  }
}

/* =========================
   Captions
========================= */

.gallery-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 12px 10px;
  background: var(--bg-white);
  border-top: 1px solid var(--border-col);
  min-height: 70px;
  pointer-events: auto;
  border-radius: 0 0 10px 10px;
  margin-top: -1px;
}

.gallery-caption-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.btn-view-gallery {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-black);
  background: var(--brand-gold);
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.25s ease;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  z-index: 20;
}

.gallery-slide.active .btn-view-gallery {
  pointer-events: auto;
  cursor: pointer;
}

.btn-view-gallery:hover {
  background: var(--gold-dark);
  color: var(--brand-black);
}

/* =========================
   Navigation
========================= */

.gallery-navigation {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 28px;
  margin-top: 30px;
}

/* Arrow Buttons */

.gallery-prev,
.gallery-next {
  border: none;
  background: transparent;

  width: 30px;
  height: 35px;

  padding: 0;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  color: var(--text-main);
}

.gallery-prev span,
.gallery-next span {
  font-size: 35px;
  line-height: 1;

  transition: transform 0.3s ease;
}

.gallery-prev:hover span {
  transform: translateX(-4px);
}

.gallery-next:hover span {
  transform: translateX(4px);
}

/* =========================
   Pagination
========================= */

.gallery-pagination {
  display: flex;
  align-items: center;
  gap: 18px;
}

.gallery-pagination button {
  border: none;
  background: transparent;

  padding: 0;

  font-size: 18px;
  font-weight: 600;

  color: var(--primary-blue);

  cursor: pointer;

  transition: all 0.3s ease;
}

.gallery-pagination button.active {
  color: var(--dark-blue);
  transform: scale(1.2);
}

/* =========================
   Responsive
========================= */

@media (max-width: 1400px) {
  .gallery-slide {
    width: 48%;
    min-height: 420px;
  }

  .gallery-slide img {
    height: 360px;
  }

  .gallery-slide.prev {
    transform: translate(calc(-50% - 160px), -50%) perspective(1000px)
      rotateY(5deg) scale(0.9);
  }

  .gallery-slide.next {
    transform: translate(calc(-50% + 160px), -50%) perspective(1000px)
      rotateY(-5deg) scale(0.9);
  }

  .gallery-slider {
    height: 480px;
  }
}

@media (max-width: 1200px) {
  .gallery-slide {
    width: 85%;
    min-height: 360px;
  }

  .gallery-slide img {
    height: 300px;
  }

  .gallery-slide.prev {
    opacity: 0;
    visibility: hidden;
  }

  .gallery-slide.next {
    opacity: 0;
    visibility: hidden;
  }

  .gallery-slider {
    height: 380px;
  }

  .gallery-header h2 {
    font-size: 28px;
  }

  .gallery-header p {
    font-size: 15px;
  }

  .gallery-navigation {
    margin-top: 20px;
    gap: 18px;
  }

  .gallery-pagination {
    gap: 12px;
  }

  .gallery-pagination button {
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  .gallery-section {
    padding: 25px 15px;
  }

  .gallery-header {
    margin-bottom: 25px;
  }

  .gallery-header h2 {
    font-size: 24px;
  }

  .gallery-header p {
    font-size: 14px;
  }

  .gallery-slider {
    height: 360px;
    padding: 0 10px;
  }

  .gallery-slide {
    width: 94%;
    min-height: 340px;
  }

  .gallery-slide img {
    height: 260px;
  }

  .gallery-slide.prev {
    opacity: 0;
    visibility: hidden;
  }

  .gallery-slide.next {
    opacity: 0;
    visibility: hidden;
  }

  .gallery-navigation {
    margin-top: 18px;
    gap: 14px;
  }

  .gallery-pagination {
    gap: 10px;
  }

  .gallery-pagination button {
    font-size: 14px;
  }
}
