.gallery-filter-bar {
  background: #fff;
  border-bottom: 1px solid rgba(0, 51, 102, 0.08);
  padding: 0.6rem 0;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  margin-top: 0;
  margin-bottom: 0;
}

/* Reduce gap between filter and gallery grid */
.gallery-filter-bar + .section {
  padding-top: var(--spacing-md) !important;
}

.gallery-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-filter-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid rgba(0, 51, 102, 0.15);
  border-radius: 25px;
  background: transparent;
  color: var(--color-text-light);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-filter-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.gallery-filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}


.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.gallery-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 51, 102, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

.gallery-card.hidden {
  display: none;
}

/* Image Area / Placeholder */
.gallery-card-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, #e8ecf1 100%);
  color: rgba(0, 51, 102, 0.2);
  transition: color 0.3s ease;
}

.gallery-card:hover .gallery-placeholder {
  color: var(--color-accent);
}

.gallery-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.4s ease;
}

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

/* Card Info */
.gallery-card-info {
  padding: 0.8rem 1rem;
}

.gallery-card-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.3rem;
}

.gallery-card-info p {
  font-size: var(--font-size-body-compact);
  color: var(--color-text-light);
  margin-bottom: 0.6rem;
}

.gallery-card-tag {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  background: var(--color-bg-alt);
  color: var(--color-primary);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 12px;
  border: 1px solid rgba(0, 51, 102, 0.1);
}

/* Multi-image badge on card */
.gallery-photo-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
  backdrop-filter: blur(4px);
}

.gallery-photo-count svg {
  width: 14px;
  height: 14px;
}

/* Gallery Lightbox */
.gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox.active {
  opacity: 1;
  visibility: visible;
}

.gallery-lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.gallery-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  user-select: none;
}

.gallery-lightbox.active .gallery-lightbox-img {
  transform: scale(1);
}

.gallery-lightbox-close {
  position: absolute;
  top: -2rem;
  right: -1rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 2;
}

.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  z-index: 2;
}

.gallery-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.gallery-lightbox-prev {
  left: -4rem;
}

.gallery-lightbox-next {
  right: -4rem;
}

.gallery-lightbox-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.75rem;
  letter-spacing: 0.5px;
}

.gallery-lightbox-caption {
  color: #fff;
  font-size: 0.9rem;
  margin-top: 0.4rem;
  text-align: center;
  max-width: 600px;
}

/* Hide nav buttons when only one image */
.gallery-lightbox-nav.hidden {
  display: none;
}

@media (max-width: 768px) {
  .gallery-lightbox-prev {
    left: 0.5rem;
  }

  .gallery-lightbox-next {
    right: 0.5rem;
  }

  .gallery-lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .gallery-lightbox-close {
    top: 0.5rem;
    right: 0.5rem;
    position: fixed;
  }
}


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

@media (max-width: 768px) {
  .pictures-hero {
    height: 35vh;
    min-height: 280px;
  }

  .gallery-filters {
    gap: 0.4rem;
  }

  .gallery-filter-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }
}

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