/* STUDIOFENCE recovery v19 | gallery layout feedback | 2026-11-03
   Keep the full photo-index functionality but demote its placement.
   Never re-encode, crop, or stretch original photographic content.
   Photo dimensions are defined by each original image's intrinsic width/height.
*/
.sf22-gallery.sf30-enhanced .sf30-top {
  justify-content: space-between;
}
.sf22-gallery.sf30-enhanced .sf30-top .sf30-counter {
  margin-left: auto;
}
.sf22-gallery.sf30-enhanced .sf30-bottom .sf30-tools {
  flex: 0 0 auto;
  min-width: 0;
  gap: clamp(12px, 2vw, 28px);
}
.sf22-gallery.sf30-enhanced .sf30-bottom .sf30-index-trigger {
  flex: 0 0 auto;
  min-height: 32px;
  border-bottom-color: rgba(32,32,30,.4);
}
/* With carousel JS: the <picture> itself must fit the stage, not its original
   4000px/6000px image size; flex keeps the photo centred and uncropped. */
.sf22-gallery.sf36-gallery .sf36-stage .sf22-photo > picture {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
}
.sf22-gallery.sf36-gallery .sf36-stage .sf22-photo > picture > img,
.sf22-gallery.sf36-gallery .sf36-stage .sf22-photo > img {
  display: block;
  flex: 0 1 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center;
  margin-inline: auto;
}
@media (max-width: 520px) {
  .sf22-gallery.sf30-enhanced .sf30-bottom { gap: 12px; }
  .sf22-gallery.sf30-enhanced .sf30-tools { gap: 10px; }
}
