/* Guides in open chapters: a chapter list, chapters, pull lines and figures.
   Loaded by each chaptered guide beside its own stylesheet. The study guide
   still carries its own copy of these rules in study-guide.css. */
.guide-article .sg-contents {
  margin: 36px 0 0;
  border-top: 1px solid var(--guide-line);
}

.guide-article .sg-contents ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sg-chapter;
}

.guide-article .sg-contents li {
  display: grid;
  grid-template-columns: 40px 1fr;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--guide-line);
  counter-increment: sg-chapter;
}

.guide-article .sg-contents li::before {
  content: counter(sg-chapter);
  grid-row: 1 / span 2;
  color: var(--purple);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
}

body.guide-page .guide-article .sg-contents a:not(.button) {
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
}

body.guide-page .guide-article .sg-contents a:not(.button):hover {
  color: var(--purple);
  text-decoration: underline;
}

.guide-article .sg-contents span {
  grid-column: 2;
  color: var(--guide-text);
  font-size: 15px;
  line-height: 1.5;
}

.guide-article .sg-chapter {
  margin-top: 72px;
  padding-top: 44px;
  border-top: 1px solid var(--guide-line);
  scroll-margin-top: 72px;
}

.guide-article .sg-chapter > * + * {
  margin-top: 18px;
}

.guide-article .sg-chapter-num {
  margin: 0;
  color: var(--purple);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.guide-page .guide-article .sg-chapter > h2 {
  margin-top: 6px;
  font-size: 32px;
  line-height: 1.25;
}

.guide-page .guide-article .sg-chapter h3 {
  margin-top: 40px;
  scroll-margin-top: 72px;
}

.guide-article .sg-pull {
  margin: 32px 0;
  padding-left: 18px;
  border-left: 3px solid var(--purple);
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.45;
}

.guide-article .sg-figure {
  margin: 36px 0;
}

.guide-article .sg-figure figcaption {
  margin-top: 12px;
  color: var(--guide-text);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .guide-article .sg-chapter {
    margin-top: 56px;
    padding-top: 36px;
  }

  .guide-page .guide-article .sg-chapter > h2 {
    font-size: 27px;
  }

  .guide-article .sg-pull {
    font-size: 20px;
  }
}

@media print {
  .guide-article .sg-chapter {
    margin-top: 0;
    border-top: 0;
    break-before: page;
  }

  .guide-article .sg-figure,
  .guide-article .sg-pull,
  .guide-article .sg-contents {
    break-inside: avoid;
  }

  /* The PDF has its own bookmarks, so the contents list prints as titles only. */
  .guide-article .sg-contents li {
    padding: 8px 0;
  }

  .guide-article .sg-contents span,
  .guide-article .sg-back {
    display: none;
  }
}

/* A product block that ends a chapter: the next chapter's rule is enough. */
.guide-article .sg-chapter > .guide-offer:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.guide-article .sg-back {
  margin-top: 32px;
  font-size: 14px;
}

/* The sign-up prompt above the chapter list: the site's button, without the
   rules a product block normally carries, since the chapter list has its own. */
body.guide-page .guide-article .guide-offer.sg-signup-top {
  margin-top: 24px;
  padding: 0;
  border: 0;
}

@media print {
  body.guide-page .guide-article .guide-offer.sg-signup-top {
    display: none;
  }
}
