/* ============================================
   THE GALLERY PAGE — ZINE EDITION
   ============================================ */

/* ---------- PAGE HERO ---------- */
.gallery-hero {
  padding: 10rem 0 4rem;
  border-bottom: 4px solid #1a1a1a;
}

.gallery-hero__headline {
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  font-weight: 400;
  font-size: clamp(3.5rem, 10vw, 7rem);
  text-transform: uppercase;
  letter-spacing: -0.01em;
  color: #1a1a1a;
  line-height: 0.9;
  margin-bottom: 1rem;
  text-shadow: 3px 3px 0 #ffd000;
}

.gallery-hero__sub {
  font-family: 'Space Mono', monospace;
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: #1a1a1a;
  max-width: 560px;
  line-height: 1.6;
  border-left: 4px solid #e63946;
  padding-left: 1rem;
}

/* ---------- INTRO ---------- */
.gallery-intro {
  padding: 4rem 0;
  border-bottom: 4px solid #1a1a1a;
}

.gallery-intro__text {
  font-family: 'Space Mono', monospace;
  font-size: clamp(0.95rem, 1.8vw, 1.05rem);
  line-height: 1.8;
  color: #1a1a1a;
  max-width: 700px;
  border-left: 4px solid #ffd000;
  padding-left: 1.5rem;
}

/* ---------- GALLERY GRID ---------- */
.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.gallery__piece {
  margin: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery__piece:nth-child(6n+1) { transform: rotate(-1.2deg); }
.gallery__piece:nth-child(6n+2) { transform: rotate(0.8deg); }
.gallery__piece:nth-child(6n+3) { transform: rotate(-0.5deg); }
.gallery__piece:nth-child(6n+4) { transform: rotate(1deg); }
.gallery__piece:nth-child(6n+5) { transform: rotate(-0.7deg); }
.gallery__piece:nth-child(6n+6) { transform: rotate(1.3deg); }

.gallery__piece--wide {
  grid-column: span 2;
}

.gallery__piece:hover,
.gallery__piece:focus-visible {
  transform: rotate(0deg) translate(-3px, -4px);
  z-index: 2;
}

.gallery__piece:focus-visible {
  outline: none;
}

/* ---------- FRAME ---------- */
.gallery__frame {
  background: #f0ebe1;
  padding: 0.6rem;
  border: 3px solid #1a1a1a;
  box-shadow: 6px 6px 0 #1a1a1a;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  transition: box-shadow 0.2s ease;
}

.gallery__piece--wide .gallery__frame {
  aspect-ratio: 2 / 1;
}

.gallery__piece:hover .gallery__frame,
.gallery__piece:focus-visible .gallery__frame {
  box-shadow: 8px 8px 0 #e63946;
}

.gallery__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.05) saturate(0.9);
  transition: transform 0.4s ease;
}

.gallery__piece:hover .gallery__frame img {
  transform: scale(1.04);
}

/* ---------- CAPTION ---------- */
.gallery__caption {
  display: flex;
  flex-direction: column;
  margin-top: 0.6rem;
  padding-left: 0.25rem;
}

.gallery__piece-title {
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  font-weight: 400;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #1a1a1a;
  line-height: 1.1;
}

.gallery__piece-artist {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: #888;
  margin-top: 0.1rem;
}

/* ============================================
   LIGHTBOX OVERLAY
   ============================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(26, 26, 26, 0.97);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox.is-active {
  display: flex;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border: 4px solid #f0ebe1;
  box-shadow: 0 0 80px rgba(230, 57, 70, 0.2);
}

.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: #ffd000;
  border: 3px solid #1a1a1a;
  color: #1a1a1a;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.6rem;
  z-index: 2001;
  transition: background 0.15s ease;
}

.lightbox__close:hover {
  background: #e63946;
  color: #f0ebe1;
}

.lightbox__prev,
.lightbox__next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #ffd000;
  border: 3px solid #1a1a1a;
  color: #1a1a1a;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  z-index: 2001;
  transition: background 0.15s ease;
}

.lightbox__prev {
  left: 1rem;
}

.lightbox__next {
  right: 1rem;
}

.lightbox__prev:hover,
.lightbox__next:hover {
  background: #e63946;
  color: #f0ebe1;
}

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

  .gallery__piece--wide {
    grid-column: span 2;
  }
}

@media (max-width: 600px) {
  .gallery-hero {
    padding: 8rem 0 3rem;
  }

  .gallery-intro {
    padding: 3rem 0;
  }

  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .gallery__piece--wide {
    grid-column: span 1;
  }

  .gallery__piece--wide .gallery__frame {
    aspect-ratio: 1 / 1;
  }

  .gallery__frame {
    box-shadow: 4px 4px 0 #1a1a1a;
    padding: 0.4rem;
  }

  .gallery__piece:hover .gallery__frame,
  .gallery__piece:focus-visible .gallery__frame {
    box-shadow: 6px 6px 0 #e63946;
  }

  .lightbox__prev,
  .lightbox__next {
    font-size: 1.5rem;
    padding: 0.4rem 0.75rem;
  }
}
