.course-hero,
.section.chapter-section {
  width: min(var(--course-content-width), calc(100% - 2 * var(--course-page-gutter)));
  margin-inline: auto;
}

.course-hero {
  --course-hero-field: #e7e8e4;
  --course-hero-ink: #151515;
  --course-hero-accent: #1957a6;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-radius: 7px;
  background: var(--course-hero-field);
}

html[data-theme="dark"] .course-hero {
  --course-hero-field: #142438;
  --course-hero-ink: var(--text);
  --course-hero-accent: #a6caff;
}

.course-hero-photo {
  position: absolute;
  inset: 0 0 0 auto;
  width: 60%;
  height: 100%;
  object-fit: cover;
  object-position: 59% 50%;
  z-index: -1;
  mask-image: linear-gradient(to right, transparent, #000 23%);
}

html[data-theme="dark"] .course-hero-photo {
  filter: brightness(.78);
}

.course-hero-inner {
  min-height: clamp(321px, 28.33vw, 379px);
  padding: 30px clamp(20px, 3vw, 38px);
  display: flex;
  align-items: center;
}

.course-hero-copy {
  width: 47%;
}

.course-hero h1 {
  margin: 0;
  color: var(--course-hero-ink);
  font-size: clamp(28px, 4.7vw, 64px);
  font-weight: 760;
  line-height: 1.16;
  letter-spacing: .015em;
}

.course-hero h1 > span {
  display: block;
}

.course-hero-title-accent {
  color: var(--course-hero-accent);
}

.course-hero p {
  max-width: 26.5em;
  margin: 16px 0 0;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.7;
  text-wrap: balance;
}

.course-author {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  line-height: 1.45;
}

.course-author img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  flex: none;
}

.course-author strong,
.course-author span {
  display: block;
}

.course-author strong {
  font-size: 22px;
  font-weight: 750;
}

.course-author span {
  margin-top: 2px;
  font-size: 14px;
}

.section.chapter-section {
  padding: 38px 0 32px;
}

.chapter-section .chapter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.chapter-section .chapter-card {
  display: block;
  min-height: 0;
  padding: 0;
  border-radius: 7px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}

.chapter-card-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 31 / 16;
  object-fit: cover;
  background: var(--surface2);
}

.chapter-card-photo-04 {
  object-position: center 62%;
}

.chapter-card-copy {
  padding: 11px 17px 16px;
}

.chapter-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  line-height: 1.4;
}

.chapter-card-arrow {
  color: var(--accent);
  font-size: 21px;
  line-height: 1;
}

.chapter-card-copy h2 {
  margin: 6px 0 0;
  font-size: clamp(17px, 1.9vw, 23px);
  font-weight: 720;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .course-hero-inner {
    min-height: 292px;
  }

  .course-hero-copy {
    width: 49%;
  }

  .chapter-section .chapter-grid {
    gap: 14px;
  }

  .chapter-card-copy {
    padding-inline: 12px;
  }
}

@media (max-width: 700px) {
  .course-hero-photo {
    position: static;
    width: 100%;
    height: auto;
    aspect-ratio: 2.28;
    mask-image: none;
  }

  .course-hero {
    display: flex;
    flex-direction: column-reverse;
  }

  .course-hero-inner {
    width: 100%;
    min-height: 0;
    padding: 20px 20px 18px;
  }

  .course-hero-copy {
    width: 100%;
  }

  .course-hero h1 {
    font-size: clamp(23px, 7.8vw, 44px);
  }

  .course-hero p {
    margin-top: 9px;
  }

  .course-author {
    margin-top: 15px;
  }

  .course-author img {
    width: 43px;
    height: 43px;
  }

  .course-author strong {
    font-size: 18px;
  }

  .section.chapter-section {
    padding-block: 24px;
  }

  .chapter-section .chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 440px) {
  .chapter-section .chapter-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-section .chapter-card {
    transition: none;
  }
}
