/* ===================================
   Gallery Page Specific Styles
   =================================== */

/* Page Header */
.page-header {
  background: linear-gradient(135deg, rgba(25, 118, 165, 0.9), rgba(38, 50, 56, 0.8)),
    url("/placeholder.svg?height=400&width=1920") center / cover;
  color: var(--surface);
  text-align: center;
  padding: var(--space-8) 0 var(--space-6);
}

.page-header__title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.page-header__subtitle {
  font-size: 1.125rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .page-header__title {
    font-size: 3rem;
  }
}

/* Gallery Filters */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-4);
}

.gallery-filters__button {
  padding: var(--space-2) var(--space-3);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

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

.gallery-filters__button.active {
  background: var(--accent);
  color: var(--surface);
  border-color: var(--accent);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

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

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

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px var(--shadow-lg);
}

.gallery-item__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover .gallery-item__image {
  transform: scale(1.05);
}

.gallery-item__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: var(--surface);
  padding: var(--space-3);
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.gallery-item:hover .gallery-item__overlay {
  transform: translateY(0);
}

.gallery-item__title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.gallery-item__category {
  font-size: 0.875rem;
  opacity: 0.9;
}

/* Lightbox - Allow scrolling on mobile while preventing body scroll on desktop */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Enable scrolling within lightbox on mobile */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox__content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Add padding for mobile scrolling */
  padding: var(--space-8) var(--space-2);
}

/* Ensure image is scrollable on mobile */
@media (max-width: 768px) {
  .lightbox__content {
    max-height: none;
    min-height: 100vh;
    padding: var(--space-10) var(--space-2);
  }

  .lightbox__image {
    max-height: none;
    height: auto;
  }
}

.lightbox__image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__close {
  position: fixed;
  top: var(--space-2);
  right: var(--space-2);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: opacity var(--transition-fast);
  z-index: 3001;
}

.lightbox__close:hover {
  opacity: 0.8;
}

.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  transition: opacity var(--transition-fast);
  z-index: 3001;
}

.lightbox__nav:hover {
  opacity: 0.8;
}

.lightbox__nav--prev {
  left: var(--space-2);
}

.lightbox__nav--next {
  right: var(--space-2);
}

.lightbox__info {
  position: fixed;
  bottom: var(--space-2);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text);
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
  text-align: center;
  z-index: 3001;
}

.lightbox__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.lightbox__category {
  font-size: 0.875rem;
  color: var(--muted);
}
