.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
  gap: 2.5rem;
  padding: 2rem 0;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.gallery-item a {
  display: block;
  overflow: hidden;
  background: white;
  min-height: 300px;
}

.gallery-item img {
  width: 100%;
  height: auto;
  max-height: 500px;
  display: block;
  object-fit: contain;
  padding: 1rem;
  background: white;
}

.gallery-caption {
  padding: 1rem;
  text-align: center;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  color: #2c3e50;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: auto;
}

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

@media (max-width: 768px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .gallery-item img {
    max-height: 400px;
  }
}