/* Post lightbox — full-screen viewer */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  padding-bottom: calc(var(--music-bar-height) + 12px);
}

.lightbox.is-open { display: flex; }

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
}

.lightbox__stage {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: calc(100dvh - var(--music-bar-height) - 24px);
  display: flex;
  flex-direction: column;
  animation: lightbox-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.lightbox__close {
  position: absolute;
  top: -4px;
  right: 0;
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(12, 12, 16, 0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.lightbox__close svg {
  width: 22px;
  height: 22px;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.05);
}

.lightbox__frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 80px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(255, 255, 255, 0.03);
}

.lightbox__media-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  max-height: min(72dvh, 680px);
  background: radial-gradient(ellipse at center, #141418 0%, #000 100%);
}

.lightbox__media-wrap img,
.lightbox__media-wrap video {
  width: 100%;
  max-height: min(72dvh, 680px);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox__shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
}

.lightbox__footer {
  margin-top: 14px;
  padding: 16px 18px 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(18, 18, 24, 0.95), rgba(10, 10, 14, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.lightbox__footer.is-empty {
  display: none;
}

.lightbox__meta {
  min-width: 0;
}

.lightbox__author {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  margin-bottom: 6px;
}

.lightbox__caption {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: rgba(236, 236, 241, 0.88);
  white-space: pre-wrap;
  word-break: break-word;
}

.lightbox__caption:empty {
  display: none;
}

.lightbox__controls {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.lightbox__controls[hidden] {
  display: none;
}

.lightbox__ctrl {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.lightbox__ctrl svg {
  width: 20px;
  height: 20px;
}

.lightbox__ctrl .icon-pause,
.lightbox__ctrl .icon-muted,
.lightbox.is-video-playing .lightbox__ctrl[data-action="play"] .icon-play,
.lightbox.is-video-muted .lightbox__ctrl[data-action="mute"] .icon-vol {
  display: none;
}

.lightbox.is-video-playing .lightbox__ctrl[data-action="play"] .icon-pause { display: block; }
.lightbox.is-video-muted .lightbox__ctrl[data-action="mute"] .icon-muted { display: block; }

.lightbox__ctrl:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.06);
}

@media (max-width: 520px) {
  .lightbox {
    padding: 8px;
    padding-bottom: calc(var(--music-bar-height) + 8px);
  }

  .lightbox__close {
    top: 8px;
    right: 8px;
    position: fixed;
  }

  .lightbox__frame {
    border-radius: 12px;
  }

  .lightbox__footer {
    padding: 14px 16px 16px;
  }
}
