.tl-lightbox{
  position: fixed;
  inset: 0;
  display: none;
z-index: 99999999999;
}
.tl-lightbox.is-open{ display: block; }

.tl-lightbox__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.78);
}

.tl-lightbox__panel{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.tl-lightbox__viewport{
  width: min(1200px, 92vw);
  height: 88vh;
  overflow: hidden;
  border-radius: 12px;
  touch-action: pan-y;
  z-index: 999;
}

.tl-lightbox__track{
  height: 100%;
  display: flex;
  transform: translate3d(0,0,0);
  will-change: transform;
  transition: transform .25s ease;
}

.tl-lightbox__slide{
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.tl-lightbox__slide img,
.tl-lightbox__slide video{
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Loading overlay inside viewport */
.tl-lb-loading{
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  z-index: 2;
}
.tl-lb-loading.is-on{ display: flex; }
.tl-lb-spinner{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 4px solid rgba(255,255,255,.25);
  border-top-color: rgba(255,255,255,.95);
  animation: tlSpin .9s linear infinite;
}
@keyframes tlSpin { to { transform: rotate(360deg); } }

/* Buttons */
.tl-lightbox__btn{
  position: absolute;
  top: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  z-index: 3;
}
.tl-lightbox__close { 
    position: absolute;
    width: 3rem;
    height: 3rem;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    right: 2rem;
    font-size: 0;
    background: transparent;
}

.tl-lightbox__close::before {
    transform: rotate(45deg);
}

.tl-lightbox__close::before,
.tl-lightbox__close::after {
    content: "";
    width: 100%;
    position: absolute;
    left: 0;
    top: 50%;
    transform-origin: center;
    border-top: 1px solid #fff;
}

.tl-lightbox__close::after {
    transform: rotate(-45deg);
}

.tl-lightbox__prev,
.tl-lightbox__next{
  top: 50%;
  transform: translateY(-50%);
  font-size: 46px;
  width: 54px;
  height: 54px;
}
.tl-lightbox__prev{ 
    left: 30px;
    border-right: 1px solid #fff;
    transform: rotate(135deg);
    background: transparent;
    font-size: 0;
    border-radius: 0;
    border-bottom: 1px solid #fff;
    height: 35px;
    width: 35px;
}

.tl-lightbox__next{ 
    right: 30px;
    border-right: 1px solid #fff;
    transform: rotate(-45deg);
    background: transparent;
    font-size: 0;
    border-radius: 0;
    border-bottom: 1px solid #fff;
    height: 35px;
    width: 35px; 
}

@media (max-width: 640px){
  .tl-lightbox__panel{ padding: 14px; }
  .tl-lightbox__viewport{ width: 94vw; height: 84vh; }
  .tl-lightbox__prev, .tl-lightbox__next{ width: 46px; height: 46px; font-size: 40px; }
}