/* ========================================= */
/* GALLERY — DESKTOP 100VH + MOBILE SLIDER   */
/* ========================================= */

/* --- SECTION --- */
.gallery-category-section {
  width: 100%;
  background-color: #ffffff;
  position: relative;

  /* DESKTOP: strict 100vh */
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 80px;
  padding-bottom: 24px;
  overflow: hidden;
}

/* --- WRAPPER --- */
.gallery-category-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 0;
}

/* --- TITLE --- */
.gallery-category-header {
  flex-shrink: 0;
  margin-bottom: 1rem;
  text-align: center;
}

.gallery-main-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(22px, 2.5vw, 34px);
  color: #0c1c35;
  font-weight: 700;
}

.gallery-blue-accent {
  color: #0056b3;
}

/* ======================== */
/* DESKTOP GRID             */
/* ======================== */
#gallery-grid {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  align-content: stretch;
  align-items: stretch;
  overflow: hidden;
}

.gallery-item {
  display: flex;
  min-height: 0;
}

.gallery-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: none;
  box-shadow: none;
  transition: all 0.3s ease;
  cursor: pointer;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.gallery-img-box {
  flex: 1;
  width: 100%;
  overflow: hidden;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ======================== */
/* MOBILE SLIDER            */
/* ======================== */
.gallery-mobile-nav {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding-top: 15px;
}

@media (max-width: 767px) {
  /* Section: auto height, no overflow clip */
  .gallery-category-section {
    height: auto;
    padding-top: 90px;
    padding-bottom: 40px;
    overflow: hidden; /* clips slider horizontally */
  }

  .gallery-category-wrapper {
    min-height: unset;
    width: 100%;
    overflow: hidden;
  }

  /* Mobile slider container */
  #gallery-grid-mobile {
    display: flex !important;
    flex-wrap: nowrap;
    width: 100%;
    overflow: hidden; /* hides other slides — scroll-snap handles movement */
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    padding: 0;
    margin: 0;
  }

  /* Each slide = exactly full width */
  .gallery-mobile-slide {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
  }

  /* Image fills slide */
  .gallery-mobile-slide img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    display: block;
  }
}

/* ======================== */
/* LIGHTBOX                 */
/* ======================== */
.gallery-lightbox {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.lightbox-content {
  position: relative;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px;
}

#lightboxImg {
  max-width: 85vw;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border: 3px solid #fff;
  border-radius: 4px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 30px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10005;
  transition: 0.3s;
  user-select: none;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  color: #d4af37;
}
.lightbox-nav.prev {
  left: 20px;
}
.lightbox-nav.next {
  right: 20px;
}

.lightbox-close {
  position: absolute;
  top: 25px;
  right: 30px;
  color: white;
  font-size: 40px;
  cursor: pointer;
  z-index: 10006;
  line-height: 1;
}
/* ======================== */
/* DESKTOP — EQUAL ROW HEIGHT */
/* ======================== */
@media (min-width: 768px) {
  .gallery-img-box {
    aspect-ratio: 16 / 10; /* fixed ratio = both rows same height */
    flex: unset;
    height: auto;
  }
}
