/* Local offline fixes for SquareSpace image loading */

/* Fix layout containers - SquareSpace JS normally sets widths dynamically */
#canvas {
  width: auto !important;
  min-width: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 900px !important;
  box-sizing: border-box !important;
}

/* Ensure page sections expand to fill available width */
#page, #projectThumbs, #projectPages {
  width: 100% !important;
}


/* ============================================
   HOMEPAGE THUMBNAIL GRID
   ============================================ */

/* Container for thumbnails must clip images to square */
#projectThumbs .project-image .intrinsic {
  position: relative !important;
  width: 100% !important;
  padding-bottom: 100% !important;
  height: 0 !important;
  overflow: hidden !important;
}

#projectThumbs .project-image .intrinsic .content-fill {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
}

/* Let the JS handle image positioning via inline styles - don't override */
#projectThumbs .project-image .intrinsic .content-fill img {
  opacity: 1 !important;
  visibility: visible !important;
}

#projectThumbs .content-fill noscript {
  display: none !important;
}

/* ============================================
   GALLERY PAGE IMAGES (portrait, west-ost, etc.)
   ============================================ */

.slide .margin-wrapper .intrinsic {
  height: auto !important;
  overflow: visible !important;
}

.slide .margin-wrapper .intrinsic .content-fill {
  position: relative !important;
  height: auto !important;
}

.slide .margin-wrapper .intrinsic .content-fill img {
  position: relative !important;
  max-width: 100% !important;
  height: auto !important;
  opacity: 1 !important;
}

/* ============================================
   IMAGE BLOCKS - Respect padding-bottom aspect ratio
   ============================================ */

.sqs-image-shape-container-element.has-aspect-ratio {
  position: relative !important;
}

.sqs-image-shape-container-element.has-aspect-ratio img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.sqs-image-shape-container-element:not(.has-aspect-ratio) {
  height: auto !important;
  overflow: visible !important;
}

.sqs-image-shape-container-element:not(.has-aspect-ratio) img {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
}

.sqs-block-image .image-block-wrapper {
  position: relative !important;
}

.image-caption-wrapper {
  position: relative !important;
  display: block !important;
  margin-top: 8px !important;
}

/* ============================================
   General image visibility
   ============================================ */

img[data-src] {
  opacity: 1 !important;
  visibility: visible !important;
}

img.loaded {
  opacity: 1 !important;
}

.sqs-block-image img {
  display: block !important;
  max-width: 100% !important;
  opacity: 1 !important;
}

noscript {
  display: none !important;
}

/* Like button: styles come from simple-liking CSS (loaded directly via <link>) */
