/* final adaptive gallery CSS for current GalleryRenderer DOM */
.gallery-system-section{
  --gallery-mobile-slide:84%;
}

/* desktop grid / mobile swipe: renderer has grid DOM (figures are direct children of .gallery-system) */
@media(max-width:768px){
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-system{
    display:flex!important;
    grid-template-columns:none!important;
    gap:12px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scroll-snap-type:x mandatory!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:none!important;
  }
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-system::-webkit-scrollbar{display:none!important}
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-system > .gallery-item{
    flex:0 0 var(--gallery-mobile-slide)!important;
    width:auto!important;
    min-width:0!important;
    scroll-snap-align:start!important;
  }
}

/* desktop slider / mobile grid: renderer has slider DOM: .gallery-viewport > .gallery-track */
@media(max-width:768px){
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-nav,
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-dots{
    display:none!important;
  }
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-viewport{
    overflow:visible!important;
  }
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-track{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
    transform:none!important;
    overflow:visible!important;
    scroll-snap-type:none!important;
  }
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-item{
    flex:none!important;
    width:auto!important;
    min-width:0!important;
    scroll-snap-align:none!important;
  }
}

/* mobile grid modes for desktop-slider/mobile-grid */
@media(max-width:768px){
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-system.gallery-mode-crop .gallery-item img,
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-system.gallery-mode-crop .gallery-item video{
    width:100%!important;
    height:var(--gallery-h)!important;
    object-fit:cover!important;
  }
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-system.gallery-mode-contain .gallery-item img,
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-system.gallery-mode-contain .gallery-item video{
    width:100%!important;
    height:var(--gallery-h)!important;
    object-fit:contain!important;
    background:#f3f4f6!important;
  }
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-system.gallery-mode-masonry .gallery-track{
    display:block!important;
    column-count:2!important;
    column-gap:12px!important;
  }
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-system.gallery-mode-masonry .gallery-item{
    display:block!important;
    break-inside:avoid!important;
    margin:0 0 12px!important;
  }
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-system.gallery-mode-masonry .gallery-item img,
  .gallery-system-section.gallery--desktop-slider-mobile-grid .gallery-system.gallery-mode-masonry .gallery-item video{
    width:100%!important;
    height:auto!important;
    object-fit:contain!important;
  }
}


/* __gallery_mobile_slider_height_patch */
@media(max-width:768px){
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-system,
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-track,
  .gallery-system-section.gallery--slider .gallery-system,
  .gallery-system-section.gallery--slider .gallery-track{
    min-height:var(--gallery-mobile-slider-h, var(--gallery-slider-h, 360px))!important;
  }

  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-item,
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-item img,
  .gallery-system-section.gallery--desktop-grid-mobile-slider .gallery-item video,
  .gallery-system-section.gallery--slider .gallery-item,
  .gallery-system-section.gallery--slider .gallery-item img,
  .gallery-system-section.gallery--slider .gallery-item video{
    height:var(--gallery-mobile-slider-h, var(--gallery-slider-h, 360px))!important;
  }
}
