/* 0.8.35 — lightbox fit-to-screen.
   Images default to containing entirely in the stage (between header and
   caption/thumb strip). Zoom remains an explicit opt-in (.zm). */

.lb .stage{min-height:0}
.lb .track{min-height:0;height:100%}
.lb .slide{height:100%;min-height:0;box-sizing:border-box}

/* Regular slides (renders, site photos, galleries). */
.lb .slide:not(.z){
  display:flex;align-items:center;justify-content:center;position:relative;
}
.lb .slide:not(.z)>img{
  width:auto!important;height:auto!important;
  max-width:100%;
  max-height:calc(100dvh - var(--lb-top,74px) - var(--lb-bot,78px));
  object-fit:contain;object-position:center;
}

/* Zoomable drawings: image in .zw, caption under it. */
.lb .slide.z{
  display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;
  padding:0;background:#0e0e0e;
}
.lb .slide.z .zw{
  flex:1 1 auto;min-height:0;width:100%;
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;padding:0 var(--pad);box-sizing:border-box;
}
.lb .slide.z:not(.zm) .zw img{
  width:auto!important;height:auto!important;
  max-width:100%;
  max-height:calc(100dvh - var(--lb-top,74px) - var(--lb-bot,78px) - var(--lb-cap,26px));
  object-fit:contain;object-position:center;
  background:#ece8de;cursor:zoom-in;
}
.lb .slide.z .cap{flex:0 0 auto}

/* Explicit zoom: larger image with panning. */
.lb .slide.zm .zw{
  display:block;overflow:auto;padding:0;
  touch-action:pan-x pan-y pinch-zoom;overscroll-behavior:contain;
}
.lb .slide.zm .zw img{
  max-width:none!important;max-height:none!important;
  width:260%!important;height:auto!important;cursor:zoom-out;
}
@media(min-width:960px){
  .lb .slide.zm .zw img{width:170%!important}
}

/* Thumbnail strip stays as cropped tiles. */
.lb .th img{
  width:100%!important;height:100%!important;
  max-width:none;max-height:none;object-fit:cover;
}
