/* Static-site overrides for the Squarespace theme (its JavaScript has been removed).
   Squarespace's scripts used to size, position and fade in images; this does it in CSS. */

/* Images are plain <img src> now: never hide them. */
img { opacity: 1 !important; visibility: visible !important; }

/* Index page: project thumbnails (cover-cropped, 3:2 like the live site). */
#projectThumbs .project-image .intrinsic { position: relative; padding-bottom: 66.6667%; overflow: hidden; }
#projectThumbs .project-image .content-fill { position: absolute; inset: 0; }
#projectThumbs .project-image .content-fill img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Gallery blocks: square cells, image fitted inside ("content-fit"), 4 per row, 10px padding. */
.sqs-gallery-block-grid .sqs-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0; }
.sqs-gallery-block-grid.sqs-gallery-thumbnails-per-row-3 .sqs-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sqs-gallery-block-grid.sqs-gallery-thumbnails-per-row-2 .sqs-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sqs-gallery-block-grid .slide { float: none; width: auto; margin: 0; }
.sqs-gallery-block-grid .margin-wrapper { position: relative; aspect-ratio: 1 / 1; }
.sqs-gallery-block-grid .slide .margin-wrapper a.image-slide-anchor { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; height: auto !important; padding: 0 !important; }
.sqs-gallery-block-grid .slide .margin-wrapper a.image-slide-anchor img.thumb-image { display: block; position: static; width: 100%; height: 100%; max-width: none; object-fit: contain; }
@media (max-width: 640px) {
  .sqs-gallery-block-grid .sqs-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}

/* Image blocks (About page): fill the aspect-ratio box. */
.sqs-image-shape-container-element > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* Mobile menu (was animated by the theme's JS). */
#mobileNav.menu-open { height: auto; }

/* Lightbox (replaces Squarespace's gallery lightbox). */
.lb { position: fixed; inset: 0; z-index: 10000; background: rgba(0, 0, 0, .92); display: none; align-items: center; justify-content: center; }
.lb.open { display: flex; }
.lb img { max-width: calc(100vw - 120px); max-height: calc(100vh - 80px); box-shadow: 0 0 30px rgba(0, 0, 0, .5); }
.lb button { position: absolute; background: none; border: 0; color: #fff; opacity: .7; cursor: pointer; font: 300 40px/1 sans-serif; padding: 16px; }
.lb button:hover, .lb button:focus-visible { opacity: 1; }
.lb .lb-close { top: 8px; right: 8px; font-size: 32px; }
.lb .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) { .lb img { max-width: 100vw; } .lb .lb-prev, .lb .lb-next { top: auto; bottom: 8px; transform: none; } }
