/* ==================================================================
   Photo gallery page
   ================================================================== */
.gallery-main { padding-block: 0 4rem; }
#gallery-status:empty { display: none; }

/* Before the photos arrive */
.gallery-empty {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--ink-2);
  max-width: 40rem;
}
.gallery-empty::before, .gallery-empty::after { content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--corner); pointer-events: none; }
.gallery-empty::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.gallery-empty::after { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.gallery-empty-title { font-family: var(--font-serif); font-weight: 500; color: var(--ink); font-size: 1.45rem; line-height: 1.2; }
.gallery-empty p:last-child { margin-bottom: 0; }

/* The grid */
.gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.gallery-grid li { margin: 0; }
.gallery-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--hair);
  background: var(--paper-2);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  transition: border-color .3s var(--ease), transform .5s var(--ease);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--ease), opacity .6s var(--ease); opacity: .92; }
.gallery-item:hover { border-color: var(--hair-hover); transform: translateY(-3px); }
.gallery-item:hover img { transform: scale(1.03); opacity: 1; }
.gallery-item:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgb(17 17 17 / .94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.lightbox-figure { margin: 0; max-width: min(100%, 1200px); max-height: 100%; text-align: center; }
.lightbox-figure img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; border-radius: var(--radius-sm); background: #000; }
.lightbox-figure figcaption { font-family: var(--font-serif); color: var(--ink-2); margin-top: 0.85rem; font-size: 1.1rem; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgb(17 17 17 / .08);
  color: var(--ink);
  border: 1px solid var(--hair-hover);
  border-radius: 999px;
  width: 2.75rem;
  height: 2.75rem;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .3s var(--ease), color .3s var(--ease), background-color .3s var(--ease);
}
.lightbox-close { top: 1rem; right: 1rem; }
.lightbox-close:hover, .lightbox-nav:hover { border-color: var(--champagne); color: var(--champagne); background: rgb(17 17 17 / .14); }
.lightbox-nav { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }
.lightbox-close:focus-visible, .lightbox-nav:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .gallery-item, .gallery-item img, .lightbox-close, .lightbox-nav { transition: none; } }
