/* ==========================================================================
   A Softer Edge — Static Mirror Overrides for Squarespace 7.1
   Ensures scroll animations, blog grids, masonry galleries, product galleries,
   video embeds, mobile nav, and archive items render with zero Squarespace JS.
   ========================================================================== */

/* 1. Force all Squarespace 7.1 pre-animation & collection items visible */
.preFade,
.preSlide,
.preScale,
.preClip,
.fadeIn,
[data-animation-role],
[data-animation-override],
.blog-basic-grid .blog-basic-grid--container,
.cdk-section[data-definition-name="website.components.blogList"] .blog-list.blog-basic-grid .blog-basic-grid--container,
.blog-masonry .entry,
.blog-masonry .blog-item,
.product-list .product-list-item {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
  visibility: visible !important;
}

/* 2. Hydrated content, blog card, & section background images */
.section-background img,
.sqs-section-background img,
.content-fill img,
.sqs-image-shape-container-element img,
.image-block-wrapper img,
.summary-thumbnail img,
.grid-image img,
.blog-basic-grid .image-wrapper img,
.product-list-item-image img,
.gallery-grid-item-wrapper img,
.gallery-masonry-item-wrapper img,
.ProductItem-gallery-slides-item img,
.product-gallery-slides-item-image {
  opacity: 1 !important;
}

.section-background img,
.sqs-section-background img,
.content-fill img,
.gallery-grid-item-wrapper img,
.blog-basic-grid .image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-block-wrapper img[data-stretch="false"],
.sqs-image-content img {
  width: 100%;
  height: auto;
  display: block;
}

/* 3. Pure-CSS 4-column Masonry layout for /gallery without Squarespace Masonry JS */
.gallery-masonry .gallery-masonry-wrapper {
  display: block !important;
  column-count: 4;
  column-gap: 16px;
  height: auto !important;
}

@media (max-width: 991px) {
  .gallery-masonry .gallery-masonry-wrapper {
    column-count: 3;
  }
}

@media (max-width: 640px) {
  .gallery-masonry .gallery-masonry-wrapper {
    column-count: 2;
    column-gap: 10px;
  }
}

.gallery-masonry .gallery-masonry-item {
  position: relative !important;
  transform: none !important;
  width: 100% !important;
  height: auto !important;
  break-inside: avoid;
  margin-bottom: 16px;
  opacity: 1 !important;
  visibility: visible !important;
}

.gallery-masonry .gallery-masonry-item-wrapper,
.gallery-masonry .gallery-masonry-item-caption {
  opacity: 1 !important;
  visibility: visible !important;
  height: auto !important;
  position: relative !important;
}

.gallery-masonry .gallery-masonry-item-wrapper img {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  display: block !important;
}

/* 4. Hide empty cart buttons & paused interactive remnants */
.header-actions-action--cart,
.sqs-cart-dropzone,
.sqs-announcement-bar-dropzone,
.product-quantity-input,
.product-variants,
.ProductItem-details .product-variants {
  display: none !important;
}

/* 5. Read-only archive badge for legacy /sale-page/p/* and /store/p/* pages */
.ase-archive-notice {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid currentColor;
  font-family: "orpheus-pro", Georgia, serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

/* 6. Hydrated YouTube, Instagram Reel, & self-hosted HTML5 video blocks */
.sqs-video-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.sqs-video-wrapper.ase-video-16x9 {
  aspect-ratio: 16 / 9;
}

.sqs-video-wrapper.ase-video-16x9 iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.sqs-video-wrapper.ase-video-embed iframe {
  max-width: 100%;
  border: 0;
  display: block;
  margin: 0 auto;
}

.sqs-native-video {
  position: relative;
  width: 100%;
}

.ase-native-video {
  width: 100%;
  max-height: 75vh;
  display: block;
  margin: 0 auto;
  background: #000;
}

/* 7. Product detail gallery (supports both Squarespace 7.1 PDP v2 & legacy classes) */
.product-gallery {
  --product-gallery-aspect-ratio: 3 / 4;
}

.product-gallery .enable-on-first-image-load,
.product-gallery-thumbnails-item {
  opacity: 1 !important;
}

.product-gallery-thumbnails-item img {
  width: 50px !important;
  aspect-ratio: 3 / 4;
  height: auto !important;
  object-fit: cover;
  display: block;
}

.product-gallery-slides-item,
.ProductItem-gallery-slides-item {
  display: none;
}

.product-gallery-slides-item.selected,
.product-gallery-slides-item:first-of-type,
.ProductItem-gallery-slides-item.selected,
.ProductItem-gallery-slides-item:first-of-type {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.product-gallery-slides-item.ase-hidden-slide,
.ProductItem-gallery-slides-item.ase-hidden-slide {
  display: none !important;
}

.product-gallery-slides-item-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block !important;
  opacity: 1 !important;
}

.product-image-zoom-duplicate {
  display: none !important;
}

/* 8. Mobile menu drawer toggle support */
body.header--menu-open {
  overflow: hidden;
}

body.header--menu-open .header-menu {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* 9. Lightweight gallery lightbox modal */
.ase-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(18, 18, 18, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.ase-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.ase-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.ase-lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.5rem;
}
