/* What the long reading pages share, the primer and the guides: the column
   of text and its lead; the contents that open them and, on a wide screen,
   stand in the free column beside the text; the plaque in the heading; the
   lime block that closes them.
   Linked after a page's own styles, which these build on. */

/* One column of text at a reading width, opened by a larger lead. */
:is(.primer, .guide) {
  max-width: 48rem;
  padding-block: clamp(1rem, 5vw, 3rem);
}

:is(.primer, .guide) .lead {
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
}

/* The sections listed between two lines, each a link to its section. */
.contents {
  margin-top: 1.5rem;
  padding-block: 1.25rem;
  border-block: 1px solid var(--line);
}

.contents h2 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  letter-spacing: 0;
  color: var(--muted);
}

.contents ul {
  list-style: none;
  padding: 0;
}

.contents li {
  margin-bottom: 0.4rem;
}

/* A list of links reads as one without underlines; a link shows it is one
   when the pointer or the keyboard reaches it. */
.contents a {
  color: inherit;
  text-decoration: none;
}

.contents a:hover,
.contents a:focus-visible {
  text-decoration: underline;
}

/* On a wide screen the contents stand in the free column beside the text and
   stay in sight while the page scrolls; on a narrow one they are a list
   under the introduction. Positioned, they are painted over a grey band's
   edge as it passes. */
@media (min-width: 70rem) {
  :is(.primer, .guide) {
    display: grid;
    grid-template-columns: minmax(0, 48rem) 14rem;
    column-gap: 3rem;
    align-items: start;
    max-width: none;
  }

  :is(.primer, .guide) > * {
    grid-column: 1;
  }

  :is(.primer, .guide) > .contents {
    position: sticky;
    top: 1.5rem;
    z-index: 1;
    grid-column: 2;
    grid-row: 1 / span 30;
    margin-top: 0;
    font-size: 1rem;
  }
}

/* The plaque keeps its words on one line, so it reads as one name. */
:is(.primer, .guide) h1 .plaque {
  white-space: nowrap;
}

/* The one call on the page: the lime block the brief closes a page with. */
:is(.primer, .guide) .offer {
  margin-block: clamp(1.5rem, 5vw, 3rem) clamp(1rem, 4vw, 2rem);
  padding: clamp(1.5rem, 5vw, 3rem);
  border-radius: var(--radius);
  background: var(--lime);
}

.offer p {
  margin: 0 0 1.25rem;
}

.offer .closing {
  font-size: 1.25rem;
  font-weight: 700;
}
