/* Guided primers: the foreword page and the guide's margin notes. Every
   stylesheet loads everywhere, so everything here stays under the primer-
   prefix. */

/* The page styles itself without Bootstrap on purpose: a shared link renders
   it on the marketing layout, which carries none. */
.primer-foreword {
  max-width: 40rem;
  margin-inline: auto;
  padding: 2rem 1.5rem 4rem;
}

.primer-foreword__header {
  text-align: center;
  margin-bottom: 2rem;
}

.primer-foreword__emoji {
  font-size: 2.5rem;
}

.primer-foreword__name {
  margin-bottom: 0.25rem;
}

.primer-foreword__tagline {
  margin-bottom: 0;
  color: var(--bs-secondary-color);
}

.primer-foreword__guide {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.primer-foreword__guide-name {
  font-weight: 600;
}

.primer-foreword__credit {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

/* The guide's letter reads like a letter: prose measure, a little air. The
   paragraph rhythm is pinned here because the signed-out page renders
   without Bootstrap's reboot to supply it. */
.primer-foreword__letter {
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.primer-foreword__letter p {
  margin: 0 0 1rem;
}

.primer-foreword__signoff {
  font-style: italic;
  color: var(--bs-secondary-color);
}

/* No portrait assets yet, so the guide wears an initial-letter avatar. */
.primer-foreword__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bs-primary) 15%, transparent);
  color: var(--bs-primary);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
}

.primer-foreword__book {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  margin-bottom: 1.5rem;
}

/* Recognition, not progress: the book behind this pack is already on the
   user's shelf. */
.primer-foreword__library {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--bs-success-bg-subtle);
  color: var(--bs-success-text-emphasis);
}

/* The road ahead: the chapters this pack hands over one at a time, the open
   ones carrying the guide's introduction and the locked ones only a promise. */
.primer-foreword__chapters {
  margin-bottom: 2rem;
}

.primer-chapter {
  padding: 1rem 0;
  border-top: 1px solid var(--bs-border-color);
}

.primer-chapter__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.primer-chapter__title {
  font-size: 1.05rem;
  margin: 0;
}

.primer-chapter__count {
  flex: none;
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

.primer-chapter__intro {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

.primer-chapter--locked {
  color: var(--bs-tertiary-color);
}

.primer-foreword__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.primer-foreword__contents {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
}

/* The changelog at the foot of the page: upkeep, not the pitch, so it sits
   below the actions and reads a size down. */
.primer-foreword__editions {
  margin-top: 3rem;
}

.primer-foreword__editions-heading {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.primer-edition {
  padding: 1rem 0;
  border-top: 1px solid var(--bs-border-color);
  font-size: 0.9rem;
  line-height: 1.6;
}

.primer-edition p {
  margin: 0 0 0.5rem;
}

.primer-edition__date {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

/* The margin note under a revealed answer and on the fact's page: quiet
   marginalia in the guide's voice, never competing with the answer. */
.primer-aside {
  margin-top: 0.75rem;
  text-align: start;
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
}

.card .primer-aside {
  margin-inline: auto;
}

.primer-aside__note {
  font-style: italic;
  text-wrap: pretty;
}

.primer-aside__byline {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--bs-tertiary-color);
}
