
body.menu-open,
body.lightbox-open{
  overflow:hidden;
}

.lightbox{
  position:fixed;
  z-index:1000;
  inset:0;
  display:none;
  color:#f4f1e9;
}

.lightbox.is-open{
  display:block;
}

.lightbox__backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,15,13,.94);
  backdrop-filter:blur(10px);
}

.lightbox__panel{
  position:relative;
  width:100%;
  height:100%;
  display:grid;
  grid-template-columns:88px minmax(0,1fr) 88px;
  align-items:center;
  padding:60px 28px 34px;
}

.lightbox__figure{
  position:relative;
  width:100%;
  height:100%;
  margin:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:16px;
}

.lightbox__image{
  display:block;
  width:auto;
  max-width:min(84vw,1800px);
  max-height:calc(100vh - 145px);
  object-fit:contain;
  opacity:0;
  transform:scale(.985);
  transition:opacity .25s ease,transform .3s ease;
}

.lightbox__image.is-loaded{
  opacity:1;
  transform:none;
}

.lightbox__caption{
  min-height:1.8em;
  color:rgba(244,241,233,.78);
  font-size:12px;
  letter-spacing:.05em;
  text-align:center;
}

.lightbox__close,
.lightbox__nav{
  border:0;
  background:transparent;
  color:inherit;
  cursor:pointer;
}

.lightbox__close{
  position:absolute;
  top:20px;
  right:24px;
  z-index:2;
  width:44px;
  height:44px;
  font-size:32px;
  font-weight:200;
  line-height:1;
}

.lightbox__nav{
  width:56px;
  height:56px;
  justify-self:center;
  border:1px solid rgba(244,241,233,.25);
  border-radius:50%;
  font-size:22px;
  transition:background .2s ease,border-color .2s ease;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible{
  background:rgba(244,241,233,.1);
  border-color:rgba(244,241,233,.7);
}

.lightbox__counter{
  position:absolute;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  margin:0;
  color:rgba(244,241,233,.62);
  font-size:10px;
  letter-spacing:.18em;
}

.lightbox__loader{
  position:absolute;
  top:50%;
  left:50%;
  width:32px;
  height:32px;
  margin:-16px 0 0 -16px;
  border:1px solid rgba(244,241,233,.3);
  border-top-color:#f4f1e9;
  border-radius:50%;
  opacity:0;
  animation:lightbox-spin .8s linear infinite;
}

.lightbox__loader.is-visible{
  opacity:1;
}

.lightbox-link{
  display:block;
  cursor:zoom-in;
}

@keyframes lightbox-spin{
  to{transform:rotate(360deg)}
}

@media(max-width:760px){
  .lightbox__panel{
    grid-template-columns:48px minmax(0,1fr) 48px;
    padding:58px 8px 32px;
  }

  .lightbox__image{
    max-width:calc(100vw - 32px);
    max-height:calc(100svh - 132px);
  }

  .lightbox__nav{
    width:38px;
    height:38px;
    font-size:17px;
    border-color:rgba(244,241,233,.18);
  }

  .lightbox__close{
    top:9px;
    right:10px;
  }

  .lightbox__caption{
    padding-inline:20px;
    font-size:11px;
  }
}

@media(prefers-reduced-motion:reduce){
  .lightbox__image{
    transition:none;
  }

  .lightbox__loader{
    animation:none;
  }
}
