/* PermaGlow Lighting — Gallery Page Styles
 * Shared design system with site.css. Gallery-specific additions.
 */

/* ── Page Hero (Gallery variant) ────────────────────── */
.page-hero--gallery {
  min-height: 50vh;
}

/* ── Filter Tabs ────────────────────────────────────── */
.gallery-filter-section {
  background: var(--ivory);
  padding: 0 24px 32px;
}

.gallery-filters {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-filter-btn {
  padding: 10px 22px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 2px solid rgba(18, 36, 34, 0.1);
  border-radius: 100px;
  transition: all var(--transition);
  min-height: 44px; display: flex; align-items: center;
}

.gallery-filter-btn:hover {
  color: var(--ink);
  border-color: rgba(18, 36, 34, 0.2);
}

.gallery-filter-btn.active {
  color: var(--ivory);
  background: var(--ink);
  border-color: var(--ink);
}

/* ── Masonry Grid ───────────────────────────────────── */
.gallery-main {
  background: var(--ivory-dark);
  padding: 40px 24px 80px;
}

.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 200px;
  gap: 16px;
}

.gallery-masonry-item:nth-child(3n+1) .gallery-item-wrap { height: 100%;
  grid-row: span 2;
}
.gallery-masonry-item:nth-child(5n+2) .gallery-item-wrap { height: 100%;
  grid-row: span 1;
}

.gallery-item-wrap { height: 100%;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 300ms ease, box-shadow 300ms ease;
  display: block;
}

.gallery-item-wrap:hover {
  transform: scale(1.015);
  box-shadow: 0 12px 40px rgba(18, 36, 34, 0.2);
}

.gallery-item-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.gallery-item-wrap:hover .gallery-item-img {
  transform: scale(1.05);
}

/* Overlay on hover */
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18, 36, 34, 0.85) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity 300ms ease;
}

.gallery-item-wrap:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-desc {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ivory);
}

/* ── Lightbox ───────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(18, 36, 34, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.lightbox-image-wrap {
  width: 100%;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-info {
  text-align: center;
}

.lightbox-desc {
  font-size: 1rem;
  color: var(--ivory);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ivory);
  border-radius: 50%;
  background: rgba(247, 245, 239, 0.1);
  transition: background var(--transition);
}

.lightbox-close:hover {
  background: rgba(247, 245, 239, 0.2);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ivory);
  background: rgba(247, 245, 239, 0.08);
  border-radius: 50%;
  transition: background var(--transition);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(247, 245, 239, 0.2);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 784px) {
  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 160px;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
}

@media (max-width: 390px) {
  .gallery-masonry {
    grid-template-columns: 1fr;
    grid-auto-rows: 200px;
  }
  .gallery-filters {
    justify-content: center;
  }
}
