/* Complete architectural photographs in measured frames, at every viewport. */
body.world38 main :is(
  .w38-hero-image,
  .w38-system-image,
  .w38-case-image,
  .w38p-family-image,
  .w38p-card-image,
  .w38p-p5-hero-media,
  .w38p-related-card > div,
  .configuration-cover,
  .w38s-about-photo,
  .a29-lihe-photo,
  .a29-factory-photo,
  .a29-workshop .a29-tab-panel figure,
  .w38s-resource-photo,
  .visit-grid > figure
) {
  background: var(--wash, #f3f5f1);
  min-width: 0;
}

body.world38 main :is(
  .w38-hero-image,
  .w38-system-image,
  .w38-case-image,
  .w38-brand-story,
  .w38-project-picture,
  .w38-next-project,
  .w38p-family-image,
  .w38p-card-image,
  .w38p-product-cover,
  .w38p-related-card,
  .configuration-cover,
  .w38s-about-photo,
  .a29-lihe-photo,
  .a29-factory-photo,
  .a29-workshop .a29-tab-panel figure,
  .w38s-resource-photo,
  .visit-grid > figure
) img {
  object-fit: scale-down;
  object-position: center;
  transform: none;
  transition: filter .2s ease;
}

/* These cards share a frame within each collection; portrait images keep their edges. */
body.world38 main .w38-system-image,
body.world38 main .w38p-card-image {
  aspect-ratio: 4 / 3;
}

body.world38 main .w38-case-image {
  aspect-ratio: 3 / 2;
}

body.world38 main .w38p-family-image {
  aspect-ratio: 8 / 5;
}

body.world38 main :is(
  .w38-system-image,
  .w38-case-image,
  .w38p-family-image,
  .w38p-card-image
) img {
  width: 100%;
  height: 100%;
}

/* Clear previous per-product padding so the image itself determines its fit. */
body.world38 main .w38p-family-card .w38p-family-image img,
body.world38 main :is(.w38p-catalogue, .w38p-family-page) .w38p-card-image img,
body.world38 main .w38p-product-cover .w38p-p5-hero-media img {
  padding: 0;
  object-fit: scale-down;
}

body.world38 main :is(
  .w38-system-card:hover,
  .w38-case-card:hover,
  .w38p-family-card:hover,
  .w38p-card:hover,
  .w38p-related-card:hover
) img {
  transform: none;
}

body.world38 main .w38-next-project img {
  background: var(--wash, #f3f5f1);
}

/* Separate the opening photograph from the introduction so neither obscures the other. */
body.world38 main > .w38-hero {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: clamp(32px, 4vw, 56px);
  align-items: center;
  width: calc(100% - 96px);
  max-width: 1280px;
  min-height: 0;
  height: auto;
  max-height: none;
  margin-inline: auto;
  padding-block: 48px 56px;
  background: var(--paper, #fff);
}

body.world38 main .w38-hero-image[data-w41-carousel] {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: 560px;
  aspect-ratio: 4 / 3;
}

body.world38 main .w38-hero-image[data-w41-carousel] .w41-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: scale-down;
  object-position: center;
}

body.world38 main .w38-hero-inner {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: none;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 0;
}

body.world38 main .w38-hero-copy {
  width: 100%;
  max-width: 540px;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 1060px) and (min-width: 761px) {
  body.world38 main > .w38-hero {
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    gap: 32px;
    padding-block: 40px;
  }
}

@media (max-width: 760px) {
  body.world38 main > .w38-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    width: calc(100% - 44px);
    padding-block: 24px 38px;
  }

  body.world38 main .w38-hero-image[data-w41-carousel] {
    grid-column: 1;
    grid-row: 1;
    aspect-ratio: 3 / 2;
    height: auto;
    max-height: 420px;
  }

  body.world38 main .w38-hero-inner {
    grid-column: 1;
    grid-row: 2;
  }

  body.world38 main .w38p-product-cover .w38p-p5-hero-media {
    height: clamp(280px, 78vw, 390px);
  }
}

@media (max-width: 360px) {
  body.world38 main > .w38-hero {
    width: calc(100% - 36px);
    gap: 24px;
  }
}
