.photo-lightbox-is-open {
  overflow: hidden !important;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: rgba(12, 15, 13, 0.92);
  backdrop-filter: blur(12px);
}

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

.photo-lightbox-dialog {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.photo-lightbox-figure {
  position: relative;
  display: grid;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  place-items: center;
}

.photo-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  object-fit: contain;
  opacity: 1;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  transition: opacity 160ms ease;
}

.photo-lightbox.is-loading .photo-lightbox-image {
  opacity: 0;
}

.photo-lightbox-caption {
  position: absolute;
  right: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(18, 22, 19, 0.76);
  color: #ffffff;
  padding: 7px 10px;
  font: 850 11px/1.1 "Aptos", "Inter", ui-sans-serif, system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(12px);
}

.photo-lightbox-caption:empty {
  display: none;
}

.photo-lightbox-figure.has-location-link .photo-lightbox-caption {
  right: 140px;
  left: 10px;
  max-width: none;
}

.photo-lightbox-location {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: #ffffff;
  color: #171c19;
  padding: 7px 12px;
  font: 850 11px/1.1 "Aptos", "Inter", ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.photo-lightbox-location[hidden] {
  display: none;
}

.photo-lightbox-location:hover,
.photo-lightbox-location:focus-visible {
  border-color: #171c19;
  background: #dce8e1;
}

.photo-lightbox-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(18, 22, 19, 0.78);
  color: #ffffff;
  font: 900 18px/1 "Aptos", "Inter", ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.photo-lightbox-close:hover,
.photo-lightbox-close:focus-visible {
  border-color: #ffffff;
  background: #ffffff;
  color: #171c19;
}

@media (max-width: 520px) {
  .photo-lightbox-image {
    max-width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .photo-lightbox-close {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    width: 38px;
    height: 38px;
  }

  .photo-lightbox-figure.has-location-link .photo-lightbox-caption {
    right: 128px;
    left: 8px;
    bottom: 8px;
  }

  .photo-lightbox-location {
    right: 8px;
    bottom: 8px;
    min-height: 30px;
    padding: 6px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-lightbox-image {
    transition: none;
  }
}
