/* The picture / video viewer (lightbox.js): used by the live pages and by My collection. Theme variables only; the buttons are 46px round. */
.lv-lb { position: fixed; inset: 0; z-index: 1400; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--msg-bg) 92%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lv-lb-body { max-width: 100%; max-height: 100%; padding: 56px 12px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.lv-lb-body img, .lv-lb-body video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lv-lb-btn { position: absolute; width: 46px; height: 46px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--msg-border); background: var(--msg-surface-2); color: var(--msg-text); cursor: pointer; }
.lv-lb-btn svg { width: 22px; height: 22px; }
.lv-lb-btn:focus-visible { outline: 2px solid var(--msg-link); outline-offset: 2px; }
.lv-lb-x { top: calc(10px + env(safe-area-inset-top)); right: 12px; }
.lv-lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lv-lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lv-lb-btn[hidden] { display: none !important; }
/* the arrows are centred with a transform: the pressed look (scale) must keep that centring, or the arrow jumps away under the pointer and the click lands on the backdrop (closing the viewer) */
.lv-lb-prev:not(:disabled):active, .lv-lb-next:not(:disabled):active { transform: translateY(-50%) scale(.96); }

/* a viewer with a side panel (the comments): the picture on the left, the panel on the right; on a phone the panel is a sheet at the bottom that opens when its bar is tapped */
.lv-lb-withside { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr); align-items: stretch; justify-content: stretch; overflow: hidden; } /* one row exactly as tall as the window: a tall picture must never stretch the row and push the write box out of sight (some browsers resolve a percent height against an auto row as "no limit") */
.lv-lb-withside .lv-lb-body img, .lv-lb-withside .lv-lb-body video { max-height: calc(100vh - 112px); max-height: calc(100dvh - 112px); } /* a limit in window units, which no browser can misread */ /* one row exactly as tall as the window: a tall picture must never stretch the row and push the write box out of sight */
.lv-lb-withside .lv-lb-body { grid-column: 1; min-height: 0; min-width: 0; }
.lv-lb-side { grid-column: 2; min-height: 0; max-height: 100%; overflow: hidden; display: flex; flex-direction: column; background: var(--msg-surface); border-left: 1px solid var(--msg-border); color: var(--msg-text); }
.lv-lb-side[hidden] { display: none; }
.lv-lb-withside .lv-lb-next { right: 372px; }
.lv-lb-withside .lv-lb-x { right: 12px; background: var(--msg-surface-2); }
@media (max-width: 900px) {
  .lv-lb-withside { display: block; }
  .lv-lb-withside .lv-lb-body { padding: 56px 8px 72px; }
  .lv-lb-withside .lv-lb-body img, .lv-lb-withside .lv-lb-body video { max-height: calc(100vh - 128px); max-height: calc(100dvh - 128px); }
  .lv-lb-side { position: absolute; left: 0; right: 0; bottom: 0; height: min(72dvh, 560px); border-left: 0; border-top: 1px solid var(--msg-border); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px color-mix(in srgb, var(--msg-black) 35%, transparent); transition: height .2s ease; }
  .lv-lb-side.mc-closed { height: 56px; }
  .lv-lb-side { z-index: 4; } /* above the picture / video (z 1) and the arrows (z 3): the comments slid up UNDER a video (owner 2026-11-09) */
  .lv-lb-withside .lv-lb-next { right: 12px; top: 40%; }
  .lv-lb-withside .lv-lb-prev { top: 40%; }
  .lv-lb-withside:has(.lv-lb-side:not(.mc-closed)) .lv-lb-next, .lv-lb-withside:has(.lv-lb-side:not(.mc-closed)) .lv-lb-prev { top: calc((100% - min(72dvh, 560px)) / 2); } /* an open sheet covers the lower part: the arrows stay beside the picture above it */
}
@media (prefers-reduced-motion: reduce) { .lv-lb-side { transition: none; } }


.lv-lb-when { position: absolute; left: 16px; bottom: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--msg-text); background: color-mix(in srgb, var(--msg-black) 55%, transparent); padding: 4px 10px; border-radius: 999px; cursor: default; }
.lv-lb-full { display: none; }
.lv-lb-when:hover .lv-lb-ago, .lv-lb-when:focus .lv-lb-ago { display: none; }
.lv-lb-when:hover .lv-lb-full, .lv-lb-when:focus .lv-lb-full { display: inline; }
.lv-lb-when svg { flex: none; }
@media (max-width: 900px) { .lv-lb-when { top: 14px; bottom: auto; } } /* a phone: the comment box sits at the bottom, the date goes to the top left */

.lv-lb-count { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 2; font-size: 13px; font-weight: 600; color: var(--msg-text); background: color-mix(in srgb, var(--msg-black) 55%, transparent); padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.lv-lb-dl { position: absolute; right: 70px; top: 14px; z-index: 2; min-height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; font-size: 14px; color: var(--msg-text); background: color-mix(in srgb, var(--msg-black) 55%, transparent); border: 1px solid color-mix(in srgb, var(--msg-text) 28%, transparent); text-decoration: none; }
.lv-lb-body { touch-action: pan-y; } /* a sideways swipe is ours (next / previous), the browser keeps up / down */

/* While a file loads (lightbox.js show): the item stays invisible beside its stand-in (the small grid picture, blurred, with a spinner), or the previous
   item stays, dimmed. The spinner only appears after a moment, so a picture that is already in the browser never blinks one. */
.lv-lb-body { position: relative; }
.lv-lb .lv-lb-body .lv-lb-m.is-loading { position: absolute; opacity: 0; pointer-events: none; }
.lv-lb-old { opacity: .45; transition: opacity .15s ease .15s; } /* dims only when the wait is noticeable */
.lv-lb-ph { position: absolute; inset: 0; padding: inherit; box-sizing: border-box; display: flex; align-items: center; justify-content: center; overflow: hidden; pointer-events: none; }
.lv-lb .lv-lb-body .lv-lb-ph img { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; border-radius: 0; filter: blur(14px); opacity: .9; }
.lv-lb-spin { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; box-sizing: border-box; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--msg-white) 28%, transparent); border-top-color: var(--msg-accent); background: color-mix(in srgb, var(--msg-black) 30%, transparent); animation: lv-lb-turn .8s linear infinite, lv-lb-appear .2s ease-out .15s both; }
@keyframes lv-lb-turn { to { transform: rotate(360deg); } }
@keyframes lv-lb-appear { from { opacity: 0; } to { opacity: 1; } }
.lv-lb-err { margin: 0; padding: 12px 16px; border-radius: 10px; background: var(--msg-surface); color: var(--msg-muted); font-size: 15px; }
@media (prefers-reduced-motion: reduce) { .lv-lb-spin { animation-duration: 1.6s, .2s; } .lv-lb-old { transition: none; } }
.lv-lb .lv-lb-body .lv-lb-m:not(.is-loading) { position: relative; z-index: 1; } /* above the fading stand-in */
/* a video fills the space it will play in from the first moment (its cover is drawn there as the poster, letterboxed like the video itself), so nothing
   moves or changes size when it starts; the spinner lies over it */
.lv-lb .lv-lb-body video.lv-lb-m { width: 100%; height: 100%; object-fit: contain; border-radius: 0; }
.lv-lb .lv-lb-body .lv-lb-ph-top { z-index: 2; }
.lv-lb .lv-lb-btn { z-index: 3; } /* the arrows and Close always lie above the item (a video fills the whole space and is raised above the fading stand-in) */
