/* ===== Visor superpuesto / Quick Look ===== */

.insta-slide img{
  cursor:zoom-in;
}

.photo-lightbox{
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:max(18px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(18px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));
  background:rgba(7,7,8,.965);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .18s ease,visibility .18s ease;
  -webkit-backdrop-filter:blur(14px);
  backdrop-filter:blur(14px);
}

.photo-lightbox.open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.photo-lightbox-stage{
  position:relative;
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
}

.quicklook-media-host{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  min-height:0;
}

.photo-lightbox-image{
  display:block;
  max-width:min(94vw,1800px);
  max-height:90vh;
  width:auto;
  height:auto;
  object-fit:contain;
  user-select:none;
  -webkit-user-drag:none;
  cursor:default;
  opacity:1;
  transition:opacity .12s ease;
}

.photo-lightbox-image.changing{
  opacity:.2;
}

.photo-lightbox-close,
.photo-lightbox-nav{
  position:absolute;
  z-index:3;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(25,25,28,.42);
  color:rgba(255,255,255,.76);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  cursor:pointer;
  transition:opacity .16s ease,background .16s ease,border-color .16s ease;
}

.photo-lightbox-close:hover,
.photo-lightbox-nav:hover:not(:disabled){
  color:#fff;
  background:rgba(40,40,44,.72);
  border-color:rgba(255,255,255,.18);
}

.photo-lightbox-close{
  top:4px;
  right:4px;
  width:38px;
  height:38px;
  border-radius:50%;
  font-size:22px;
  line-height:1;
}

.photo-lightbox-nav{
  top:50%;
  width:42px;
  height:42px;
  border-radius:50%;
  transform:translateY(-50%);
  font-size:0;
}

.photo-lightbox-nav.previous{left:4px}
.photo-lightbox-nav.next{right:4px}

.photo-lightbox-nav::before{
  content:"";
  display:block;
  width:14px;
  height:14px;
  flex:0 0 14px;
  background:currentColor;
  -webkit-mask-position:center;
  -webkit-mask-repeat:no-repeat;
  -webkit-mask-size:14px 14px;
  mask-position:center;
  mask-repeat:no-repeat;
  mask-size:14px 14px;
}

.photo-lightbox-nav.previous::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M7.5 2.25 3.75 6l3.75 3.75' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M7.5 2.25 3.75 6l3.75 3.75' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.photo-lightbox-nav.next::before{
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 2.25 3.75 3.75L4.5 9.75' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m4.5 2.25 3.75 3.75L4.5 9.75' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.photo-lightbox-nav:disabled{
  opacity:0;
  pointer-events:none;
}

.photo-lightbox-meta{
  position:absolute;
  left:50%;
  bottom:4px;
  z-index:3;
  transform:translateX(-50%);
  display:flex;
  align-items:center;
  gap:10px;
  max-width:70vw;
  padding:7px 11px;
  border-radius:999px;
  background:rgba(20,20,22,.42);
  color:rgba(255,255,255,.58);
  font-size:11px;
  letter-spacing:.04em;
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  white-space:nowrap;
}

.photo-lightbox-title{
  overflow:hidden;
  text-overflow:ellipsis;
}

.photo-lightbox-counter{
  color:rgba(255,255,255,.38);
}

/* Quick Look para vídeo, YouTube, audio y canal. */
.quicklook-video,
.quicklook-youtube{
  display:block;
  width:min(88vw,1500px);
  max-width:88vw;
  height:min(82vh,900px);
  max-height:82vh;
  border:0;
  border-radius:14px;
  background:#000;
  box-shadow:0 24px 80px rgba(0,0,0,.42);
}

.quicklook-video{
  object-fit:contain;
}

.quicklook-youtube{
  aspect-ratio:16/9;
  height:auto;
}

.quicklook-audio{
  width:min(560px,82vw);
  padding:34px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:22px;
  background:rgba(28,28,31,.9);
  box-shadow:0 24px 80px rgba(0,0,0,.35);
  display:grid;
  justify-items:center;
  gap:18px;
}

.quicklook-audio-icon{
  width:92px;
  height:92px;
  border-radius:22px;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.055);
  font-size:42px;
}

.quicklook-audio strong{
  font-size:22px;
  text-align:center;
}

.quicklook-audio audio{
  width:100%;
}

.quicklook-channel{
  width:min(900px,84vw);
  display:grid;
  gap:16px;
  padding:18px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:22px;
  background:rgba(24,24,27,.9);
  color:#fff;
  text-decoration:none;
  box-shadow:0 24px 80px rgba(0,0,0,.35);
}

.quicklook-channel-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.quicklook-channel-grid img{
  width:100%;
  aspect-ratio:16/9;
  object-fit:cover;
  border-radius:10px;
}

.quicklook-channel strong{
  font-size:24px;
}

.quicklook-channel span{
  color:rgba(255,255,255,.55);
}

body.lightbox-open{
  overflow:hidden !important;
}

@media (max-width:820px){
  .photo-lightbox{
    padding:max(12px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));
  }

  .photo-lightbox-image{
    max-width:96vw;
    max-height:86svh;
  }

  .photo-lightbox-nav{
    width:38px;
    height:38px;
    background:rgba(20,20,22,.3);
  }

  .photo-lightbox-nav.previous{left:0}
  .photo-lightbox-nav.next{right:0}

  .photo-lightbox-close{
    top:0;
    right:0;
  }

  .photo-lightbox-meta{
    max-width:84vw;
    bottom:0;
  }

  .quicklook-video,
  .quicklook-youtube{
    max-width:96vw;
    width:96vw;
    max-height:82svh;
  }
}
