body.story-image-lightbox-open {
  overflow: hidden;
}

.story-image-expand {
  position: relative;
  display: block;
  overflow: hidden;
  color: inherit;
  border-radius: inherit;
  cursor: zoom-in;
}

.story-image-expand::after {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  content: '＋ Expand';
  background: rgba(7, 22, 46, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(7, 22, 46, 0.26);
  backdrop-filter: blur(8px);
}

.story-image-expand:hover img,
.story-image-expand:focus-visible img {
  transform: scale(1.012);
}

.story-image-expand img {
  transition: transform 180ms ease;
}

.story-image-expand:focus-visible {
  outline: 4px solid var(--pink);
  outline-offset: 5px;
}

.story-image-lightbox {
  width: min(96vw, 1800px);
  max-width: none;
  height: min(94vh, 1100px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  color: #f8f4ff;
  background: #07162e;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 24px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.58);
}

.story-image-lightbox::backdrop {
  background: rgba(2, 8, 20, 0.88);
  backdrop-filter: blur(8px);
}

.story-image-lightbox__panel {
  display: grid;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.story-image-lightbox__toolbar,
.story-image-lightbox__navigation {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(16, 31, 61, 0.98);
}

.story-image-lightbox__toolbar {
  justify-content: flex-end;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.story-image-lightbox__navigation {
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.story-image-lightbox button,
.story-image-lightbox__toolbar a {
  min-height: 42px;
  padding: 9px 14px;
  color: #fff;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  cursor: pointer;
}

.story-image-lightbox button:hover,
.story-image-lightbox button:focus-visible,
.story-image-lightbox__toolbar a:hover,
.story-image-lightbox__toolbar a:focus-visible {
  color: #251238;
  background: #ffc6e2;
  outline: none;
}

.story-image-lightbox__close {
  width: 42px;
  padding: 0 !important;
  font-size: 1.5rem !important;
}

.story-image-lightbox__viewport {
  display: grid;
  overflow: auto;
  overscroll-behavior: contain;
  background:
    radial-gradient(circle at 50% 20%, rgba(123, 79, 180, 0.22), transparent 45%),
    #030b18;
}

.story-image-lightbox figure {
  display: grid;
  min-width: 100%;
  min-height: 100%;
  align-content: center;
  justify-items: center;
  margin: 0;
}

.story-image-lightbox img {
  display: block;
  width: calc(100% - 32px);
  max-width: 2172px;
  max-height: none;
  height: auto;
  cursor: zoom-in;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

.story-image-lightbox.is-zoomed figure {
  align-content: start;
  justify-items: start;
}

.story-image-lightbox.is-zoomed img {
  width: auto;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.story-image-lightbox figcaption {
  max-width: 920px;
  padding: 14px 22px 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.story-image-lightbox__navigation span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
  font-weight: 800;
}

@media (max-width: 600px) {
  .story-image-expand::after {
    right: 8px;
    bottom: 8px;
    padding: 6px 9px;
    font-size: 0.66rem;
  }

  .story-image-lightbox {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .story-image-lightbox__toolbar {
    flex-wrap: wrap;
    justify-content: center;
    padding: 9px 56px 9px 9px;
  }

  .story-image-lightbox__close {
    position: absolute;
    top: 9px;
    right: 9px;
  }

  .story-image-lightbox__navigation {
    padding: 9px;
  }

  .story-image-lightbox img {
    width: calc(100% - 18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-image-expand img {
    transition: none;
  }
}
