/* Gallery Styles */

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
}

.gallery a {
  display: block;
  overflow: hidden;
  border-radius: 0.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.gallery a:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
}

/* Compact Style - Small grid (3-4 columns) */
.gallery-compact {
  gap: 0.75rem;
  justify-content: flex-start;
}

.gallery-compact a {
  flex: 0 1 calc(25% - 0.75rem);
  min-width: 150px;
}

@media (max-width: 768px) {
  .gallery-compact a {
    flex: 1 1 calc(33.333% - 0.75rem);
    min-width: 120px;
  }
}

@media (max-width: 512px) {
  .gallery-compact a {
    flex: 1 1 calc(50% - 0.75rem);
    min-width: 100px;
  }
}

/* Default Style - Medium grid (2-3 columns) */
.gallery-default a {
  flex: 1 1 calc(33.333% - 1rem);
  min-width: 200px;
}

@media (max-width: 768px) {
  .gallery-default a {
    flex: 1 1 calc(50% - 1rem);
    min-width: 150px;
  }
}

@media (max-width: 512px) {
  .gallery-default a {
    flex: 1 1 100%;
  }
}

/* Grid Style - Uniform grid layout */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.gallery-grid a {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 512px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* Masonry Style */
.gallery-masonry {
  column-count: 4;
  column-gap: 1rem;
}

.gallery-masonry a {
  break-inside: avoid;
  margin-bottom: 1rem;
  display: inline-block;
  width: 100%;
}

@media (max-width: 1024px) {
  .gallery-masonry {
    column-count: 3;
  }
}

@media (max-width: 768px) {
  .gallery-masonry {
    column-count: 2;
  }
}

@media (max-width: 512px) {
  .gallery-masonry {
    column-count: 1;
  }
}
