/* ViaLabels Reddit-style Image Gallery & Lightbox */
.vl-gallery-wrap {
  position: relative;
  width: 100%;
  margin: 8px auto 18px;
  border-radius: 14px;
  overflow: hidden;
  background: #12151a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  outline: none;
}

.vl-gallery-stage {
  position: relative;
  width: 100%;
  height: 620px;
  max-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0f1217;
  cursor: zoom-in;
}

.vl-gallery-blur-bg {
  position: absolute;
  inset: -24px;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.42) saturate(1.1);
  transform: scale(1.15);
  pointer-events: none;
  transition: background-image 0.25s ease;
}

.md-div .vl-gallery-img,
.vl-gallery-wrap .vl-gallery-img {
  position: relative;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block;
  transition: opacity 0.18s ease;
}

.vl-gallery-counter {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: rgba(15, 20, 25, 0.72);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  letter-spacing: 0.3px;
  pointer-events: none;
}

.vl-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 20, 25, 0.68);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.vl-gallery-nav:hover {
  background: rgba(15, 20, 25, 0.9);
  transform: translateY(-50%) scale(1.06);
}

.vl-gallery-nav:disabled {
  opacity: 0.28;
  cursor: default;
  transform: translateY(-50%);
}

.vl-gallery-prev {
  left: 12px;
}

.vl-gallery-next {
  right: 12px;
}

.vl-gallery-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 20, 25, 0.65);
  backdrop-filter: blur(6px);
  max-width: calc(100% - 32px);
  overflow-x: auto;
  scrollbar-width: none;
}

.vl-gallery-dots::-webkit-scrollbar {
  display: none;
}

.vl-gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  padding: 0;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: width 0.18s ease, background 0.18s ease;
}

.vl-gallery-dot.is-active {
  width: 18px;
  background: #ffffff;
}

/* Single-image post cleanup */
.vl-single-img-wrap {
  margin: 8px auto 18px;
  border-radius: 12px;
  overflow: hidden;
  background: #12151a;
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 600px;
  cursor: zoom-in;
}

.md-div .vl-single-img-wrap img,
.vl-single-img-wrap img {
  max-width: 100% !important;
  max-height: 620px !important;
  width: auto;
  height: auto;
  object-fit: contain !important;
  display: block;
}

/* Fullscreen Lightbox */
.vl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(7, 10, 14, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.vl-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.vl-lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 100000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vl-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.vl-lightbox-counter {
  position: fixed;
  top: 22px;
  left: 24px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 999px;
}

@media (max-width: 768px) {
  .vl-gallery-stage {
    height: 380px;
  }
  .vl-gallery-nav {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}

/* Reddit-style Inline Video Player */
.vl-video-wrap {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 10px 0 14px;
  border-radius: 14px;
  overflow: hidden;
  background: #0f1217;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vl-video-player {
  width: 100%;
  max-height: 540px;
  display: block;
  object-fit: contain;
  background: #0f1217;
}
