/* MSPB MOBILE GALLERY V1
   Responsive Photokorn gallery for iPad and iPhone.
   Desktop layout above 1180px remains unchanged. */

@media (max-width:1180px){
  body.mspb-modern.action-showgal .mspb-content{
    overflow-x:hidden!important;
  }

  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb){
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    border:0!important;
    background:transparent!important;
  }

  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) > tbody{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:18px!important;
    width:100%!important;
  }

  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) > tbody > tr{
    display:contents!important;
  }

  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) > tbody > tr > td{
    display:none!important;
  }

  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) > tbody > tr > td.thumb{
    display:flex!important;
    flex-direction:column!important;
    justify-content:flex-start!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    padding:12px!important;
    white-space:normal!important;
    text-align:center!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }

  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) td.thumb > a.preview2{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
  }

  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) td.thumb img.thumbimage{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    aspect-ratio:3 / 2!important;
    object-fit:cover!important;
    margin:0 auto 10px!important;
    border-radius:9px!important;
  }

  body.mspb-modern.action-showgal .zbehind > p.text{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    justify-content:center!important;
    gap:8px!important;
    width:100%!important;
    max-width:100%!important;
    margin:18px auto!important;
    padding:4px!important;
    white-space:normal!important;
    text-align:center!important;
    box-sizing:border-box!important;
  }

  body.mspb-modern.action-showgal .zbehind > p.text a,
  body.mspb-modern.action-showgal .zbehind > p.text .pageselected{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:42px!important;
    min-height:42px!important;
    margin:0!important;
    padding:8px 11px!important;
    border:1px solid rgba(255,255,255,.15)!important;
    border-radius:9px!important;
    background:#151b22!important;
    color:#fff!important;
    font-size:15px!important;
    font-weight:850!important;
    line-height:1!important;
    text-decoration:none!important;
    box-sizing:border-box!important;
  }

  body.mspb-modern.action-showgal .zbehind > p.text .pageselected{
    background:#e30613!important;
    border-color:#e30613!important;
  }

  body.mspb-modern.action-showgal .zbehind > .catdescription,
  body.mspb-modern.action-showgal .zbehind > .breadcrumb{
    max-width:100%!important;
    overflow-wrap:anywhere!important;
  }

  body.mspb-modern.page-pic .mediumcell{
    padding:12px!important;
    white-space:normal!important;
    overflow:hidden!important;
  }

  body.mspb-modern.page-pic img.mediumimage{
    display:block!important;
    width:100%!important;
    max-width:900px!important;
    height:auto!important;
    margin:0 auto 12px!important;
    object-fit:contain!important;
  }

  body.mspb-modern.page-pic .mspb-content td[nowrap],
  body.mspb-modern.page-pic .mspb-content span[style*="white-space"]{
    white-space:normal!important;
  }

  body.mspb-modern.page-pic .breadcrumb,
  body.mspb-modern.page-pic .catdescription{
    overflow-wrap:anywhere!important;
    line-height:1.55!important;
  }
}

@media (max-width:960px){
  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) > tbody{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:16px!important;
  }
}

@media (max-width:600px){
  body.mspb-modern.action-showgal .mspb-content{
    width:calc(100% - 16px)!important;
    padding:8px!important;
  }

  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) > tbody{
    grid-template-columns:minmax(0,1fr)!important;
    gap:14px!important;
  }

  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) > tbody > tr > td.thumb{
    padding:10px!important;
    font-size:15px!important;
    line-height:1.4!important;
  }

  body.mspb-modern.action-showgal .zbehind > p.text a,
  body.mspb-modern.action-showgal .zbehind > p.text .pageselected{
    min-width:44px!important;
    min-height:44px!important;
  }

  body.mspb-modern.action-showgal .mspb-subpage-hero{
    min-height:230px!important;
  }

  body.mspb-modern.action-showgal .mspb-subpage-hero img{
    min-height:230px!important;
  }

  body.mspb-modern.page-pic .mspb-content{
    width:calc(100% - 16px)!important;
    padding:8px!important;
  }

  body.mspb-modern.page-pic .mediumcell{
    padding:6px!important;
  }

}

@media (hover:none), (pointer:coarse){
  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) td.thumb:hover{
    transform:none!important;
  }
  body.mspb-modern.action-showgal table:has(> tbody > tr > td.thumb) .preview2 span{
    display:none!important;
  }
}