/* v18.87 — quiet arrow navigation for the existing shared/host memory viewer. */
#lightbox .p87-memory-nav[hidden]{display:none!important}
#lightbox .p87-memory-nav{
  position:absolute;z-index:4;top:43%;left:clamp(5px,2vw,20px);right:clamp(5px,2vw,20px);
  display:flex;justify-content:space-between;align-items:center;pointer-events:none;
}
#lightbox .p87-memory-nav button{
  pointer-events:auto;display:grid;place-items:center;appearance:none;
  width:46px;height:50px;min-width:46px;border-radius:999px;
  color:#fffdf7;background:rgba(30,28,27,.82);border:1px solid rgba(255,255,255,.4);
  box-shadow:0 5px 20px rgba(0,0,0,.2);cursor:pointer;
  font:400 36px/1 Georgia,serif;touch-action:manipulation;
}
#lightbox .p87-memory-nav button:disabled{
  opacity:.27;pointer-events:none;
}
#lightbox .p87-memory-nav button:focus-visible{
  outline:3px solid #d8b461;outline-offset:3px;
}
/* v18.89: mobile counter belongs in the header, not on top of memories. */
#lightbox .lightbox-top{display:flex;align-items:center;gap:12px;min-height:52px;min-width:0}
#lightbox .lightbox-top #lightboxTitle{
  min-width:0;flex:1 1 auto;overflow:hidden;white-space:nowrap;
  text-overflow:ellipsis;
}
#lightbox .p87-memory-count[hidden]{display:none!important}
#lightbox .p87-memory-count{
  pointer-events:none;position:static;transform:none;top:auto;left:auto;
  flex:0 0 auto;margin:0 4px;
  font:600 12px/1.4 system-ui,sans-serif;
  padding:5px 8px;border:1px solid rgba(255,255,255,.24);
  background:rgba(26,25,24,.82);color:#fffdf7;border-radius:999px;
  font-variant-numeric:tabular-nums;white-space:nowrap;
}
#lightbox #lightboxMedia img{touch-action:pan-y}
@media(max-width:430px){
 #lightbox .p87-memory-nav{left:3px;right:3px}
 #lightbox .p87-memory-nav button{
   width:42px;height:48px;min-width:42px;font-size:32px;
 }
}
@media(prefers-reduced-motion:reduce){
 #lightbox .p87-memory-nav button{transition:none}
}


/* v18.88 photo consistency: show complete original frame in the square tile;
   open photo retains natural dimensions inside the same calm viewer scale
   as videos. Original bytes, canvas, QR, cover and download never change. */
#guestGalleryCard #gallery > .photo.photo-with-story:not(.p76-video-tile) .photo-visual{
  background:#e7e0d4;
}
#guestGalleryCard #gallery > .photo.photo-with-story:not(.p76-video-tile) .photo-visual img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain !important;
  object-position:center center;
}
#lightbox #lightboxMedia img{
  display:block;
  width:auto !important;
  height:auto !important;
  max-width:min(100%, 900px) !important;
  max-height:min(56dvh, 600px) !important;
  object-fit:contain !important;
  border-radius:12px;
  background:#1b1b1a;
}
#lightbox #lightboxMedia{min-width:0;overflow:hidden}

/* v18.167 — Samsung 45352 organiser Photo memory viewer, NOT the booth modal.
   Tall JPEG photobooth strips must fit the media pane completely.
   The owner action sheet is independently scrollable, and the event behind
   the viewer must not move. No changes to image URLs, media, permissions,
   host moderation or download paths. */
@media (max-width:760px){
 html:has(#lightbox:not(.hidden)){
   overflow:hidden!important;
   overscroll-behavior:none!important;
 }
 body:has(#lightbox:not(.hidden)){
   overflow:hidden!important;
   overscroll-behavior:none!important;
 }
 #lightbox.lightbox:not(.hidden){
   box-sizing:border-box!important;
   width:100%!important;
   height:100dvh!important;
   max-height:100dvh!important;
   overflow:hidden!important;
   display:grid!important;
   grid-template-rows:auto minmax(0,1fr) minmax(0,max-content)!important;
   gap:10px!important;
   padding:max(12px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom))!important;
 }
 #lightbox #lightboxMedia{
   min-width:0!important;
   min-height:0!important;
   width:100%!important;
   height:100%!important;
   overflow:hidden!important;
   display:flex!important;
   align-items:center!important;
   justify-content:center!important;
 }
 #lightbox #lightboxMedia img,
 #lightbox #lightboxMedia video{
   display:block!important;
   box-sizing:border-box!important;
   width:auto!important;
   height:auto!important;
   max-width:100%!important;
   max-height:100%!important;
   object-fit:contain!important;
   object-position:center center!important;
   flex:0 1 auto!important;
 }
 #lightbox #lightboxInfo{
   box-sizing:border-box!important;
   width:100%!important;
   height:auto!important;
   min-height:0!important;
   max-height:min(38dvh,310px)!important;
   overflow-y:auto!important;
   overscroll-behavior:contain!important;
   margin:0 auto!important;
   -webkit-overflow-scrolling:touch;
 }
}
