/* The drinks guide. Loaded after styles.css, which supplies the tokens, the
   bar, display type, swatches and the paper grain. This page scrolls normally
   and nothing on it jitters: it is for reading. */

/* No section paging here. */
html {
  scroll-snap-type: none;
}

.guide {
  max-width: 1200px;
  margin-inline: auto;
  padding: calc(var(--bar-h) + clamp(2rem, 7vh, 5rem)) var(--pad) clamp(3rem, 8vh, 6rem);
}

.guide a {
  color: inherit;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ---------- Opening ---------- */

.guide__title {
  font-size: clamp(3.25rem, 12vw, 10rem);
  margin-top: 0.75rem;
}

.guide__intro {
  font-size: var(--text-mid);
  line-height: 1.4;
  max-width: 40ch;
  margin-top: 1.25rem;
}

.guide__h2 {
  font-size: clamp(2rem, 4.6vw, 3.75rem);
  line-height: 0.96;
}

/* The squad as a row of shortcuts. */
.jump {
  margin-top: clamp(2rem, 5vh, 3.5rem);
  border-bottom: 2px solid var(--ink);
}

.jump__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: 0.75rem;
}

.jump__link {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  padding-bottom: 0.5rem;
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
}

.jump__link svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: clamp(64px, 9vw, 104px);
}

.jump__link:hover span {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* ---------- Chapters: the story, what gets added, the drinks ---------- */

.chapter {
  margin-top: clamp(3rem, 9vh, 6rem);
}

.guide__lede {
  font-size: var(--text-mid);
  line-height: 1.4;
  max-width: 44ch;
  margin-top: 0.9rem;
}

/* Bean, grind, espresso: three steps that every drink shares. */
.story {
  counter-reset: chapter;
  display: grid;
  gap: 2.5rem clamp(2rem, 4vw, 3.5rem);
  margin-top: clamp(1.75rem, 5vh, 3rem);
}

.story__step {
  counter-increment: chapter;
  display: grid;
  gap: 0.75rem;
  align-content: start;
  max-width: 46ch;
}

/* The bottom border is the ground each drawing sits on. */
.story__art {
  border-bottom: 2px solid var(--ink);
}

.story__art svg {
  display: block;
  width: auto;
  height: clamp(110px, 13vw, 160px);
}

.story__title {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1;
  margin-top: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.story__title::before {
  content: counter(chapter);
  display: grid;
  place-items: center;
  width: 1.15em;
  height: 1.15em;
  font-size: 0.7em;
  background: var(--orange);
  color: var(--ink);
}

.story__punch {
  font-size: var(--text-mid);
  font-weight: 700;
  line-height: 1.3;
}

/* ---------- What gets added ---------- */

.basics__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1.5rem 2.5rem;
  margin-top: 1.75rem;
}

.basics__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.9rem;
  align-items: start;
}

.basics__item .swatch {
  width: 26px;
  height: 26px;
  margin-top: 0.15rem;
}

.basics__name {
  font-size: var(--text-mid);
  line-height: 1.3;
}

/* ---------- One drink ---------- */

#drinks {
  margin-top: clamp(1.75rem, 5vh, 3rem);
}

.drink {
  display: grid;
  /* A definite column, so the steps wrap to the screen instead of widening it. */
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(2.5rem, 7vh, 5rem);
  border-top: 2px solid var(--ink);
  /* Clears the fixed bar when a link jumps here. */
  scroll-margin-top: var(--bar-h);
}

.drink__art svg {
  display: block;
  width: auto;
  height: clamp(150px, 26vw, 300px);
}

.drink__name {
  font-size: clamp(2.75rem, 7vw, 5.5rem);
}

.drink__line {
  font-size: var(--text-mid);
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0.6rem;
}

.drink__what {
  font-size: var(--text-mid);
  line-height: 1.45;
  max-width: 46ch;
  margin-top: 1rem;
}

.drink__sub {
  font-size: 1rem;
  margin-top: clamp(1.5rem, 4vh, 2.25rem);
}

/* The steps: the same cup, filling up. */
.making {
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1.25rem 1.5rem;
  margin-top: 0.9rem;
  max-width: 620px;
}

.making__step {
  counter-increment: step;
  font-size: 0.9rem;
  line-height: 1.45;
}

.making__cup {
  display: block;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 0.6rem;
}

.making__cup svg {
  display: block;
  width: auto;
  height: 104px;
}

.making__step p::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.5rem;
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1;
  background: var(--orange);
  color: var(--ink);
}

.facts {
  display: grid;
  gap: 0.55rem;
  margin: clamp(1.5rem, 4vh, 2.25rem) 0 0;
  max-width: 56ch;
}

.facts__row {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  column-gap: 1rem;
}

.facts dt {
  font-weight: 700;
}

.facts dd {
  margin: 0;
}

.drink__fact {
  margin-top: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--ink);
  max-width: 46ch;
  font-size: 0.9rem;
}

.guide__back {
  padding-top: clamp(2rem, 6vh, 3.5rem);
  border-top: 2px solid var(--ink);
  font-size: var(--text-mid);
  font-weight: 700;
}

/* ---------- Wider screens ---------- */

@media (min-width: 720px) {
  .jump__list {
    grid-template-columns: repeat(9, minmax(0, 1fr));
  }

  .story {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .drink {
    grid-template-columns: minmax(180px, 30%) minmax(0, 1fr);
  }

  /* The character stays in view while its entry is read. */
  .drink__art {
    position: sticky;
    top: calc(var(--bar-h) + 1.5rem);
    align-self: start;
    display: grid;
    justify-items: center;
  }
}
