#gallery {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

#gallery h1 {
    width: 100%;
    padding-top: 5rem;
    text-align: center;
    filter:
        drop-shadow(4px 4px 0 rgba(119, 119, 119, 0.7))  
}

.gallery-photos{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  grid-auto-rows: 16rem;
  gap: clamp(.4rem,.8vw,.7rem);
  grid-auto-flow: dense;
  width: 100%;
  margin-inline: auto;
  justify-items: stretch;
  align-items: stretch;
}

.tile{
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  background: #111;
  outline: 1px solid rgba(255,255,255,.04);
  outline-offset: -1px;
  transition: transform .25s ease, box-shadow .25s ease, outline-color .25s ease;
  cursor: zoom-in;
  aspect-ratio: 4/3;
}

.tile.w2{
  grid-column: span 2;
  aspect-ratio: 16/10;
}
.tile.h2{
  grid-row: span 2;
  aspect-ratio: 3/4;
}
.tile.w2.h2{
  aspect-ratio: 5/4;
}

@media (max-width: 1200px){
  .gallery-photos{
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 14rem;
  }
}
@media (max-width: 800px){
  .gallery-photos{
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    grid-auto-rows: 12rem;
  }
}
@media (max-width: 600px){
  .gallery-photos{
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 11rem;
  }
}

.tile img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform .35s ease, filter .35s ease;
  filter: saturate(96%) contrast(102%);
}

.tile::after{
  content:"";
  position:absolute; inset:0;
  background: radial-gradient(60% 40% at 50% 20%, rgba(177,43,43,.18), transparent 70%);
  opacity: 0;
  transition: opacity .35s ease;
  mix-blend-mode: screen;
}

.tile:hover{
  transform: translateY(-3px);
  box-shadow: 0 18px 26px rgba(0,0,0,.38), 0 8px 14px rgba(0,0,0,.28);
  outline-color: rgba(255,255,255,.08);
}
.tile:hover img{ transform: scale(1.055); filter: saturate(105%) contrast(105%); }
.tile:hover::after{ opacity: .85; }

.tile figcaption{ display: none; }

.lightbox{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 10000;
}
.lightbox.open{
  opacity: 1;
  pointer-events: auto;
}
.lb-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.8);
}

.lb-stage{
  position: relative;
  display: grid;
  gap: .75rem;
  z-index: 1;
  max-width: 92vw;
  max-height: 92vh;
}

.lb-img{
  width: auto;
  height: auto;
  max-width: 88vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 12px;
  background: #0c0c0c;
  outline: 1px solid rgba(255,255,255,.06);
  outline-offset: -1px;
  box-shadow: 0 18px 28px rgba(0,0,0,.5);
}


.lightbox.portrait .lb-stage{ max-width: min(76vw, 860px); }
.lightbox.portrait .lb-img{ max-width: 72vw; max-height: 88vh; }


.lightbox.landscape .lb-stage{ max-width: min(92vw, 1400px); }
.lightbox.landscape .lb-img{ max-width: 90vw; max-height: 80vh; }

.lb-caption{
  margin: 0;
  text-align: center;
  font-size: 1rem;
  color: #d6d6d6;
  letter-spacing: .02em;
}

.lb-close{
  position: absolute;
  top: clamp(.5rem,2vw,1rem);
  right: clamp(.5rem,2vw,1rem);
  z-index: 2;
  width: 42px; height: 42px;
  border: 0; border-radius: 50%;
  background: rgba(11,11,11,.75);
  color: var(--main-light);
  font-size: 28px; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .2s ease, background-color .2s ease;
}
.lb-close:hover{ transform: scale(1.06); background: rgba(11,11,11,.9); }