/* ===== Mobile & grid fixes (global) ===== */
*,*::before,*::after{box-sizing:border-box}
html,body{overflow-x:hidden;-webkit-text-size-adjust:100%}
img,video,picture,canvas,svg{max-width:100%;height:auto;display:block}
*{min-width:0;min-height:0}

/* No-crop grid for gallery & homepage */
.gallery-grid{column-count:3;column-gap:18px;margin:24px 0 60px}
.gallery-grid img{display:block;width:100%;height:auto !important;aspect-ratio:auto !important;object-fit:contain !important;
  border-radius:12px;border:1px solid var(--line,#e5e5e5);box-shadow:0 1px 8px rgba(0,0,0,.06);margin:0 0 18px 0;break-inside:avoid}
@media (max-width:1024px){.gallery-grid{column-count:3}}
@media (max-width:768px){.gallery-grid{column-count:2}}
@media (max-width:480px){.gallery-grid{column-count:1}}

/* Full-height stability */
.vh-100{height:100dvh;min-height:100svh}
@supports not (height:100dvh){.vh-100{height:calc(var(--vh,1vh)*100);height:-webkit-fill-available}}

/* Safe areas for iOS */
.safe-pad{padding-top:env(safe-area-inset-top);padding-right:env(safe-area-inset-right);padding-bottom:env(safe-area-inset-bottom);padding-left:env(safe-area-inset-left)}

/* iOS/Android scoped tweaks */
html.is-ios .no-fixed-on-ios{position:sticky;top:0}
html.is-ios .scroll-container{-webkit-overflow-scrolling:touch}
html.is-android body{overscroll-behavior-y:contain}

/* Strong anti-crop overrides */
body .gallery-grid img, body .home-grid img, body .main-grid img, body main .gallery-grid .card img{
  width:100% !important;max-width:100% !important;height:auto !important;aspect-ratio:auto !important;object-fit:contain !important
}
.gallery-grid .card,.home-grid .card,.main-grid .card{height:auto !important;overflow:visible !important}
