/* Copyright © 2026 Wayne Davies. Free software under the GNU General Public License, version 3 or later. */
/* SPDX-License-Identifier: GPL-3.0-or-later. See LICENSE in the project root. */

/* The website tutorials, on the product page's tokens and parts (../site.css): each tutorial is a
   line, its steps the stops along it. Every class here starts with t-. */

.t-main {
  max-width: calc(var(--max) + 2 * var(--page));
  margin: 0 auto;
  padding: 0 var(--page) 96px;
}
.t-verse {
  --line: var(--verse);
  --line-ink: var(--verse-ink);
}
.t-chorus {
  --line: var(--chorus);
  --line-ink: var(--chorus-ink);
}
.t-bridge {
  --line: var(--bridge);
  --line-ink: var(--bridge-ink);
}
.t-other {
  --line: var(--other);
  --line-ink: var(--other-ink);
}
.top nav a[aria-current="page"] {
  color: var(--text);
}

/* ---------- the head of a page ---------- */

.t-hero {
  padding: 64px 0 0;
}
.t-crumbs {
  margin-bottom: 14px;
  color: var(--mute);
  font-size: 15px;
  font-weight: 700;
}
.t-crumbs a {
  color: var(--line-ink);
}
.t-hero h1 {
  font-size: clamp(36px, 5.2vw, 68px);
  max-width: 18ch;
}
.t-lead {
  margin-top: 18px;
  max-width: 56ch;
  color: var(--mute);
  font-size: 20px;
}
.t-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  color: var(--mute);
  font-size: 15px;
  font-weight: 700;
}
.t-meta li,
.t-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.t-meta svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--line-ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.t-makes {
  margin-top: 26px;
  max-width: 62ch;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--rail);
  color: var(--mute);
}
.t-makes b {
  color: var(--text);
}
.t-keys {
  margin-top: 14px;
  color: var(--mute);
  font-size: 14px;
}

/* ---------- the steps as a route, across the top ---------- */

.t-stops {
  margin-top: 40px;
  padding: 18px 18px 14px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: var(--rail);
  overflow-x: auto;
  scrollbar-width: none;
}
.t-stops::-webkit-scrollbar {
  display: none;
}
.t-stops ol {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}
.t-stops ol::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 17px;
  right: 17px;
  height: 8px;
  border-radius: 4px;
  background: var(--line);
}
.t-stops a {
  position: relative;
  display: grid;
  gap: 10px;
  justify-items: start;
  padding-right: 14px;
  color: var(--mute);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}
.t-stops a:hover,
.t-stops a.here {
  color: var(--text);
}
.t-stops i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 0 0 3px var(--rail);
  color: var(--ground);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
  transition: box-shadow 200ms var(--ease);
}
.t-stops a.here i {
  box-shadow:
    0 0 0 3px var(--rail),
    0 0 0 6px var(--now);
}

/* ---------- the steps ---------- */

.t-steps {
  position: relative;
  margin-top: 24px;
  padding-left: var(--gutter);
}
.t-steps::before {
  content: "";
  position: absolute;
  top: 76px;
  bottom: 0;
  left: 13px;
  width: 8px;
  border-radius: 4px;
  background: var(--line);
}
.t-step {
  position: relative;
  padding-top: 72px;
}
.t-stn {
  position: absolute;
  top: 70px;
  left: calc(var(--gutter) * -1);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 0 0 3px var(--ground);
  color: var(--ground);
  font-size: 14px;
  font-weight: 800;
  z-index: 1;
  transition: box-shadow 200ms var(--ease);
}
.t-step.here .t-stn {
  box-shadow:
    0 0 0 3px var(--ground),
    0 0 0 6px var(--now);
}
.t-step h2 {
  font-size: clamp(24px, 2.6vw, 34px);
  max-width: 26ch;
}
.t-why {
  margin-top: 10px;
  max-width: 62ch;
  color: var(--mute);
  font-size: 18px;
}
.t-do {
  margin: 18px 0 0;
  padding: 0 0 0 1.3em;
  max-width: 66ch;
}
.t-do li {
  margin-top: 8px;
  padding-left: 4px;
}
.t-do li::marker {
  color: var(--line-ink);
  font-weight: 800;
}
.t-do a,
.t-after a {
  color: var(--line-ink, var(--verse-ink));
  font-weight: 700;
}
.t-main kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0 6px;
  border: 1px solid var(--ghost);
  border-radius: 6px;
  background: var(--rail);
  font: inherit;
  font-size: 0.88em;
  font-weight: 700;
  text-align: center;
}
.t-main code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--rail);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  overflow-wrap: anywhere;
}
.t-tip {
  margin-top: 18px;
  max-width: 66ch;
  padding: 12px 16px;
  border-left: 4px solid var(--now);
  border-radius: 0 10px 10px 0;
  background: var(--rail);
  color: var(--mute);
  font-size: 16px;
}
.t-tip b {
  color: var(--text);
}
.t-shot {
  margin-top: 28px;
  max-width: 1040px;
}
.t-shot img {
  width: 100%;
}
.t-shot.tall {
  max-width: 340px;
  border-radius: 20px;
}
.t-shot.tall.narrow {
  max-width: 230px;
}

/* ---------- on to the next ---------- */

.t-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 88px;
}
.t-card {
  display: grid;
  gap: 2px;
  padding: 18px 22px;
  border: 2px solid var(--hair);
  border-radius: 16px;
  text-decoration: none;
  transition: border-color 120ms var(--ease);
}
.t-card:hover {
  border-color: var(--text);
}
.t-card span {
  color: var(--mute);
  font-size: 14px;
  font-weight: 700;
}
.t-card b {
  font-size: 20px;
  font-weight: 800;
}
.t-fwd {
  text-align: right;
  border-color: var(--line);
}

/* ---------- the list of tutorials ---------- */

.t-index .t-hero h1 {
  max-width: 16ch;
}
.t-list {
  margin: 56px 0 0;
  padding: 0;
  list-style: none;
}
.t-item {
  position: relative;
  padding: 0 0 40px var(--gutter);
}
.t-item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 13px;
  width: 8px;
  background: var(--line);
}
.t-item:first-child::before {
  top: 30px;
  border-radius: 4px 4px 0 0;
}
.t-item:last-child {
  padding-bottom: 0;
}
.t-item:last-child::before {
  bottom: auto;
  height: 30px;
}
.t-item .t-stn {
  top: 26px;
  left: 0;
}
.t-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 40px;
  align-items: center;
  padding: 22px 24px;
  border: 1px solid var(--hair);
  border-radius: 16px;
  background: var(--rail);
  text-decoration: none;
  transition: border-color 120ms var(--ease);
}
.t-row:hover {
  border-color: var(--line);
}
.t-text {
  display: grid;
  gap: 8px;
}
.t-title {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.15;
}
.t-row:hover .t-title {
  color: var(--line-ink);
}
.t-blurb {
  max-width: 48ch;
  color: var(--mute);
}
.t-row .t-meta {
  margin-top: 6px;
}
.t-thumb {
  display: block;
  box-shadow: none;
}
.t-thumb img {
  width: 100%;
}
.t-after {
  margin-top: 56px;
  max-width: 62ch;
  color: var(--mute);
}
.t-after b {
  color: var(--text);
}

/* ---------- narrower ---------- */

@media (max-width: 760px) {
  .top nav a.t-keep {
    display: block;
    padding: 8px 10px;
  }
  .t-main {
    padding-bottom: 64px;
  }
  .t-hero {
    padding-top: 36px;
  }
  .t-lead {
    font-size: 18px;
  }
  .t-stops {
    margin: 28px calc(var(--page) * -1) 0;
    border-width: 1px 0;
    border-radius: 0;
    padding-left: var(--page);
  }
  .t-stops ol {
    grid-auto-columns: 124px;
    width: max-content;
  }
  .t-step {
    padding-top: 56px;
  }
  .t-stn {
    top: 52px;
  }
  .t-steps::before {
    top: 58px;
  }
  .t-why {
    font-size: 17px;
  }
  /* A whole window is unreadable this small: the picture keeps a readable size and scrolls sideways,
     starting at the part the step is about (data-x, tutorials.js). */
  .t-shot:not(.tall) {
    margin-right: calc(var(--page) * -1);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    overflow-x: auto;
  }
  .t-shot:not(.tall) img {
    width: 760px;
    max-width: none;
  }
  .t-next {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 64px;
  }
  .t-fwd {
    text-align: left;
  }
  .t-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
  }
  .t-list {
    margin-top: 40px;
  }
  .t-item {
    padding-bottom: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .t-stops i,
  .t-stn,
  .t-card,
  .t-row {
    transition: none;
  }
}
