/* Gallery Page Specific Styles */

.gallery-section {
  padding: 48px 0 80px;
}

/* Filters */
.gallery-filters {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.filter-btn {
  appearance: none;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  padding: 12px 20px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 44px;
  min-height: 44px;
  letter-spacing: 0.02em;
}

.filter-btn:hover {
  color: var(--text);
}

.filter-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.filter-btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: -3px;
}

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

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

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

/* Gallery Items */
.gallery-item {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  transition: none;
  border: none;
  border-radius: 0;
}

.gallery-item:hover {
  transform: none;
  box-shadow: none;
  border-color: transparent;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: -3px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Video overlay */
.gallery-item.video::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 16px 0 16px 28px;
  border-color: transparent transparent transparent rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: all 0.2s ease;
}

.gallery-item.video:hover::after {
  border-color: transparent transparent transparent var(--accent);
}

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

.spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 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;
}

.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;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: white;
  font-size: 28px;
  width: 48px;
  height: 48px;
  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.15);
}

.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%);
}

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

.lightbox-counter {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 20px;
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  letter-spacing: 0.04em;
}

/* 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: var(--text-xs);
  }
}

[hidden] {
  display: none !important;
}
