/* Gallery Styles */
.gallery-content {
  padding: 2rem 0;
}

/* Gallery Preview for Main Gallery Page */
.gallery-preview {
  margin: 2rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.gallery-preview:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.gallery-preview:hover .card-img {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

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

.card-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0) 100%
  );
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.gallery-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 1px;
  position: relative;
}

.gallery-preview-grid img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.gallery-count {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 1px 4px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
}

.gallery-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.gallery-header h1 {
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-size: 2.25rem;
  font-weight: 700;
}

.gallery-nav {
  margin-top: 1rem;
}

.gallery-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.gallery-nav-link:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

/* Gallery Cards */
.card {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

.card-body {
  padding: 0.75rem !important;
}

@media (max-width: 576px) {
  .card-img-top {
    height: 150px;
  }
}

.gallery-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.gallery-item:hover::after {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .gallery-header h1 {
    font-size: 1.875rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .gallery-item {
    aspect-ratio: 3/2;
  }
}

/* High contrast support */
html.high-contrast .gallery-item::after {
  background: rgba(255, 255, 0, 0.3);
}
