.llb[hidden] { display: none !important; }

.llb {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  grid-template-columns: minmax(3rem, 1fr) minmax(0, auto) minmax(3rem, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgb(0 0 0 / 0.9);
}

.llb-open { overflow: hidden; }

.llb__figure {
  grid-column: 2;
  margin: 0;
  max-width: min(90vw, 1600px);
  max-height: 92vh;
  text-align: center;
}

.llb__image {
  display: block;
  max-width: 100%;
  max-height: 84vh;
  width: auto;
  height: auto;
  margin: auto;
  object-fit: contain;
  box-shadow: 0 1rem 4rem rgb(0 0 0 / 0.35);
}

.llb__caption {
  margin-top: .75rem;
  color: #fff;
  font: 400 .95rem/1.4 system-ui, sans-serif;
}

.llb button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  width: 3rem;
  height: 3rem;
  padding: 0;
  color: #fff;
  background: rgb(0 0 0 / 0.35);
  cursor: pointer;
  font: 300 2rem/1 system-ui, sans-serif;
}

.llb button:hover,
.llb button:focus-visible { background: rgb(255 255 255 / 0.18); }
.llb button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.llb__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.llb__prev { justify-self: end; }
.llb__next { justify-self: start; }

@media (max-width: 700px) {
  .llb {
    grid-template-columns: 3rem minmax(0, 1fr) 3rem;
    gap: .25rem;
    padding: .75rem;
  }

  .llb__figure { max-width: 100%; }
  .llb__image { max-height: 78vh; }
}

@media (prefers-reduced-motion: no-preference) {
  .llb:not([hidden]) .llb__image { animation: llb-in .16s ease-out; }
  @keyframes llb-in { from { opacity: 0; transform: scale(.985); } }
}
