.masonry-grid,
.archive-grid{
  display:grid;
  gap:1rem;
}

.masonry-grid{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

.gallery-card,
.archive-item{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--card-bg);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.gallery-card img{
  width:100%;
  aspect-ratio:4 / 5;
  object-fit:cover;
}

.gallery-trigger{
  width:100%;
  border:none;
  background:none;
  color:inherit;
  text-align:left;
  cursor:pointer;
}

.gallery-trigger:focus-visible{
  outline:2px solid var(--text);
  outline-offset:4px;
}

.gallery-copy,
.archive-copy{
  padding:1rem 1.1rem 1.15rem;
}

.gallery-copy strong,
.archive-copy strong{
  display:block;
  margin-bottom:0.35rem;
  font-size:1rem;
}

.gallery-copy span,
.archive-copy span{
  color:var(--muted);
}

.archive-grid{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

.archive-item img{
  width:100%;
  aspect-ratio:16 / 10;
  object-fit:cover;
  background:#eee7db;
}

.archive-meta{
  display:flex;
  gap:0.5rem;
  flex-wrap:wrap;
  margin-top:0.9rem;
}

.gallery-modal{
  position:fixed;
  inset:0;
  z-index:40;
  display:none;
  align-items:center;
  justify-content:center;
  padding:1.25rem;
  background:rgba(17,16,15,0.84);
}

.gallery-modal.is-open{
  display:flex;
}

.gallery-modal-panel{
  width:min(92vw, 1080px);
  max-height:90vh;
  border-radius:var(--radius);
  background:#11100f;
  color:#f7f3ea;
  border:1px solid rgba(255,255,255,0.12);
  overflow:hidden;
  box-shadow:0 24px 80px rgba(0,0,0,0.35);
}

.gallery-modal-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:0.9rem 1rem;
  border-bottom:1px solid rgba(255,255,255,0.12);
}

.gallery-modal-top strong{
  font-size:1rem;
}

.gallery-modal-top span{
  color:rgba(247,243,234,0.74);
  font-size:0.92rem;
}

.gallery-close,
.gallery-nav{
  border:none;
  border-radius:999px;
  cursor:pointer;
  color:#f7f3ea;
  background:rgba(255,255,255,0.1);
}

.gallery-close{
  min-width:2.3rem;
  min-height:2.3rem;
  font-size:1.1rem;
}

.gallery-stage{
  position:relative;
  display:grid;
  place-items:center;
  min-height:clamp(320px, 70vh, 760px);
  background:#0a0908;
}

.gallery-stage img,
.gallery-stage video{
  width:100%;
  height:100%;
  max-height:70vh;
  object-fit:contain;
}

.gallery-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:2.7rem;
  height:2.7rem;
  font-size:1.35rem;
}

.gallery-nav.prev{
  left:1rem;
}

.gallery-nav.next{
  right:1rem;
}

.gallery-caption{
  padding:0.9rem 1rem 1rem;
  color:rgba(247,243,234,0.74);
}

.gallery-caption strong{
  display:block;
  color:#f7f3ea;
  margin-bottom:0.2rem;
}

@media (max-width:820px){
  .masonry-grid,
  .archive-grid{
    grid-template-columns:1fr;
  }
}

@media (max-width:640px){
  .gallery-modal{
    padding:0.75rem;
  }

  .gallery-nav.prev{
    left:0.6rem;
  }

  .gallery-nav.next{
    right:0.6rem;
  }
}
