/** XD image hero: two-line title, upper-right annotation, lower-left caption. */
.hero {
  padding-block: clamp(3rem, 5.4vw, 6.5rem) var(--space-4);
}

.hero__heading {
  margin-block-end: clamp(2rem, 3.2vw, 3.8rem);
  color: var(--color-ink);
}

.hero__heading h1 {
  max-inline-size: 22ch;
  margin: 0;
}

.hero__eyebrow {
  display: block;
  margin-block-end: 0;
  font-size: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: var(--tracking-open);
}

.hero__figure {
  position: relative;
  inline-size: min(var(--width-page), calc(100% - 2 * clamp(1rem, 3.65vw, 4.375rem)));
  margin-inline: auto;
}

.hero__media {
  position: relative;
  inline-size: 100%;
  block-size: 100dvh;
  mask: url('../../images/design/hero-mask.svg') center / 100% 100% no-repeat;
}

.hero__media video {
  position: absolute;
  inset: 0;
}

.hero__media .media-image,
.hero__media .media--type-video,
.hero__media picture,
.hero__media :is(img, video) {
  display: block;
  inline-size: 100%;
  block-size: 100%;
}

.hero__media :is(img, video) {
  object-fit: cover;
  object-position: center;
}

.hero__note {
  position: absolute;
  /* The top-right cutout ends 161.9 units down the 917-unit mask. */
  inset-block: 0 82.35%;
  inset-inline-end: 9%;
  display: grid;
  align-content: safe center;
  inline-size: 24%;
  font-size: var(--font-small);
  line-height: 1.25;
  letter-spacing: var(--tracking-open);
}

.hero__caption {
  position: absolute;
  inset-inline-start: 4.25%;
  inset-block-end: 0;
  inline-size: 15%;
  margin: 0;
  font-size: clamp(0.75rem, 0.938vw, 1.125rem);
}

.hero__plain-intro {
  margin-block-start: var(--space-4);
}

/* The teaching landing page uses an unnotched image and a title overlay. */
.hero--image-overlay {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-block: 0;
}

.hero--image-overlay .hero__heading {
  grid-area: 1 / 1;
  z-index: 1;
  align-self: end;
  padding-block: var(--space-4);
  color: var(--color-paper);
}

.hero--image-overlay .hero__visual {
  grid-area: 1 / 1;
}

.hero--image-overlay .hero__figure {
  grid-area: 1 / 1;
  inline-size: 100%;
}

.hero--image-overlay .hero__media {
  mask: none;
  border-radius: 0;
  background: var(--color-dark);
}

.hero--image-overlay .hero__media :is(img, video) {
  opacity: 0.65;
}

.hero__overlay-intro {
  margin-block: var(--space-4);
}

.hero--image-overlay .hero__caption {
  position: static;
  inline-size: auto;
  margin-inline: var(--page-gutter);
}

@media (max-width: 47.99rem) {
  .hero__media {
    mask: none;
    overflow: hidden;
    border-radius: var(--radius-card);
  }

  /* Notes enter normal flow so translated text cannot collide with the image. */
  .hero__note,
  .hero__caption {
    position: static;
    inline-size: auto;
    margin: 1rem 0 0;
  }
}

.hero__facts {
  margin: 0;
}

.hero__facts > div {
  display: flex;
  gap: 0.4em;
}

.hero__facts dt {
  font-weight: 500;
}

.hero__facts dd {
  margin: 0;
}

.hero--teaching .hero__heading h1 {
  max-inline-size: min(100%, 48.25rem);
  line-height: 1.33;
  text-wrap: wrap;
}

.hero__title-lead {
  display: block;
  font-weight: 400;
}

.hero--teaching .hero__facts {
  font-size: clamp(1rem, 1.302vw, 1.5625rem);
  font-weight: 500;
}

.hero--teaching .hero__caption {
  font-weight: 500;
}

@media (min-width: 48rem) {
  .hero--teaching .hero__facts {
    inset-inline-end: 12.3%;
    inline-size: 22.5%;
  }
}

.hero--teaching .hero__visual {
  position: relative;
  isolation: isolate;
}

/* The learning-page band continues behind the lower part of the notched image. */
.hero--teaching .hero__visual::before {
  position: absolute;
  z-index: -1;
  inset: 55% 0 0;
  content: '';
  background: var(--color-lime-pale);
}

.hero__teaching-intro {
  padding-block: var(--space-5) var(--space-6);
  background: var(--color-lime-pale);
  font-size: clamp(1.25rem, 2.083vw, 2.5rem);
  font-weight: 500;
  line-height: 1.35;
}

@media (min-width: 48rem) and (max-width: 63.99rem) {
  /* Lesson captions can be explanatory sentences; keep them clear of the cutout. */
  .hero--teaching .hero__caption {
    position: static;
    inline-size: auto;
    margin-block-start: 1rem;
  }
}
