/**
 * Hero. The root is the size container; .hero__inner responds to it.
 */
.hero {
  container-type: inline-size;
}

.hero__intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-s);
  width: 100%;
  max-width: var(--page-max-width);
  margin-inline: auto;
  padding: var(--space-s) var(--page-gutter) var(--space-m);
}

.hero__title {
  font-size: var(--font-size-display);
  font-weight: var(--font-weight-black);
}

.hero__aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.hero__description {
  font-size: var(--font-size-lead);
  line-height: var(--line-height-base);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
}

.hero__actions:not(:has(*)) {
  display: none;
}

.hero__media {
  overflow: hidden;
  aspect-ratio: 1;
  background-color: var(--dal-gray);
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero--no-image {
  padding-block-end: var(--space-l);
}

.hero--has-background .hero__intro {
  padding-block: var(--space-l);
}

@container (min-width: 48rem) {
  .hero__media {
    aspect-ratio: 8 / 3;
  }

  .hero--split .hero__intro {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
    column-gap: var(--space-l);
  }
}

/* Banner: image first on small screens, beside the text from 62rem. */
.hero--banner .hero__inner {
  display: flex;
  flex-direction: column-reverse;
}

.hero--banner .hero__media {
  position: relative;
  aspect-ratio: 3 / 2;
}

.hero--banner .hero__intro {
  align-content: center;
  max-width: none;
  padding: var(--space-l) var(--page-gutter);
}

/* dal.ca's home page banner: a black-weight title set tight, on pure black. */
.hero--banner .hero__title {
  font-size: var(--font-size-l);
  font-weight: var(--font-weight-black);
  line-height: 1.05;
}

.hero--banner[data-surface="black"] {
  --surface-bg: var(--dal-black-pure);
}

.hero--banner .hero__description {
  font-size: var(--font-size-s);
}

/* Side by side from 62rem, as on dal.ca's home page. */
@container (min-width: 62rem) {
  .hero--banner .hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  }

  .hero--banner .hero__media {
    aspect-ratio: 3 / 2;
  }

  /* The text band fades into the image. */
  .hero--banner .hero__media::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset-block: 0;
    inset-inline-start: 0;
    width: 8rem;
    background: linear-gradient(90deg, var(--surface-bg), transparent);
    pointer-events: none;
  }

  .hero--banner .hero__intro {
    padding: var(--space-xl);
  }
}
