/* ── Gallery page background ────────────── */
body {
  background:
    radial-gradient(circle at 85% 15%, rgba(80, 95, 82, 0.22), transparent 34%),
    radial-gradient(circle at 15% 85%, rgba(115, 105, 90, 0.18), transparent 40%),
    linear-gradient(180deg, #d5cbbb 0%, #c9bdab 45%, #d8d0c2 100%);
}

/* ── Page ───────────────────────────────── */
.gallery-main {
  min-height: calc(100vh - 52px);
  padding: 0 0 6rem;
}

/* ── Header ─────────────────────────────── */
.gallery-header {
  text-align: center;
  padding: 4rem 2rem 3rem;
}

.gallery-header::after {
  content: '';
  display: block;
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,170,122,0.6), transparent);
  margin: 1.5rem auto 0;
}

.gallery-title {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 300;
  color: var(--text);
  margin: 0 0 1rem;
  line-height: 1.1;
  letter-spacing: 0.04em;
}

.gallery-rule {
  width: 48px;
  height: 1px;
  background: rgba(196, 170, 122, 0.6);
  margin: 0 auto;
}

/* ── Grid ───────────────────────────────── */
.gallery-grid {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* ── Items ───────────────────────────────── */
.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--cream);
  border: 1px solid rgba(196, 170, 122, 0.25);
  border-top: 2px solid rgba(196, 170, 122, 0.55);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}


.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 9px;
  transition: transform 0.45s ease, filter 0.45s ease;
  filter: brightness(0.95);
}

.gallery-item:hover {
  box-shadow:
    0 8px 32px rgba(0,0,0,0.13),
    0 0 0 1px rgba(196,170,122,0.35),
    0 0 24px rgba(196,170,122,0.12);
  transform: translateY(-2px);
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.03);
  filter: brightness(1);
}

/* ── Before/after stack (single grid cell) ── */
.gallery-stack {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(196, 170, 122, 0.25);
  border-top: 2px solid rgba(196, 170, 122, 0.55);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transition: box-shadow 0.35s ease;
}

.gallery-stack__item {
  flex: 1;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  min-height: 0;
}

.gallery-stack__item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center top;
  transition: transform 0.45s ease, filter 0.45s ease;
  filter: brightness(0.95);
}

.gallery-stack__item:hover img {
  transform: scale(1.03);
  filter: brightness(1);
}

/* ── Video brightness ───────────────────── */
.gallery-item--video video {
  filter: brightness(0.78) !important;
}

.gallery-item--video:hover video {
  filter: brightness(0.92) !important;
}

/* ── Corner accent ──────────────────────── */
.gallery-item::before {
  content: '✦';
  position: absolute;
  top: 6px;
  right: 9px;
  font-size: 0.5rem;
  color: rgba(196, 170, 122, 0.5);
  z-index: 2;
  pointer-events: none;
  line-height: 1;
}

/* ── Lightbox ───────────────────────────── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 13, 0.96);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.lightbox.open { display: flex; }

.lightbox-img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 0 60px rgba(0,0,0,0.6);
  border: 1px solid rgba(196,170,122,0.2);
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #c4aa7a;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.lightbox-close:hover { opacity: 1; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 1rem;
    gap: 8px;
  }
  .gallery-title { font-size: 2.2rem; }
}
