/* The shared prewedding photo viewer (photo-viewer.js). A world tints it by setting these custom
   properties on .lunet-photos[data-theme="<world>"] in its own stylesheet:
   --lp-bg, --lp-ink, --lp-muted, --lp-control, --lp-control-hover, --lp-font, --lp-radius. */
html.lunet-photos-open { overflow: hidden; }
.lunet-photos {
  --lp-bg: #0d0f0e; --lp-ink: #f7f2e8; --lp-muted: #f7f2e8b3; --lp-control: #ffffff1f; --lp-control-hover: #ffffff38;
  --lp-font: Georgia, 'Times New Roman', serif; --lp-radius: 999px;
  --lp-target: 44px; --lp-gap: 8px;
  /* Room above and below the photo for the count and the close button, clear of notches. */
  --lp-edge: max(calc(var(--lp-target) + 2 * var(--lp-gap)), calc(env(safe-area-inset-top) + var(--lp-target) + var(--lp-gap)), calc(env(safe-area-inset-bottom) + var(--lp-target) + var(--lp-gap)));
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--lp-ink);
  overflow: hidden; overscroll-behavior: contain; -webkit-tap-highlight-color: transparent;
}
.lunet-photos::backdrop { background: transparent; }
/* Pulling a photo down to close lets the world show through a little. */
.lunet-photos::before { content: ''; position: absolute; inset: 0; background: var(--lp-bg); opacity: calc(1 - var(--lp-pull, 0) * .6); }
.lunet-photos-stage { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.lunet-photos-image {
  position: absolute; top: var(--lp-edge); left: calc(1.5 * var(--lp-gap));
  width: calc(100% - 3 * var(--lp-gap)); height: calc(100% - 2 * var(--lp-edge));
  object-fit: contain; transform-origin: 50% 50%; -webkit-user-drag: none;
}
.lunet-photos.is-zoomed .lunet-photos-stage { cursor: grab; }
.lunet-photos-count {
  position: absolute; left: 0; right: 0; top: max(calc(2 * var(--lp-gap)), calc(env(safe-area-inset-top) + 1.5 * var(--lp-gap)));
  margin: 0; text-align: center; font: 500 14px/1.4 var(--lp-font); letter-spacing: .12em; color: var(--lp-muted);
  font-variant-numeric: tabular-nums; pointer-events: none;
}
/* Worlds style their own dialog buttons; none of that reaches the viewer's. */
.lunet-photos button {
  position: absolute; display: grid; place-items: center; width: var(--lp-target); height: var(--lp-target); min-height: 0; margin: 0; padding: 0;
  border: 0; border-radius: var(--lp-radius); background: var(--lp-control); color: var(--lp-ink);
  font: 300 26px/1 var(--lp-font); cursor: pointer; transition: background-color .2s, opacity .2s;
}
/* The world's language switch rides along into the viewer; its buttons stay in their row. */
.lunet-photos > .lang button { position: static; }
.lunet-photos button:hover { background: var(--lp-control-hover); }
.lunet-photos button:focus-visible { outline: 2px solid var(--lp-ink); outline-offset: 3px; }
.lunet-photos button:disabled { opacity: 0; pointer-events: none; }
.lunet-photos-close { top: max(var(--lp-gap), env(safe-area-inset-top)); right: max(var(--lp-gap), env(safe-area-inset-right)); }
.lunet-photos-prev, .lunet-photos-next { top: calc(50% - var(--lp-target) / 2); }
.lunet-photos-prev { left: max(var(--lp-gap), env(safe-area-inset-left)); }
.lunet-photos-next { right: max(var(--lp-gap), env(safe-area-inset-right)); }
.lunet-photos[data-single] :is(.lunet-photos-prev, .lunet-photos-next, .lunet-photos-count) { display: none; }
/* On phones the photo spans the screen and a swipe turns it; arrows would sit on the photo. */
@media (hover: none) and (pointer: coarse) { .lunet-photos :is(.lunet-photos-prev, .lunet-photos-next) { display: none; } }
@media (prefers-reduced-motion: reduce) { .lunet-photos button { transition: none; } }
