/* =========================================================
   GALLERY PAGE — masonry-style grid with cinematic overlay
   ========================================================= */

.gallery-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(3rem, 8vw, 6rem) 1rem;
  background: var(--color-bg);
}

.gallery-container {
  max-width: 1400px;
  width: 100%;
  text-align: center;
  padding: 0 var(--gutter);
}

/* Page heading */
.gallery-container h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 300;
  font-style: italic;
  margin: 0 0 0.5rem;
  color: var(--color-accent);
  opacity: 0;
  animation: fadeUp 1s var(--ease-out) 0.1s forwards;
}

.gallery-container .gallery-eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fadeIn 1s var(--ease-out) forwards;
}

.gallery-container h1::after {
  content: "";
  display: block;
  width: 50px;
  height: 1px;
  background: var(--color-text-muted);
  margin: 1.5rem auto 3rem;
}

/* Grid layout — responsive columns */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

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

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

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

/* Gallery items */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--color-surface);
  aspect-ratio: 3 / 4;
  cursor: pointer;
  opacity: 0;
  animation: fadeUp 0.8s var(--ease-out) forwards;
}

/* Staggered entry */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.18s; }
.gallery-item:nth-child(3) { animation-delay: 0.26s; }
.gallery-item:nth-child(4) { animation-delay: 0.34s; }
.gallery-item:nth-child(5) { animation-delay: 0.42s; }
.gallery-item:nth-child(6) { animation-delay: 0.5s; }
.gallery-item:nth-child(7) { animation-delay: 0.58s; }
.gallery-item:nth-child(8) { animation-delay: 0.66s; }
.gallery-item:nth-child(n + 9) { animation-delay: 0.74s; }

/* Dark overlay on hover */
.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 60%,
    rgba(0, 0, 0, 0.55) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

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

/* Subtle frame on hover */
.gallery-item::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0);
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
  transition: border-color var(--transition-base);
}

.gallery-item:hover::before {
  border-color: rgba(255, 255, 255, 0.6);
}

/* Images */
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(15%) brightness(0.9);
  transition: transform 1.2s var(--ease-out), filter var(--transition-base);
}

.gallery-item:hover img {
  transform: scale(1.07);
  filter: grayscale(0) brightness(1);
}
