/* A course site's landing page (app/shared/templates/course-page): the layout every course page
   shares, on the site system. The page's <html> sets data-brand, and brands.css gives each course
   its paper, accent and the solid band behind the hero; this file keeps only the layout (the
   hero's text beside its image, the split sections, the columns, the reviews and the plans).
   The page imports the site system itself, so this file imports nothing. */
.course :where(h1, h2, h3, p, ol, ul, li) {
  margin: 0;
  padding: 0;
}

.course :where(ol, ul) {
  list-style: none;
}

/* Type roles. */
.course-eyebrow {
  color: var(--ink-dim);
  font-family: var(--font-ui);
  font-size: var(--text-kicker);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.course-title {
  font-size: var(--text-display);
  font-weight: var(--weight-regular);
  line-height: var(--leading-display);
  letter-spacing: -0.01em;
}

.course-lede {
  color: var(--ink-soft);
  font-size: var(--text-lede);
  line-height: var(--leading-lede);
}

.course-lede-line {
  display: block;
}

.course-heading {
  font-size: var(--text-h1);
  line-height: var(--leading-h1);
  text-align: center;
}

.course-subheading {
  font-size: var(--text-h2);
  line-height: var(--leading-heading);
}

.course-copy {
  color: var(--ink-soft);
}

.course-copy p + p {
  margin-top: var(--space-4);
}

.course-note {
  color: var(--ink-dim);
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  text-align: center;
}

/* A band: a full-width section with its content in the wide frame. Bands alternate paper and
   the soft paper; the hero is the brand's band color. */
.course-band {
  display: flex;
  justify-content: center;
  background: var(--bg);
}

.course-band.is-textured,
.course-band.is-deep {
  background: var(--bg-soft);
}

.course-band-inner {
  width: 100%;
  max-width: calc(var(--band-width, var(--site-wide)) + 2 * var(--site-gutter));
  padding: var(--band-pad-top, var(--section-space)) var(--site-gutter) var(--band-pad-bottom, var(--section-space));
}

/* The hero: the title and signup on the brand's band, the hero image filling the right-hand
   column from edge to edge. */
.course-hero {
  display: grid;
  grid-template-columns:
    max(var(--site-gutter), (100% - var(--site-wide)) / 2)
    minmax(0, 1fr)
    var(--space-16)
    minmax(0, 0.6fr);
  min-height: 40rem;
}

.course-hero-text {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-block: var(--section-space);
}

.course-hero-text > .course-signup {
  margin-top: var(--space-4);
}

.course-hero-image {
  position: relative;
  grid-column: 4;
  grid-row: 1;
}

.course-hero-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* The lead magnet's signup, used twice: an email field and a button under it. On the band the
   button is the band's ink. */
.course-signup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  width: 28rem;
  max-width: 100%;
}

.course-signup.is-centered {
  align-items: center;
  margin-inline: auto;
}

.course-honeypot {
  display: none;
}

.course-signup input[type='email'] {
  width: 100%;
}

.course-signup button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-height);
  padding-inline: var(--control-padding-x);
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.course-signup button:hover {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
}

.course-hero .course-signup button {
  border-color: var(--band-ink);
  background: var(--band-ink);
  color: var(--band);
}

.course-signup button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.course-signup button svg {
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* While a signup is being sent, the design system's is-loading spinner stands in for the
   chevron. */
.course-signup button.is-loading svg {
  display: none;
}

.course-signup-status {
  font-family: var(--font-ui);
  font-size: var(--text-ui);
  line-height: var(--leading-body);
}

.course-signup.is-centered .course-signup-status {
  text-align: center;
}

/* Our promise. */
.course-promise {
  --band-width: var(--site-measure);

  text-align: center;
}

.course-promise .course-heading {
  margin-top: var(--space-4);
}

.course-divider {
  width: 4rem;
  margin: var(--space-6) auto 0;
  border: 0;
  border-top: 2px solid var(--accent);
}

.course-promise-text {
  margin-top: var(--space-6);
  color: var(--ink-soft);
  font-size: var(--text-lede);
  line-height: var(--leading-lede);
}

/* The thinker, the lecturers and the lead magnet: two equal columns, centred on each other. */
.course-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: var(--space-16);
  align-items: center;
}

.course-split .course-copy {
  margin-top: var(--space-6);
}

.course-portrait {
  justify-self: center;
  width: 100%;
  height: 28rem;
  overflow: hidden;
}

/* A portrait too small to fill the column, such as a 200px profile photo, keeps near its own size
   rather than blurring. */
.course-portrait.is-small {
  width: 14rem;
  height: 14rem;
}

.course .course-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Curriculum: the numbered weeks, the number in the accent. */
.course-weeks {
  max-width: var(--site-measure);
  margin-top: var(--space-6);
  counter-reset: week;
  font-size: var(--text-lede);
  line-height: var(--leading-lede);
}

.course-weeks li {
  display: flex;
  gap: var(--space-3);
  counter-increment: week;
}

.course-weeks li + li {
  margin-top: var(--space-3);
}

.course-weeks li::before {
  flex-shrink: 0;
  min-width: 1.25rem;
  color: var(--accent);
  content: counter(week) '.';
  font-family: var(--font-ui);
  font-weight: var(--weight-semibold);
}

/* The two full-width pictures between sections. */
.course .course-gallery img {
  display: block;
  width: 100%;
  height: 20rem;
  object-fit: cover;
  object-position: center;
}

/* The Course Experience. */
.course-experience-intro {
  --band-width: var(--site-measure);
  --band-pad-bottom: var(--space-8);
}

.course-experience-intro .course-note {
  margin-top: var(--space-3);
}

.course-experience {
  --band-pad-top: var(--space-8);
  --band-pad-bottom: var(--space-8);
}

.course-experience.is-last {
  --band-pad-bottom: var(--section-space);
}

.course-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--space-12);
  align-items: start;
}

.course-columns .course-copy {
  margin-top: var(--space-4);
}

/* Reviews of Past Courses: three portraits a row, each with its name and quote. */
.course-reviews-intro {
  --band-pad-bottom: var(--space-8);
}

.course-reviews {
  --band-width: 48rem;
  --band-pad-top: 0rem;
}

.course-review-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: var(--space-10);
  align-items: start;
}

.course-review-row + .course-review-row {
  margin-top: var(--space-12);
}

.course .course-review img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center;
}

.course-review p {
  margin-top: var(--space-3);
  color: var(--ink-soft);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

/* Enroll and the prices: hairline plan cards on paper, one column each. */
.course-enroll {
  --band-width: var(--site-measure);
  --band-pad-bottom: var(--space-8);
}

.course-plans-band {
  --band-width: 56rem;
  --band-pad-top: 0rem;
}

/* Three plans take the wide frame, so each card keeps the width of two. */
.course-plans-band:has(.course-plan:nth-child(3)) {
  --band-width: var(--site-wide);
}

.course-plans {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  column-gap: var(--space-8);
  align-items: stretch;
}

.course-plan {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-8);
  border: 1px solid var(--rule);
  background: var(--bg-elevated);
}

.course-plan-name {
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: var(--text-kicker);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.course-plan-price {
  font-family: var(--font-heading);
  font-size: var(--text-h1);
  line-height: var(--leading-h1);
}

.course-plan-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--ink-soft);
}

.course-plan-features li {
  display: flex;
  gap: var(--space-3);
}

.course-plan-features li::before {
  flex-shrink: 0;
  color: var(--accent);
  content: '✓';
  font-family: var(--font-ui);
}

.course-plan.is-featured {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* The list takes the card's spare height, so every Enroll button sits on one line at the bottom. */
.course-plan-features {
  flex-grow: 1;
}

.course-plan-features strong {
  color: var(--ink);
}

.course-plan-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  gap: var(--space-2);
  height: var(--control-height);
  padding-inline: var(--control-padding-x);
  border-radius: var(--radius-control);
  background: var(--accent);
  font-family: var(--font-ui);
  font-size: var(--text-ui-lg);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.course .course-plan-button,
.course .course-plan-button:hover {
  color: var(--accent-ink);
}

.course-plan-button:hover {
  background: var(--accent-deep);
}

.course-plan-button svg {
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

/* The lead magnet: its cover beside the second signup. */
.course-syllabus .course-cover {
  justify-self: center;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
}

.course-syllabus-signup {
  text-align: center;
}

.course-syllabus-signup .course-subheading {
  text-align: center;
}

.course-syllabus-signup .course-signup {
  margin-top: var(--stack-md);
}

/* Tablets: the hero stacks, its image across the top and the title under it. */
@media (max-width: 980px) {
  .course-hero {
    grid-template-columns: var(--site-gutter) minmax(0, 1fr) var(--site-gutter);
  }

  .course-hero-image {
    grid-column: 1 / -1;
    grid-row: 1;
    height: 24rem;
  }

  .course-hero-text {
    grid-column: 2;
    grid-row: 2;
  }

  .course-split,
  .course-columns {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--stack-lg);
  }

  .course-plans {
    grid-auto-flow: row;
    row-gap: var(--stack-lg);
  }
}

@media (max-width: 640px) {
  .course-review-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--stack-lg);
  }

  .course .course-gallery img {
    height: 14rem;
  }

  .course-signup button {
    width: 100%;
  }
}

/* An introduction above the curriculum's numbered weeks, when the course has one. */
.course-curriculum .course-copy {
  max-width: var(--site-measure);
  margin-top: var(--space-6);
}
