/* Visor a pantalla completa (js/lightbox.js). Oscuro para los álbumes; claro (.content-lightbox) para la galería de contenido. */
.lb {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 24, .92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: .3s;
  cursor: auto;
  padding: 4vw;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pinch-zoom;
}
.lb * {
  user-select: none;
  -webkit-user-select: none;
}
.lb.on {
  opacity: 1;
  pointer-events: auto;
}
.lb.dragging-down, .lb.dragging-down > img {
  transition: none;
}
.lb-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(20, 19, 24, .55);
  color: #fff;
  font: 18px/1 var(--sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb > img {
  max-width: 100%;
  max-height: calc(100% - 88px);
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 1;
  transform: scale(1);
  transition: opacity .3s ease, transform .36s cubic-bezier(.2, .7, .1, 1);
  user-select: none;
  -webkit-user-drag: none;
}
.lb > img.is-changing {
  opacity: .2;
  transform: scale(.992);
}
.lb > img.is-loading {
  opacity: 0;
  transition: none;
}
.lb:not(.multi) > img {
  max-height: 100%;
}
.lb .lb-count {
  position: absolute;
  bottom: 80px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  opacity: .7;
}
.lb-thumbs {
  position: absolute;
  left: 4vw;
  right: 4vw;
  bottom: 16px;
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  max-height: 56px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.lb-thumbs::-webkit-scrollbar {
  display: none;
}
.lb-thumbs button {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 2px;
  background: rgba(255, 255, 255, .08);
  opacity: .6;
  cursor: pointer;
  transition: opacity .2s, border-color .2s;
}
.lb-thumbs button.on {
  opacity: 1;
  border-color: #fff;
}
.lb-thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lb:not(.multi) .lb-thumbs, .lb:not(.multi) .lb-count {
  display: none;
}

/* variante clara */
.lb.content-lightbox {
  background: var(--bg);
}
.lb.content-lightbox .lb-close {
  border-color: var(--line);
  background: var(--bg);
  color: var(--ink);
}
.lb.content-lightbox .lb-count {
  color: var(--ink);
}
.lb.content-lightbox .lb-thumbs button {
  border-color: var(--line);
  background: var(--bg);
}

@media (max-width: 620px) {
  .lb {
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
  }
  .lb > img {
    max-height: calc(100% - 76px);
  }
  .lb:not(.multi) > img {
    max-height: 100%;
  }
  .lb .lb-count {
    bottom: 72px;
    font-size: 13px;
  }
  .lb-thumbs {
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-height: 48px;
  }
  .lb-thumbs button {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }
}
