/* ELK-Desa Shared Media Viewer / Lightbox */
.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 11, 20, 0.94);
  opacity: 0;
  transition: opacity 0.25s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.media-viewer.is-open {
  display: flex;
  opacity: 1;
}
.media-viewer.is-closing {
  opacity: 0;
}
.media-viewer__backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.media-viewer__stage {
  position: relative;
  z-index: 2;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: media-viewer-fade 0.25s ease;
}
.media-viewer__stage img,
.media-viewer__stage video {
  max-width: 96vw;
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  object-fit: contain;
  background: #000;
}
.media-viewer__stage iframe {
  width: 82vw;
  max-width: 960px;
  height: 54vw;
  max-height: 62vh;
  border: 0;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
@keyframes media-viewer-fade {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.media-viewer__close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.media-viewer__close:hover {
  background: #dc2626;
}
.media-viewer__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.media-viewer__nav:hover {
  background: #dc2626;
}
.media-viewer__nav--prev { left: 18px; }
.media-viewer__nav--next { right: 18px; }
.media-viewer.is-gallery .media-viewer__nav { display: flex; }
.media-viewer__caption {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  max-width: 80vw;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  background: rgba(7, 11, 20, 0.6);
  padding: 8px 16px;
  border-radius: 9999px;
}
.media-viewer__counter {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 3;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 700;
}
@media (max-width: 640px) {
  .media-viewer__stage iframe {
    width: 100%;
    height: 56vw;
  }
}
