/* Thumbnail windows only. Original files and the body-level image viewer stay intact. */
#wall-framing.web-card > figure,
#pausepoint.web-card > figure,
#focus-blocker.web-card > figure {
  position: relative;
  overflow: hidden;
  flex: none;
  aspect-ratio: var(--preview-ratio);
}

#wall-framing.web-card > figure > .image-link,
#pausepoint.web-card > figure > .image-link,
#focus-blocker.web-card > figure > .image-link {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
}

#wall-framing.web-card > figure img,
#pausepoint.web-card > figure img,
#focus-blocker.web-card > figure img {
  position: absolute;
  display: block;
  max-width: none;
  width: var(--preview-width);
  height: var(--preview-height);
  left: var(--preview-left, 0%);
  top: var(--preview-top, 0%);
  /* Override the older category-specific contain/cover rules without coupling to a panel. */
  object-fit: fill !important;
  object-position: 0 0;
  transform: none;
}

/* Native 1440 x 980; window (0, 75) through (945, 565).
   Keep wall settings, the Untitled Project sheet and its full dimensions. */
#wall-framing.web-card {
  --preview-ratio: 945 / 490;
  --preview-width: 152.380952%;
  --preview-height: 200%;
  --preview-top: -15.306122%;
}

/* The improved 1600 x 1000 front capture uses the same (0,75)-(945,565) window. */
#wall-framing.web-card > figure img[src$="wall-framing-front.png"] {
  width: 169.312169%;
  height: auto;
}

/* Optional parent markup: figure.wall-framing-previews with two image links.
   Each link remains its own thumbnail window and full-original viewer target. */
#wall-framing.web-card > figure.wall-framing-previews {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  aspect-ratio: auto;
  overflow: visible;
}

#wall-framing.web-card > figure.wall-framing-previews > .image-link {
  position: relative;
  inset: auto;
  min-width: 0;
  aspect-ratio: 945 / 490;
}

/* Until an actual plan capture is available, do not inherit the front crop. */
#wall-framing.web-card > figure img[src$="wall-framing-plan.png"] {
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  object-fit: contain !important;
  object-position: top left;
  background: #f8f9f4;
}

@media (max-width: 680px) {
  #wall-framing.web-card > figure.wall-framing-previews {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Native 1080 x 2400; a 1080 x 607.5 window preserves the header and button.
   Both app frames use 16:9; image scaling stays proportional. */
#pausepoint.web-card {
  --preview-ratio: 16 / 9;
  --preview-width: 100%;
  --preview-height: 395.061728%;
}

#pausepoint.web-card > figure img,
#focus-blocker.web-card > figure img {
  height: auto;
}

/* Native 1080 x 2400; focus on countdown setup, rule sets and delay presets.
   Remove system bars, navigation and the lower empty-countdown section. */
#focus-blocker.web-card {
  --preview-ratio: 16 / 9;
  --preview-width: 100%;
  --preview-height: 395.061728%;
  --preview-top: -54.320988%;
}
