/* ************************* Gallery page styles ********************************* */
.hero-gallery {
  background: url('../images/gallery/art_gallery.png') center/cover no-repeat;
  padding: 5rem 0;
  text-align: center;
  color: #fff;
}
.hero-gallery .gallery-heading h1 {
  font-size: 3rem;
  font-weight: bold;
}
.hero-gallery .gallery-heading p {
  font-size: 1.2rem;
  margin-top: 0.5rem;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
  /* text-align: center;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem; */
}
/* .filter-buttons {
  text-align: center;
  margin-bottom: 20px;
} */
.filter-btn {
  background: #004466;
  color: #fff;
  border: none;
  /* padding: 0.6rem 1.2rem;
  margin: 0 0.5rem; */
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.3s;
}
.filter-btn:hover,
.filter-btn.active {
  background: #a31e2f;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  /* border-radius: 6px; */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.3s ease;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover img {
  transform: scale(1.05);
}
.gallery-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10,32,61,0.7);
  color: #fff;
  padding: 0.5rem;
  font-size: 0.9rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover .overlay {
  opacity: 1;
}

.category-heading {
  grid-column: 1 / -1;
  font-size: 2rem;
  font-weight: bold;
  margin: 30px 0 10px;
  color: #003366;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 1200;
  inset: 0;
  background-color: rgba(0,0,0,0.9);
  /* display: flex; */
  align-items: center;
  justify-content: center;
  overflow: hidden;

  /* padding: 40px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%; */
}

/* show overlay */
.lightbox.active {
  display: flex;
}

.lightbox img {
  /* display: block;
  margin: auto; */
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 320ms ease, transform 0.3s ease;
  will-change: opacity, transform;
  visibility: hidden;
}

/* when image has loaded, reveal it */
.lightbox img.loaded {
  opacity: 1;
  transform: scale(1);
  visibility: visible;
}

/* .lightbox.show img {
  opacity: 1;
  transform: scale(1);
} */

.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  /* top: 20px;
  right: 30px; */
  color: #fff;
  font-size: 36px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1250;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 48px;
  color: #fff;
  cursor: pointer;
  padding: 10px;
  z-index: 1250;
  user-select: none;
}

.lightbox-nav.left {
  left: 20px;
}
.lightbox-nav.right {
  right: 20px;
}

.lightbox-nav:hover {
  color: #cc0033;
}

/* optional caption / meta */
.lightbox-caption {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  z-index:1250;
  font-size: 0.95rem;
  max-width: 88%;
  text-align: center;
}

/* Gallery filtering animation */
.gallery-item {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.gallery-item.hide {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
  position: absolute;
}
/* ======================
   Responsive Gallery
   ====================== */

/* Tablets */
@media (max-width: 1024px) {
  .gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .filter-btn {
    flex: 1 1 auto;
    min-width: 100px;
    font-size: 0.9rem;
    padding: 8px 12px;
  }
  .category-heading {
    font-size: 1.5rem;
    text-align: center;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.8rem;
  }
}
/* Mobile adjustments */
@media (max-width: 768px) {
  .hero-gallery .gallery-heading h1 {
    font-size: 1.8rem;
  }
  .hero-gallery .gallery-heading p {
    font-size: 1rem;
  }

  .gallery-filters {
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
  }
  .filter-btn {
    width: 100%;
    max-width: 300px;
    font-size: 0.95rem;
    padding: 10px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .category-heading {
    font-size: 1.4rem;
    margin: 20px 0 10px;
  }

  /* Lightbox buttons: larger tap targets */
  .lightbox-nav {
    font-size: 60px;
    padding: 15px;
  }
  .lightbox-close {
    font-size: 40px;
    top: 12px;
    right: 18px;
  }
}

/* Extra small phones */
@media (max-width: 480px) {
  .gallery-heading h1 {
    font-size: 1.5rem;
  }
  .gallery-heading p {
    font-size: 0.9rem;
  }

  .filter-btn {
    font-size: 0.85rem;
    padding: 8px;
  }

  .category-heading {
    font-size: 1.2rem;
  }

  .lightbox img {
    max-width: 95%;
    max-height: 80%;
  }
}