/* Gallery Styles - Works with Justified Gallery */

.gallery {
  margin: 2rem 0;
  width: 100%;
}

/* Override Justified Gallery defaults for better integration */
.justified-gallery {
  margin-bottom: 0 !important;
}

.justified-gallery > a,
.justified-gallery > div {
  position: relative;
  overflow: hidden;
}

/* Hover effects for gallery items */
.justified-gallery > a:hover img {
  transform: scale(1.05);
}

.justified-gallery img {
  transition: transform 0.3s ease;
}

/* Gallery Caption */
.gallery-caption {
  text-align: center;
  margin-top: 1rem;
  font-size: 14px;
  color: #666;
  font-style: italic;
}

/* Custom caption styling within gallery */
.jg-caption {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: white;
  font-size: 14px;
  padding: 10px;
  display: flex;
  align-items: flex-end;
}

/* Loading state */
.gallery.loading {
  min-height: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Different gallery layout options */
.gallery-mosaic .justified-gallery {
  /* Mosaic style with tighter margins */
}

.gallery-masonry .justified-gallery {
  /* Masonry style */
}

.gallery-grid .justified-gallery {
  /* Grid style - might override to use CSS Grid instead */
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .gallery {
    margin: 1rem 0;
  }
}

/* Print styles */
@media print {
  .gallery {
    break-inside: avoid;
  }
  
  .justified-gallery {
    display: block !important;
  }
  
  .justified-gallery > a,
  .justified-gallery > div {
    display: inline-block !important;
    width: 32% !important;
    margin: 0.5% !important;
    page-break-inside: avoid;
  }
}