[data-photo-lightbox] figure > a:has(> img) {
  cursor: zoom-in;
}

.has-photo-lightbox { overflow: hidden; }

.photo-lightbox {
  position: fixed;
  inset: 0;
  width: min(1180px, calc(100% - 28px));
  height: min(920px, calc(100dvh - 28px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #63756b;
  border-radius: 10px;
  background: #111b16;
  color: #fff;
}

.photo-lightbox::backdrop { background: #101813e8; }
.photo-lightbox-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.photo-lightbox-toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; }
.photo-lightbox-toolbar span { flex: 1; padding-inline-start: 4px; font-variant-numeric: tabular-nums; }
.photo-lightbox-toolbar button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #73867b;
  border-radius: 6px;
  background: #23352b;
  color: #fff;
  font: 26px/1 system-ui, sans-serif;
  cursor: pointer;
}
.photo-lightbox-toolbar button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.photo-lightbox-toolbar button:disabled { opacity: .45; cursor: default; }
.photo-lightbox-stage { min-width: 0; min-height: 0; overflow: hidden; touch-action: pan-y; }
.photo-lightbox-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-lightbox-stage.is-zoomed { overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; }
.photo-lightbox-stage.is-zoomed img { height: auto; max-width: none; max-height: none; }
.photo-lightbox-caption {
  max-height: 22dvh;
  overflow: auto;
  margin: 0;
  padding: 9px 14px 12px;
  text-align: center;
  overflow-wrap: anywhere;
  font-size: .9rem;
}

@media (max-width: 540px) {
  .photo-lightbox { width: calc(100% - 12px); height: calc(100dvh - 12px); border-radius: 6px; }
}
