/* ============================================
   PEAK LIGHT STUDIO — Gallery Page Styles
   ============================================ */

/* ---- Filter Section ---- */
.gallery-filter-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-stone);
  position: sticky;
  top: 76px;
  z-index: 100;
}

.gallery-filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  flex-wrap: wrap;
}

.gallery-filters::-webkit-scrollbar { display: none; }

.filter-btn {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--color-sand);
  border-radius: 100px;
  background: transparent;
  color: var(--color-warm-gray);
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

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

.filter-btn.active {
  background: var(--color-charcoal);
  border-color: var(--color-charcoal);
  color: var(--color-ivory);
}

/* ---- Gallery Grid ---- */
.gallery-grid {
  columns: 3;
  column-gap: 1rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 1rem;
  break-inside: avoid;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

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

.gallery-item img {
  width: 100%;
  display: block;
  transition: transform 0.6s ease;
}

.gallery-item-tall img {
  /* Natural tall images look good in masonry */
}

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

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(28,26,24,0.8) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
}

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

.gallery-item-title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--color-ivory);
  display: block;
  margin-bottom: 0.25rem;
}

.gallery-item-tag {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-bronze);
  display: block;
}

.gallery-item-expand {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: rgba(248, 246, 242, 0.15);
  border: 1px solid rgba(248, 246, 242, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-ivory);
  backdrop-filter: blur(4px);
}

/* Empty state */
.gallery-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-warm-gray);
  font-style: italic;
}

/* ---- Lightbox ---- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 24, 0.92);
  z-index: 2000;
  display: none;
}

.lightbox-overlay.visible {
  display: block;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.visible {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 1100px;
  max-height: 90vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-strong);
}

.lightbox-caption {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 300;
  color: var(--color-taupe);
  margin-top: 1rem;
  letter-spacing: 0.03em;
  text-align: center;
}

.lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  font-size: 2rem;
  color: var(--color-taupe);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  z-index: 2200;
  transition: color var(--transition-base);
}

.lightbox-close:hover {
  color: var(--color-ivory);
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  color: var(--color-taupe);
  background: rgba(248, 246, 242, 0.08);
  border: 1px solid rgba(248, 246, 242, 0.15);
  border-radius: 50%;
  width: 52px;
  height: 52px;
  cursor: pointer;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
}

.lightbox-prev { left: 1.5rem; }
.lightbox-next { right: 1.5rem; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(248, 246, 242, 0.15);
  color: var(--color-ivory);
}

@media (max-width: 768px) {
  .gallery-grid { columns: 2; }
}

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