body.replia-image-lightbox-open {
  overflow: hidden;
}

.replia-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.replia-image-lightbox[hidden] {
  display: none;
}

.replia-image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 23, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.replia-image-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 96rem);
  max-height: calc(100vh - 2.5rem);
  animation: replia-image-lightbox-in 0.22s ease-out;
}

.replia-image-lightbox__panel {
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.92);
  box-shadow:
    0 32px 80px rgba(2, 8, 23, 0.45),
    0 0 0 1px rgba(155, 105, 243, 0.12);
}

.replia-image-lightbox__chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 3.25rem 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(15, 23, 42, 0.88);
}

.replia-image-lightbox__chrome span {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.55);
}

.replia-image-lightbox__caption {
  margin: 0 0 0 0.35rem;
  color: rgba(226, 232, 240, 0.88);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.replia-image-lightbox__image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  background: rgba(11, 17, 32, 0.65);
}

.replia-image-lightbox__image-wrap img {
  display: block;
  width: auto;
  max-width: min(92vw, 1400px);
  max-height: 85vh;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 0.35rem;
}

.replia-image-lightbox__close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: rgba(248, 250, 252, 0.92);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.replia-image-lightbox__close:hover {
  border-color: rgba(155, 105, 243, 0.55);
  background: rgba(50, 35, 181, 0.55);
  color: #fff;
}

.replia-image-lightbox__close:focus-visible {
  outline: 2px solid var(--brand-light-purple, #9b69f3);
  outline-offset: 2px;
}

@keyframes replia-image-lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(0.35rem);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .replia-image-lightbox__dialog {
    animation: none;
  }
}

@media (max-width: 48rem) {
  .replia-image-lightbox {
    padding: 0.75rem;
  }

  .replia-image-lightbox__image-wrap {
    padding: 0.5rem;
  }

  .replia-image-lightbox__image-wrap img {
    max-width: 100%;
    max-height: 78vh;
  }
}
