.mem-lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(3.5rem, 6vw, 5rem) clamp(0.75rem, 3vw, 3rem) clamp(1.5rem, 4vw, 3rem);
  border: 0;
  background: transparent;
  color: var(--mem-vanilla);
  overflow: hidden;
}

.mem-lightbox[open] {
  display: grid;
  place-items: center;
}

.mem-lightbox::backdrop {
  background: rgb(5 7 7 / 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.mem-lightbox__stage {
  width: min(100%, 1400px, calc((100dvh - 11rem) * 16 / 9));
  animation: mem-lightbox-in 0.45s var(--ease-out) both;
}

.mem-lightbox__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 140px -30px rgb(255 248 221 / 0.25);
}

.mem-lightbox__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.mem-lightbox__caption {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--text-lg);
  text-align: center;
}

.mem-lightbox__close {
  position: fixed;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgb(255 248 221 / 0.9);
  color: var(--mem-ink);
  font-size: 1.7rem;
  line-height: 1;
}

.mem-lightbox__close:hover {
  background: var(--mem-vanilla);
}

.mem-lightbox__close:focus-visible {
  outline-color: var(--mem-vanilla);
}

@keyframes mem-lightbox-in {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: none; }
}

html.mem-lightbox-open {
  overflow: hidden;
}

html.mem-lightbox-open .nav,
html.mem-lightbox-open .mem-popup {
  visibility: hidden;
}
