.junior-media-popup-open {
  overflow: hidden;
}

.junior-media-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.junior-media-modal.is-open {
  display: flex;
}

.junior-media-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 40, 0.86);
  backdrop-filter: blur(10px);
}

.junior-media-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
  border-radius: 1rem;
  background: #10091c;
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.4);
}

.junior-media-modal__content {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #08040e;
}

.junior-media-modal__content img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}

.junior-media-modal__content iframe,
.junior-media-modal__content video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 80vh;
  border: 0;
  background: #000;
}

.junior-media-modal__content video {
  height: auto;
}

.junior-media-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: #fff;
  font: inherit;
  font-size: 1.65rem;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 999px;
  background: rgba(35, 15, 60, 0.8);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.junior-media-modal__close:hover,
.junior-media-modal__close:focus-visible {
  background: rgba(70, 25, 115, 0.96);
  transform: scale(1.04);
}

.junior-media-modal__title {
  padding: 0.875rem 1.125rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.9375rem;
  line-height: 1.4;
  background: rgba(22, 10, 38, 0.98);
}

@media (max-width: 640px) {
  .junior-media-modal {
    padding: 0.75rem;
  }

  .junior-media-modal__dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    border-radius: 0.75rem;
  }

  .junior-media-modal__close {
    top: 0.5rem;
    right: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
  }
}
