/* Eight photographs dealt from four directions, then a browsable frozen stack. */
.lightbox[open] { display: flex; flex-direction: column; animation: none; }
.lightbox { background: radial-gradient(ellipse at 50% 40%, #393025, #171410 72%); }
.lightbox-image {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1;
  min-height: 0;
  height: auto;
  padding: 76px 60px 28px;
  overflow: visible;
}
.photo-stack {
  position: relative;
  isolation: isolate;
  display: block;
  width: min(980px, 76vw, calc((100svh - 320px) * 1.5));
  aspect-ratio: 3 / 2;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: none;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
}
#photo-stack-backs { display: contents; }
.photo-stack-card {
  --card-x: 0px;
  --card-y: 0px;
  --card-angle: 0deg;
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border: 2px solid rgb(255 245 222 / 65%);
  border-radius: 18px;
  background: #25211b;
  box-shadow: 0 12px 38px rgb(0 0 0 / 36%), 0 1px 6px rgb(0 0 0 / 25%);
  transform: translate3d(var(--card-x), var(--card-y), 0) rotate(var(--card-angle));
  pointer-events: none;
}
.photo-stack .photo-stack-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: none;
  user-select: none;
  -webkit-user-drag: none;
}
.photo-stack-front { z-index: 8; }
.photo-stack .photo-stack-front img { object-fit: contain; }
.photo-stack:focus-visible { outline: 2px solid #efd292; outline-offset: 24px; }
.stack-preparing #photo-stack-backs .photo-stack-card { opacity: 0; }
.stack-loading {
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  color: #efdab0;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease;
  pointer-events: none;
}
.stack-preparing .stack-loading { opacity: 1; visibility: visible; }
.lightbox-bottom { position: relative; z-index: 12; flex: 0 0 auto; height: auto; min-height: 165px; }
.lightbox-bottom h2 { font-size: clamp(26px, 2.7vw, 38px); }
.lightbox-bottom .stack-hint { color: #efdfc4; font-size: 13px; margin-top: 8px; }
.lightbox-nav button { flex-shrink: 0; }

@media (max-width: 640px) {
  .lightbox-image { padding: 72px 28px 22px; }
  .photo-stack { width: min(76vw, calc((100svh - 330px) * 1.5)); border-radius: 12px; }
  .photo-stack-card { border-radius: 12px; border-width: 1px; }
  .lightbox-bottom { min-height: 185px; padding: 14px 7% 20px; }
  .lightbox-bottom h2 { font-size: 29px; line-height: 1.15; }
  .lightbox-bottom .stack-hint { font-size: 12px; }
  .lightbox-nav { margin-top: 16px; }
  .stack-loading { font-size: 12px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .lightbox-image { padding: 50px 45px 8px; }
  .photo-stack { width: min(55vw, calc((100svh - 185px) * 1.5)); }
  .lightbox-bottom { display: flex; min-height: 100px; padding: 10px 5%; }
  .lightbox-bottom h2 { font-size: 24px; }
  .lightbox-nav { margin-top: 0; gap: 16px; }
  .lightbox-bottom .stack-hint { display: none; }
}
