/* ==========================================================================
   HOW IT WORKS — the How it works page, on Page. Its title and opening
   section are About's (about.css); this file lays out the ways to watch and
   the remaining sections.
   Markup: templates/node/node--page--how-it-works.html.twig,
   templates/partial/ways-to-watch.html.twig.
   ========================================================================== */

/* ---------- WAYS TO WATCH ---------- */
/* A Stage band in the reading column. Cheapest first; on wider screens the
   steps rise from left to right, the last (campus) highest. */

.otb-ways {
  --ways-rise: var(--space-8);
  margin-top: var(--space-12);
  padding: var(--space-8) var(--space-5) var(--space-4);
  border-radius: var(--border-radius-lg);
}

.otb-ways__title {
  margin: 0 0 var(--space-6);
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-light);
  line-height: 1.2;
}

.otb-ways__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.otb-ways__step {
  display: flex;
  border-top: 2px solid var(--color-text-primary);
}

.otb-ways__step--campus {
  border-top-color: var(--color-violet);
}

.otb-ways__link {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) 0 var(--space-6);
  color: var(--color-text-primary);
  text-decoration: none;
}

.otb-ways__label {
  font-family: var(--font-family-display);
  font-size: var(--font-size-h2);
  font-weight: var(--font-weight-light);
  line-height: var(--line-height-display);
  letter-spacing: var(--letter-spacing-display);
}

.otb-ways__step--campus .otb-ways__label {
  color: var(--color-violet);
}

.otb-ways__line {
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  line-height: 1.5;
}

a.otb-ways__link:hover .otb-ways__label,
.otb-ways__line a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* The campus step holds two links of its own. */
.otb-ways__line a {
  color: var(--color-text-primary);
}

/* ---------- SECTIONS ---------- */
/* The body after the opening, one section to a row: heading, then text. */

.otb-how__sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  margin-top: var(--space-16);
}

.otb-how__section {
  padding-top: var(--space-5);
  border-top: 2px solid var(--color-text-primary);
  overflow-wrap: break-word;
}

.otb-how__section h2 {
  margin: 0 0 var(--space-4);
}

.otb-how__section > :where(p, ul, ol, div) {
  max-width: 680px;
  margin: 0 0 var(--space-4);
}

.otb-how__section > :last-child {
  margin-bottom: 0;
}

/* A call to action staff may close the body with: its heading reads as a
   subheading of the section it ends. */
.otb-how__section > div h2 {
  margin-top: var(--space-8);
  font-size: var(--font-size-lg);
}

.otb-how__section a:not(.btn) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

@media (min-width: 769px) {
  .otb-ways {
    --ways-rise: var(--space-10);
    margin-top: var(--space-16);
    padding: var(--space-12) var(--space-10) var(--space-6);
  }

  .otb-ways__title {
    margin-bottom: var(--space-8);
  }

  .otb-ways__list {
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    align-items: start;
    column-gap: var(--space-6);
  }

  /* Each step stands one rise above the one before it. */
  .otb-ways__step:nth-last-child(2) {
    margin-top: var(--ways-rise);
  }

  .otb-ways__step:nth-last-child(3) {
    margin-top: calc(2 * var(--ways-rise));
  }

  .otb-ways__step:nth-last-child(4) {
    margin-top: calc(3 * var(--ways-rise));
  }

  .otb-ways__label {
    font-size: var(--font-size-display-s);
  }

  .otb-ways__line {
    font-size: var(--font-size-sm);
  }

  .otb-how__sections {
    margin-top: var(--space-24);
  }

  /* The heading in the left third, the text beside it. Twenty rows is
     "all of them" for a section; text beyond them still keeps its column. */
  .otb-how__section {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: var(--space-6);
  }

  .otb-how__section > * {
    grid-column: 2;
  }

  .otb-how__section > h2 {
    grid-row: 1 / span 20;
    grid-column: 1;
  }
}
