/* ==========================================
   GALLERY GRID & LIGHTBOX STYLES
   ========================================== */

/* Main Container */
.griding {
  background-color: #ffffff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  /* max-width: 1000px; */
  max-width: auto;
  margin: 0 auto;
}

/* Individual Grid Item */
.grid-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background-color: #1a1a1a;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.grid-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.grid-item:hover img {
  transform: scale(1.05);
}

/* Lightbox Modal */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 90vw;
  max-width: 90vw;
  max-height: 85vh;
}

.expanded-image {
  width: 100%;
  max-width: 90vw;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  user-select: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

/* Navigation Controls & Buttons */
.nav-zone {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 12%;
  max-width: 120px;
  display: flex;
  align-items: center;
  cursor: pointer;
  z-index: 1010;
  transition: background-color 0.3s ease;
}

.nav-zone-prev {
  left: 0;
  justify-content: flex-start;
  padding-left: 20px;
}

.nav-zone-next {
  right: 0;
  justify-content: flex-end;
  padding-right: 20px;
}

.nav-zone:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.arrow-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30, 30, 35, 0.8);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition:
    transform 0.3s ease,
    background-color 0.3s ease;
  pointer-events: none;
}

.nav-zone:hover .arrow-btn {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.close-btn {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(30, 30, 35, 0.8);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1020;
  transition:
    transform 0.3s ease,
    background-color 0.3s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .lightbox-content,
  .expanded-image {
    max-width: 92vw;
    max-height: 75vh;
  }

  .nav-zone {
    width: 15%;
  }

  .nav-zone-prev {
    padding-left: 10px;
  }
  .nav-zone-next {
    padding-right: 10px;
  }
  .arrow-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  .close-btn {
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .grid-item:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: 100%; /* Keeps it visually balanced with the rest */
    justify-self: center;
    width: 100%;
  }

  [data-aos] {
    opacity: 0 !important;
    transform: translateY(30px) !important;
    transition-property: transform, opacity !important;
  }

  /* Animated state on mobile */
  [data-aos].aos-animate {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
}

@media (max-width: 480px) {
  .grid-container {
    grid-template-columns: 1fr;
  }
}
