/* Gallery Page Specific Styles */

.gallery-hero {
  padding: 60px 0 40px;
  background: linear-gradient(135deg, #f0fdf4 0%, white 100%);
  border-bottom: 1px solid var(--border);
}

.gallery-hero h1 {
  font-size: var(--step-3);
  font-weight: 900;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.gallery-hero .lead {
  font-size: var(--step-0);
  color: var(--text-secondary);
  margin: 0;
  max-width: 680px;
}

/* Gallery Section */
.gallery-section {
  padding: 48px 0 80px;
}

/* Filters */
.gallery-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  appearance: none;
  border: 1.5px solid #bbf7d0;
  background: white;
  color: #15803d;
  padding: 8px 20px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
}

.filter-btn:hover {
  background: #f0fdf4;
  border-color: #86efac;
}

.filter-btn.active {
  background: #15803d;
  color: white;
  border-color: #15803d;
}

.filter-btn:focus-visible {
  outline: 3px solid rgba(21, 128, 61, 0.3);
  outline-offset: 2px;
}

/* Gallery Grid - Simple */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Gallery Items */
.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s ease;
  content-visibility: auto;
  contain-intrinsic-size: 320px 240px;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #86efac;
}

.gallery-item:focus-visible {
  outline: 3px solid rgba(21, 128, 61, 0.3);
  outline-offset: 2px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

/* Video overlay */
.gallery-item.video::after {
  content: "▶";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(21, 128, 61, 0.9);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  padding-left: 4px;
  transition: all 0.2s ease;
}

.gallery-item.video:hover::after {
  background: rgba(21, 128, 61, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Loading Indicator */
.loading-indicator {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 4px solid var(--surface-2);
  border-top-color: #15803d;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.lightbox[hidden] {
  display: none;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 32px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

.lightbox-close {
  top: 20px;
  right: 20px;
}

.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-counter {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: white;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
  }

  .lightbox-counter {
    bottom: 20px;
    font-size: 0.85rem;
  }
}

/* Hidden state */
[hidden] {
  display: none !important;
}
