/* Native introductions: a broad title, offset introduction and panoramic image. */
body.nuweb-site #content .subhero :is(.subhero-grid, .solution-detail-hero-grid) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 34px;
}

body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 22px;
  width: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 0;
}

body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy, .legal-hero-copy) h1 {
  width: 100%;
  max-width: none;
  margin: 0;
  font-size: clamp(44px, 7vw, 98px);
  line-height: 1.04;
  letter-spacing: -.04em;
  word-spacing: .08em;
  text-wrap: balance;
}

body.nuweb-site #content .subhero :is(.subhero-kicker, .solution-detail-copy > .meta) {
  margin: 0;
  font-size: var(--nuweb-eyebrow-size);
  line-height: 1.5;
}

body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy) > p:not(.subhero-kicker):not(.meta) {
  justify-self: end;
  width: min(100%, 55ch);
  max-width: none;
  margin: 0;
  font-size: 19px;
  line-height: 1.55;
}

body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy) > :is(.button, .text-link),
body.nuweb-site #content .subhero .website-landing-actions {
  justify-self: start;
  margin: 0;
  padding: 0;
}

body.nuweb-site #content .subhero .website-landing-actions {
  gap: 28px;
}

/* A CTA shares the introduction's track and starts at its left edge. */
@media (min-width: 701px) {
  body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy):has(> .button, > .text-link, > .website-landing-actions) {
    grid-template-columns: minmax(0, 1fr) minmax(0, min(100%, 55ch));
    column-gap: 0;
  }

  body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy):has(> .button, > .text-link, > .website-landing-actions) > :is(.subhero-kicker, .meta, h1) {
    grid-column: 1 / -1;
  }

  body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy):has(> .button, > .text-link, > .website-landing-actions) > p:not(.subhero-kicker):not(.meta) {
    grid-column: 2;
    justify-self: start;
    width: 100%;
  }

  body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy):has(> .button, > .text-link, > .website-landing-actions) > :is(.button, .text-link, .website-landing-actions) {
    grid-column: 2;
  }
}

body.nuweb-site #content .subhero .subhero-visual {
  grid-column: 1;
  grid-row: auto;
  width: 100%;
  min-width: 0;
  margin: 0;
}

body.nuweb-site #content .subhero :is(.subhero-media, .detail-media, .website-landing-hero-media) {
  position: relative;
  inset: auto;
  width: 100%;
  height: clamp(220px, 30svh, 380px);
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  aspect-ratio: auto;
  overflow: clip;
  border: 0;
  border-radius: 0;
}

body.nuweb-site #content .subhero :is(.subhero-media, .detail-media, .website-landing-hero-media) picture {
  display: block;
  width: 100%;
  height: 100%;
}

body.nuweb-site #content .subhero :is(.subhero-media, .detail-media, .website-landing-hero-media) img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

/* This template places its image before its copy in the source. */
body.nuweb-site #content .subhero.website-landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 34px;
  min-height: 0;
}

body.nuweb-site #content .subhero.website-landing-hero .website-landing-hero-inner {
  grid-column: 1;
  grid-row: 1;
  order: 0;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
}

body.nuweb-site #content .subhero.website-landing-hero .website-landing-hero-media {
  grid-column: 1;
  grid-row: 2;
  order: 1;
}

/* Portraits keep their complete composition on an open row below the title. */
body.nuweb-site #content .subhero.contact-hero .contact-portrait {
  width: min(100%, 420px);
  margin-inline: auto 0;
}

/* The existing story stage reserves space for the fixed header and lower edge. */
@media (min-width: 1051px) and (min-height: 651px) {
  body.nuweb-site #content .page-story:not(.story--linear) .scene--page:has(.subhero) .subhero :is(.subhero-grid, .solution-detail-hero-grid),
  body.nuweb-site #content .page-story:not(.story--linear) .scene--page:has(.subhero) .subhero.website-landing-hero {
    gap: 22px;
  }

  body.nuweb-site #content .page-story:not(.story--linear) .scene--page:has(.subhero) .subhero :is(.subhero-copy, .solution-detail-copy) {
    gap: 14px;
  }

  body.nuweb-site #content .page-story:not(.story--linear) .scene--page:has(.subhero) .subhero h1 {
    max-width: none;
    font-size: clamp(42px, 5vw, 76px);
    line-height: 1.04;
  }

  body.nuweb-site #content .page-story:not(.story--linear) .scene--page:has(.subhero) .subhero :is(.subhero-copy, .solution-detail-copy) > p:not(.subhero-kicker):not(.meta) {
    font-size: 18px;
    line-height: 1.5;
  }

  body.nuweb-site #content .page-story:not(.story--linear) .scene--page:has(.subhero) .subhero :is(.subhero-media, .detail-media, .website-landing-hero-media) {
    height: min(22svh, 230px);
  }

  body.nuweb-site #content .page-story:not(.story--linear) .scene--page:has(.subhero) .subhero :is(.subhero-media, .detail-media, .website-landing-hero-media) img {
    height: 100%;
    max-height: none;
  }
}

@media (max-width: 1050px) {
  body.nuweb-site #content .subhero :is(.subhero-grid, .solution-detail-hero-grid),
  body.nuweb-site #content .subhero.website-landing-hero {
    gap: 28px;
  }

  body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy) {
    gap: 18px;
  }

  body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy, .legal-hero-copy) h1 {
    font-size: clamp(38px, 6.7vw, 68px);
  }

  body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy) > p:not(.subhero-kicker):not(.meta) {
    font-size: 18px;
  }
}

@media (max-width: 700px) {
  body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy, .legal-hero-copy) h1 {
    max-width: none;
    font-size: clamp(36px, 9.2vw, 58px);
    letter-spacing: -.04em;
  }

  body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy) > p:not(.subhero-kicker):not(.meta) {
    justify-self: start;
    width: 100%;
    font-size: 17px;
    line-height: 1.6;
  }

  body.nuweb-site #content .subhero :is(.subhero-copy, .solution-detail-copy) > :is(.button, .text-link),
  body.nuweb-site #content .subhero .website-landing-actions {
    justify-self: start;
  }

  body.nuweb-site #content .subhero :is(.subhero-media, .detail-media, .website-landing-hero-media) {
    height: clamp(200px, 32svh, 280px);
  }

  body.nuweb-site #content .subhero.contact-hero .contact-portrait {
    margin-inline: 0;
  }
}

/* Regular hero images keep their native proportions; overflow uses the normal story flow. */
body.nuweb-site #content .subhero:not(.about-hero):not(.contact-hero):not(.support-hero):not(.solutions-hero) :is(.subhero-media, .detail-media, .website-landing-hero-media) {
  height: auto;
  max-height: none;
  aspect-ratio: auto;
}
body.nuweb-site #content .subhero:not(.about-hero):not(.contact-hero):not(.support-hero):not(.solutions-hero) :is(.subhero-media, .detail-media, .website-landing-hero-media) picture {
  height: auto;
}
body.nuweb-site #content .page-story .scene-content .subhero:not(.about-hero):not(.contact-hero):not(.support-hero):not(.solutions-hero) :is(.subhero-media, .detail-media, .website-landing-hero-media) img,
body.nuweb-site #content .subhero:not(.about-hero):not(.contact-hero):not(.support-hero):not(.solutions-hero) :is(.subhero-media, .detail-media, .website-landing-hero-media) img {
  height: auto;
  max-height: none;
  object-fit: contain;
}
