/* ============================================================
   SUSAN WEAVER FINE ART — Gallery Styles
   gallery.css: gallery grid, filter tabs, lightbox
   ============================================================ */

/* ============================================================
   GALLERY FILTER TABS
   ============================================================ */
.gallery-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-xl);
}

.gallery-filter__btn {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-warm-brown);
  background-color: transparent;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: all var(--transition);
}

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

.gallery-filter__btn.active {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-white);
}

/* ============================================================
   GALLERY GRID
   ============================================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  background-color: var(--color-surface);
  transition: box-shadow var(--transition);
}

.gallery-item:hover {
  box-shadow: var(--shadow-lg);
}

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

/* Image inside gallery item */
.gallery-item figure {
  margin: 0;
  position: relative;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

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

/* Caption overlay — slides up on hover */
.gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(61,43,31,0.90) 0%, transparent 100%);
  color: var(--color-white);
  padding: var(--space-md) var(--space-sm) var(--space-sm);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

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

.gallery-item figcaption h3 {
  font-size: var(--text-base);
  color: var(--color-white);
  margin-bottom: 2px;
}

.gallery-item figcaption p {
  font-size: var(--text-xs);
  color: var(--color-tan);
  margin: 0;
  font-style: italic;
}

/* Category badge on gallery item */
.gallery-item__badge {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  z-index: 1;
}

.gallery-item__badge--wildlife {
  background-color: rgba(74, 103, 65, 0.85);
  color: var(--color-white);
}

.gallery-item__badge--portrait {
  background-color: rgba(193, 98, 63, 0.85);
  color: var(--color-white);
}

.gallery-item__badge--felted {
  background-color: rgba(90, 115, 140, 0.85);
  color: var(--color-white);
}

/* Zoom / view icon on hover */
.gallery-item__zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  width: 52px;
  height: 52px;
  background-color: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-espresso);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.gallery-item:hover .gallery-item__zoom {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: var(--color-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  animation: lightboxFadeIn 0.25s ease;
}

.lightbox[hidden] {
  display: none;
}

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

.lightbox__figure {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  display: block;
}

.lightbox__caption {
  color: var(--color-parchment);
  font-size: var(--text-sm);
  font-style: italic;
  text-align: center;
  margin-top: var(--space-sm);
  max-width: 600px;
}

/* Close button */
.lightbox__close {
  position: fixed;
  top: var(--space-md);
  right: var(--space-md);
  width: 44px;
  height: 44px;
  background-color: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--color-white);
  font-size: 1.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
  line-height: 1;
}

.lightbox__close:hover {
  background-color: rgba(255,255,255,0.3);
}

/* Prev / Next buttons */
.lightbox__prev,
.lightbox__next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background-color: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--color-white);
  font-size: 1.25rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition);
}

.lightbox__prev {
  left: var(--space-md);
}

.lightbox__next {
  right: var(--space-md);
}

.lightbox__prev:hover,
.lightbox__next:hover {
  background-color: rgba(255,255,255,0.3);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .lightbox__prev { left: var(--space-xs); }
  .lightbox__next { right: var(--space-xs); }
}
