/* Fish from the Holding Waters collection. The tile carries its own pale ink. */
.hw-fish-collection #content {
  background: var(--hw-paper, #fbf7ef) url("fast-fish-field-6e616fa31b.webp") repeat 50% 22px / 620px 494px;
  /* A 10% paper wash affects the fish layer alone. */
  background-image: linear-gradient(rgba(251,247,239,.1), rgba(251,247,239,.1)), url("fast-fish-field-6e616fa31b.webp");
}

@media (max-width: 760px) {
  .hw-fish-collection #content { background-size: 452px 360px; }
}

/* Keep the same framing at rest, on hover and after a swatch change. */
.hw-shirt-display .astra-shop-thumbnail-wrap .woocommerce-LoopProduct-link,
.hw-shirt-display .hw-card-media {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.hw-shirt-display.hw-theme .astra-shop-thumbnail-wrap .attachment-woocommerce_thumbnail,
.hw-shirt-display.hw-theme .hw-card .hw-card-media img,
.hw-shirt-display.hw-theme li.product:hover .attachment-woocommerce_thumbnail,
.hw-shirt-display.hw-theme .hw-card:hover .hw-card-media img {
  width: 100%;
  height: auto;
  max-height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  margin: 0;
  background: transparent;
  border-radius: 0;
  transform: var(--hw-card-scale, none);
  transform-origin: center;
  transition: none;
}

/* On collection pages, frame the print closer while retaining the collar and hem. */
.hw-shirt-display.hw-theme.hw-fish-collection .astra-shop-thumbnail-wrap .woocommerce-LoopProduct-link {
  display: grid;
  place-items: center;
  --hw-card-scale: scale(1.3);
  aspect-ratio: 19 / 24;
  overflow: hidden;
}

.hw-shirt-display.single-product .woocommerce-product-gallery__image img {
  display: block;
  width: 100%;
  height: auto;
  cursor: default;
}

.hw-shirt-display .astra-shop-thumbnail-wrap .woocommerce-LoopProduct-link,
.hw-shirt-display .hw-card-link {
  touch-action: manipulation;
}

/* Only the photograph is masked. Product names, links and swatches remain outside the frame. */
.hw-shirt-display.hw-theme :is(.astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link, .hw-home .hw-home-card-photo):has(> img.hw-front-cutout) {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 100 / 110;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background: transparent;
  --hw-card-scale: scale(1.43);
  --hem-opaque: var(--hw-hem-stop, 95%);
  --hem-fade: linear-gradient(to bottom,
    #000 var(--hem-opaque),
    rgba(0,0,0,.88) calc(20% + .8 * var(--hem-opaque)),
    rgba(0,0,0,.12) calc(80% + .2 * var(--hem-opaque)),
    transparent 100%);
  -webkit-mask-image: var(--hem-fade);
  mask-image: var(--hem-fade);
}
.hw-shirt-display.hw-theme :is(.astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link, .hw-home .hw-home-card-photo):has(> img.hw-front-cutout) > img.hw-front-cutout {
  position: absolute;
  inset: 0 0 auto;
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  /* Give lazy photos a visible box until their intrinsic aspect ratio is available. */
  aspect-ratio: auto 640 / 620;
  margin: 0;
  transform: var(--hw-card-scale);
  transform-origin: center top;
  transition: none;
}
@media (hover: hover) and (pointer: fine) {
  .hw-shirt-display.hw-theme :is(.astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link:hover, .hw-home a:hover > .hw-home-card-photo):has(> img.hw-front-cutout) {
    --hw-card-scale: scale(1.30);
  }
}
.hw-shirt-display.hw-theme :is(.astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link:focus-visible, .hw-home a:focus-visible > .hw-home-card-photo):has(> img.hw-front-cutout) {
  --hw-card-scale: scale(1.30);
}
.hw-shirt-display .astra-shop-thumbnail-wrap:has(> a.woocommerce-LoopProduct-link:focus-visible) {
  outline: 2px solid var(--hw-river, #1f3a35);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  .hw-shirt-display.hw-theme :is(.astra-shop-thumbnail-wrap > a.woocommerce-LoopProduct-link, .hw-home .hw-home-card-photo):has(> img.hw-front-cutout) > img.hw-front-cutout {
    transition: transform 220ms ease-out;
  }
}

/* Use the lowest print detail across all colors of each design. */
.hw-shirt-display :where(li.product, .hw-card, .hw-tee):where(.post-72, .post-89, .post-130, .post-147, .post-196, .post-213, .post-315, .post-332, .post-365, .post-432, .post-480, .post-498, .post-509, .post-522, .post-766, .post-802, .post-824, .post-845, .post-921, .post-949, .post-990, .post-1021, .post-1048, .post-1072, .post-1104, .post-1126, .post-1184, .post-1236, .post-1262, .post-1307, .post-1331, .post-1348, .post-1410, .post-1442, .post-1487, .post-1543, .post-1566, .post-1598, .post-1618, .post-1650, .post-1672, .post-1708, .post-1740, .post-1771, .post-1805, .post-1837, .post-1870, .post-1897, .post-1931, .post-1953, .post-1975, .post-2035, .post-2059, .post-2091, .post-2109, .post-2136, .post-2164, .post-2199, .post-2273, .post-2335, .post-2356, .post-2378, .post-2401, .post-2436, .post-2462, .post-2485, .post-2514, .post-2542, .post-2558, .post-2586, .post-2609, .post-2637, .post-2669, .post-2694, .post-2752, .post-2809, .post-2830, .post-2849, .post-2880, .post-2910, .post-2927, .post-2957, .post-2986) { --hw-hem-stop: 87%; }
.hw-shirt-display :where(li.product, .hw-card, .hw-tee):where(.post-163, .post-180, .post-1162, .post-2300) { --hw-hem-stop: 89%; }
.hw-shirt-display :where(li.product, .hw-card, .hw-tee):where(.post-348, .post-463, .post-877, .post-2228, .post-2724, .post-2781) { --hw-hem-stop: 91%; }
.hw-shirt-display :where(li.product, .hw-card, .hw-tee):where(.post-1376, .post-1464) { --hw-hem-stop: 93%; }

/* The catalog's fish show through a 10% paper wash. On product pages retain 90% of that contrast. */
body.hw-shirt-display.single-product #content {
  --hw-product-paper-wash: rgba(251, 247, 239, .19);
  background-color: var(--hw-paper, #fbf7ef);
  background-image: linear-gradient(var(--hw-product-paper-wash), var(--hw-product-paper-wash)),
    url("/wp-content/uploads/hw-display/20261125-1/fast-fish-field-6e616fa31b.webp");
  background-position: center, 50% 22px;
  background-repeat: repeat;
  background-size: auto, 620px 494px;
}
@media (max-width: 760px) {
  body.hw-shirt-display.single-product #content { background-size: auto, 452px 360px; }
}

/* Reserve space while WooCommerce initializes the front and collar slides. */
.single-product .woocommerce-product-gallery:has(img.hw-front-cutout) > .flex-viewport {
  width: 100%;
  aspect-ratio: 1;
  height: auto !important;
  container-type: inline-size;
}
.single-product .woocommerce-product-gallery:has(img.hw-front-cutout) > .flex-viewport > .woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image {
  max-width: 100cqi;
}
