/* ============================================
   Schneyder + Quinton — Gallery Stylesheet
   Shared across all 4 category gallery pages
   ============================================ */

:root {
    --cream: #f1ebe0;
    --cream-2: #e8e0d1;
    --ink: #1c1915;
    --ink-soft: #3a342c;
    --bronze: #8a6a3b;
    --bronze-deep: #6b5028;
    --line: #c9bfa9;
    --muted: #6b6355;
  }
  
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Archivo', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ===== TOP NAV BAR ===== */
.gallery-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  padding: 1.4rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(241, 235, 224, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, padding 0.3s ease;
}
.gallery-nav.scrolled {
  border-bottom-color: var(--line);
  padding: 1rem 2rem;
}

.back-link {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  transition: color 0.3s ease, gap 0.3s ease;
}
.back-link .arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}
.back-link:hover {
  color: var(--bronze);
  gap: 1rem;
}
.back-link:hover .arrow {
  transform: translateX(-4px);
}

.gallery-logo {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}
.gallery-logo span {
  color: var(--bronze);
  font-style: italic;
}

/* ===== HERO ===== */
.gallery-hero {
  padding: 10rem 2rem 5rem;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: end;
}
.hero-text { max-width: 48ch; }
.hero-chapter {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 300;
  font-size: 0.95rem;
  color: var(--bronze);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.hero-chapter::before {
  content: "";
  width: 32px; height: 1px;
  background: var(--bronze);
}
.hero-title {
  font-family: 'Fraunces', serif;
  font-weight: 300;
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 1.8rem;
}
.hero-title em {
  font-style: italic;
  color: var(--bronze-deep);
}
.hero-lead {
  font-size: 1.05rem;
  color: var(--ink-soft);
  max-width: 42ch;
  margin-bottom: 2rem;
}
.hero-meta {
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  max-width: 40ch;
}
.hero-feature {
  position: relative;
  aspect-ratio: 4/5;
  overflow: hidden;
  background: var(--cream-2);
}
.hero-feature img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.94);
}
.hero-feature::after {
  content: "";
  position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(28,25,21,0.06);
  pointer-events: none;
}

/* ===== MASONRY GRID ===== */
.masonry-wrap {
  padding: 2rem 2rem 8rem;
  max-width: 1400px;
  margin: 0 auto;
}
.masonry-label {
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bronze-deep);
  margin-bottom: 2.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.masonry-label .count {
  font-family: 'Fraunces', serif;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.masonry {
  columns: 3;
  column-gap: 1rem;
}
@media (max-width: 900px) {
  .masonry { columns: 2; column-gap: 0.7rem; }
}
@media (max-width: 520px) {
  .masonry { columns: 1; }
}
.m-tile {
  break-inside: avoid;
  margin-bottom: 1rem;
  overflow: hidden;
  cursor: zoom-in;
  position: relative;
  background: var(--cream-2);
  display: block;
}
.m-tile img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(0.92);
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1),
              filter 0.4s ease;
}
.m-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(28, 25, 21, 0);
  transition: background 0.4s ease;
  pointer-events: none;
}
.m-tile:hover img {
  transform: scale(1.03);
  filter: saturate(1);
}
.m-tile:hover::after {
  background: rgba(28, 25, 21, 0.08);
}

/* Fade-in on scroll */
.m-tile {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.m-tile.in {
  opacity: 1;
  transform: translateY(0);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(18, 15, 11, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(138, 106, 59, 0.15), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(138, 106, 59, 0.10), transparent 55%);
  pointer-events: none;
}
.lb-image-wrap {
  position: relative;
  max-width: 86vw;
  max-height: 82vh;
  z-index: 1;
}
.lb-image-wrap img {
  max-width: 86vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  background: none;
  border: 1px solid rgba(233, 220, 192, 0.3);
  color: var(--cream);
  cursor: pointer;
  z-index: 2;
  transition: all 0.3s ease;
  font-family: 'Archivo', sans-serif;
}
.lb-close {
  top: 1.5rem;
  right: 1.5rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
}
.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-prev { left: 2rem; }
.lb-next { right: 2rem; }

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  background: var(--bronze-light);
  border-color: var(--bronze-light);
  color: var(--ink);
}
.lb-prev:hover { transform: translate(-4px, -50%); }
.lb-next:hover { transform: translate(4px, -50%); }

.lb-counter {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(241, 235, 224, 0.7);
  letter-spacing: 0.1em;
  z-index: 2;
}

body.lb-open { overflow: hidden; }

/* ===== FOOTER ===== */
footer {
  background: var(--ink);
  color: var(--cream);
  padding: 2rem;
  border-top: 1px solid rgba(233, 220, 192, 0.15);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .gallery-nav { padding: 1rem 1.25rem; }
  .gallery-logo { font-size: 1rem; }
  .gallery-hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 8rem 1.5rem 4rem;
  }
  .hero-feature { aspect-ratio: 4/3; }
  .masonry-wrap { padding: 2rem 1.25rem 5rem; }
  .masonry-label { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .lb-close { top: 1rem; right: 1rem; width: 40px; height: 40px; }
  .lb-prev, .lb-next { width: 44px; height: 44px; }
  .lb-prev { left: 1rem; }
  .lb-next { right: 1rem; }
  .lb-counter { bottom: 1rem; }
}
