/* Custom Gallery Grid */
.custom-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.custom-gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  aspect-ratio: 4/3;
  border: 1px solid rgba(0, 0, 0, 0.03);
  background-color: #f9f9f9;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.custom-gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.custom-gallery-item:hover .gallery-thumb {
  transform: scale(1.08);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 40, 37, 0.4); /* Freitag Charcoal Overlay */
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.custom-gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-zoom-icon {
  color: white;
  font-size: 32px;
  font-weight: 300;
  border: 1.5px solid white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.custom-gallery-item:hover .gallery-zoom-icon {
  transform: scale(1);
}

/* Lightbox Modal CSS */
.custom-lightbox {
  position: fixed;
  z-index: 99999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(18, 18, 18, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.custom-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  position: relative;
  max-width: 85%;
  max-height: 80%;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#lightbox-caption {
  color: #ccc;
  font-family: 'Outfit', sans-serif;
  margin-top: 15px;
  font-size: 16px;
  letter-spacing: 0.5px;
}

/* Close & Nav Buttons */
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  color: rgba(255, 255, 255, 0.7);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  z-index: 100000;
}

.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
  color: white;
}

.lightbox-close {
  top: 30px;
  right: 40px;
  font-size: 50px;
}

.lightbox-prev {
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 768px) {
  .custom-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }
  .lightbox-prev, .lightbox-next {
    font-size: 30px;
  }
  .lightbox-prev { left: 15px; }
  .lightbox-next { right: 15px; }
  .lightbox-close { right: 20px; top: 15px; }
}
