/* Keep editorial photography readable as a complete frame on desktop screens. */
@media (min-width: 801px) {
  :root {
    --article-image-max: min(78vh, 780px, calc(100vh - 150px));
    --article-image-max: min(78dvh, 780px, calc(100dvh - 150px));
  }

  /* Shared editorial articles: preserve the complete photograph and its ratio. */
  .editorial-article .ea-hero-image img,
  .editorial-article .ea-media:not(.ea-media-crop) img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: var(--article-image-max);
    margin-inline: auto;
    object-fit: contain;
  }

  .editorial-article .ea-media:not(.ea-media-crop) {
    min-height: 0;
  }

  /* The interiors feature uses full-width asymmetric layouts; only the image
     itself is reduced, while its grid position and caption remain unchanged. */
  .interiors-feature figure img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: var(--article-image-max);
    margin-inline: auto;
    object-fit: contain;
  }

  /* Notes images are intentionally wide, but should still fit in one view. */
  .notes-essay .notes-hero-image img,
  .notes-essay .notes-image img {
    width: auto;
    max-width: 100%;
    max-height: var(--article-image-max);
    margin-inline: auto;
    object-fit: contain;
  }

  /* The fashion article slices each source triptych into one outfit. Keep the
     crop, but cap each portrait so the complete look fits on a laptop screen. */
  .interview-edit .ie-hero-image {
    width: auto;
    max-width: 100%;
    max-height: var(--article-image-max);
    margin-inline: auto;
    object-fit: contain;
  }

  .interview-edit .look-image:not(.look-image--landscape):not(.look-image--cinematic) {
    width: min(100%, 39vh, 390px, calc(50vh - 75px));
    width: min(100%, 39dvh, 390px, calc(50dvh - 75px));
    height: auto;
    min-height: 0;
    max-height: var(--article-image-max);
    aspect-ratio: 1 / 2;
    justify-self: center;
  }

  .interview-edit .look-image--landscape,
  .interview-edit .look-image--cinematic {
    max-height: var(--article-image-max);
  }

  /* Hair feature hero and its one oversized lead card. */
  .issue-page .issue-hero-real {
    height: min(72vh, 720px, calc(100vh - 150px));
    height: min(72dvh, 720px, calc(100dvh - 150px));
    min-height: 0;
  }

  .issue-page .editorial-grid figure:first-child img {
    width: auto;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: var(--article-image-max);
    margin-inline: auto;
  }
}

@media (min-width: 901px) {
  .article-leftover-acoustic-panel-ideas .editorial-article .ea-hero-image {
    overflow: hidden;
  }

  .article-leftover-acoustic-panel-ideas .editorial-article .ea-hero-image img {
    width: 100%;
    max-width: none;
    height: min(50vh, 480px);
    height: min(50dvh, 480px);
    min-height: 0;
    max-height: none;
    margin: 0;
    object-fit: cover;
    object-position: center 58%;
  }

  .article-leftover-acoustic-panel-ideas .editorial-article > .ea-section:first-of-type {
    padding-top: 32px;
  }
}

/* On the 2026–27 bedroom feature, mobile layouts should show the full frame. */
@media (max-width: 700px) {
  .article-bedroom-trends-2026-27 .ea-hero-image img,
  .article-bedroom-trends-2026-27 .ea-media:not(.ea-media-crop) img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    object-fit: contain;
  }
}

@media (min-width:801px) {
  .article-the-new-japandi .ea-media img[src*="01-silhouette-v3"],
  .article-the-new-japandi .ea-media img[src*="02-grounded-v4"] {
    width:min(100%, calc(var(--article-image-max) * 1.5));
    aspect-ratio:3/2;
  }
}
