body.photo-modal-open {
  overflow: hidden;
}

.library-photo-trigger {
  cursor: zoom-in;
}

.library-photo-trigger:focus-visible {
  outline: 3px solid rgba(22, 135, 217, .55);
  outline-offset: 3px;
}

.library-photo-modal[hidden] {
  display: none;
}

.library-photo-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(7, 27, 44, .82);
  opacity: 0;
  transition: opacity .18s ease;
}

.library-photo-modal.is-open {
  opacity: 1;
}

.library-photo-modal-dialog {
  position: relative;
  display: grid;
  width: min(1120px, 100%);
  max-height: calc(100dvh - 64px);
  border-radius: 18px;
  background: #0a1d2c;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
  opacity: 0;
  outline: none;
  transform: translateY(8px) scale(.985);
  transition: opacity .18s ease, transform .18s ease;
}

.library-photo-modal.is-open .library-photo-modal-dialog {
  opacity: 1;
  transform: none;
}

.library-photo-modal-dialog figure {
  display: grid;
  min-width: 0;
  max-height: calc(100dvh - 64px);
  margin: 0;
  place-items: center;
}

.library-photo-modal-dialog img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 64px);
  border-radius: 18px;
  object-fit: contain;
}

.library-photo-modal-dialog figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 34px 22px 16px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(transparent, rgba(3, 16, 27, .86));
  color: #fff;
  font-size: 12px;
  line-height: 1.7;
}

.library-photo-modal-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 50%;
  background: rgba(4, 24, 39, .72);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 30px;
  line-height: 1;
  transition: background .18s ease, transform .18s ease;
}

.library-photo-modal-close:hover {
  background: rgba(14, 61, 94, .95);
  transform: scale(1.04);
}

.library-photo-modal-close:focus-visible {
  outline: 3px solid #78c9ff;
  outline-offset: 3px;
}

@media (max-width: 700px) {
  .library-photo-modal {
    padding: 12px;
  }

  .library-photo-modal-dialog,
  .library-photo-modal-dialog figure {
    max-height: calc(100dvh - 24px);
    border-radius: 13px;
  }

  .library-photo-modal-dialog img {
    max-height: calc(100dvh - 24px);
    border-radius: 13px;
  }

  .library-photo-modal-dialog figcaption {
    padding: 30px 16px 12px;
    border-radius: 0 0 13px 13px;
  }

  .library-photo-modal-close {
    top: 9px;
    right: 9px;
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .library-photo-modal,
  .library-photo-modal-dialog,
  .library-photo-modal-close {
    transition: none;
  }
}
