/* ==========================================================================
   GALLERY LAYOUT & GRID
   ========================================================================== */


#gallery {
  padding-top: 50px;
  padding-bottom: 30px;
}
/* Default 4‑column gallery */
#gallery.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* 2‑column on tablets */
@media (max-width: 992px) {
  #gallery.gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1‑column on mobile */
@media (max-width: 576px) {
  
  #gallery.gallery-grid {
    grid-template-columns: 1fr;
  }

    /* Make header a column and push items to the top */
  #gallery-header {
    flex-direction: column !important;
    justify-content: flex-start !important;  /* push to top */
    align-items: center     !important;  /* keep centered horizontally */
  }

  /* Return the back button to normal flow */
  #backBtn {
    position: relative !important;
    left: auto              !important;
    margin-bottom: 2.0rem;              /* space before the title */
  }

  #gallery-title {
    font-size: 35px;
  }
}

/* Category “folders” use a flex‑wrap layout */
#gallery.category-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

/* ==========================================================================
   CATEGORY CARDS
   ========================================================================== */

.category-card {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 100%;
  max-width: 300px;
  height: 220px;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  font-size: 1.25rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.2s;
}

.category-card:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   THUMBNAILS
   ========================================================================== */

#gallery .gallery-img {
  width: 100%;
  height: 200px;
  object-fit: cover;

  cursor: pointer;
  border-radius: 4px;
  transition: transform 0.2s;
}

#gallery .gallery-img:hover {
  transform: scale(1.03);
}

/* ==========================================================================
   LIGHTBOX
   ========================================================================== */

.lightbox {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;

  display: none;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
}

#lightbox-img {
  max-width: 90%;
  max-height: 90%;
}

#lightbox-prev,
#lightbox-next,
#lightbox-close {
  background: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  position: absolute;
}

#lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

#lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

#lightbox-close {
  top: 20px;
  right: 20px;
}

/* ==========================================================================
   HEADER & NAV BUTTON
   ========================================================================== */

/* Back button in gallery header */
#backBtn {
  position: absolute;
  left: 1rem;
}

/* Centered gallery title */
#gallery-title {
  text-align: center;
  width: 100%;
}