/* The guides: the site's look (styles.css), set for reading. A sidebar of guides, one column
   of text, real screenshots, and steps counted with rising level meters, the brand's mark. */

.learn-shell {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 56px) var(--gutter) clamp(56px, 8vw, 110px);
}

/* Sidebar */
.guides { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; }
.guides details { border: 0; }
.guides summary { display: none; }
.guides ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.guides a {
  display: block; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-size: 0.95rem; line-height: 1.35;
}
.guides a:hover { color: var(--text); background: var(--raised); }
.guides a[aria-current="page"] { color: var(--text); background: var(--raised); box-shadow: inset 3px 0 0 var(--purple); }
.guides .home { margin-bottom: 10px; color: var(--text); font-weight: 600; }

/* The guide */
.guide { max-width: 44rem; min-width: 0; }
.guide > header { display: flex; flex-direction: column; gap: 14px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.guide h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.guide .summary { font-size: 1.12rem; color: var(--muted); max-width: 38rem; }
.toc { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.92rem; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--text); }

.guide section { padding-top: 44px; display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 90px; }
.guide h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.guide h3 { font-size: 1.15rem; margin-top: 10px; }
.guide p, .guide li { line-height: 1.7; }
.guide p { color: #d8d5e6; max-width: 38rem; }
.guide ul { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 6px; color: #d8d5e6; max-width: 38rem; }
.guide strong { color: var(--text); font-weight: 600; }

/* Steps: a real sequence, counted by meters that rise with each step. */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; max-width: 38rem; }
.steps > li { counter-increment: step; position: relative; padding-left: 52px; min-height: 30px; color: #d8d5e6; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0.1em;
  width: 32px; height: 26px; border-radius: 7px;
  display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  background: var(--raised); border: 1px solid var(--line);
}
.steps > li::after {
  /* the meter: taller with every step, orange for the first like the logo */
  content: ""; position: absolute; left: 36px; bottom: calc(100% - 1.75em);
  width: 5px; border-radius: 3px; background: var(--purple);
  height: min(calc(6px + (var(--n, 1) * 4px)), 26px);
}
.steps > li:first-child::after { background: var(--orange); }

/* Labels the person clicks, and keys */
.ui { font-weight: 600; color: var(--text); background: rgba(139, 92, 246, 0.14); padding: 1px 7px; border-radius: 6px; white-space: nowrap; }
kbd {
  font: inherit; font-size: 0.88em; font-weight: 600; color: var(--text);
  padding: 1px 7px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--raised); white-space: nowrap;
}

/* Tip: a quiet margin note */
.tip { border-left: 3px solid var(--orange); padding: 4px 0 4px 16px; color: var(--muted); max-width: 38rem; }
.tip strong { color: var(--text); }

/* Screenshots */
.guide figure { margin: 8px 0 0; }
.guide figure img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); }
.guide figcaption { color: var(--muted); font-size: 0.88rem; margin-top: 8px; }

/* Reference tables */
.ref { width: 100%; border-collapse: collapse; font-size: 0.95rem; max-width: 40rem; }
.ref th, .ref td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.ref th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.ref td:first-child { white-space: nowrap; padding-right: 18px; }

/* Previous / next */
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--text); font-weight: 600; max-width: 48%; }
.pager a span { color: var(--muted); font-weight: 400; font-size: 0.85rem; }
.pager .next { text-align: right; margin-left: auto; }

/* The Learn home: a list, not a grid of cards */
.learn-home { max-width: 1040px; margin: 0 auto; padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(56px, 8vw, 110px); }
.learn-home > header { display: flex; flex-direction: column; gap: 18px; max-width: 44rem; margin-bottom: 40px; }
.learn-home h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
.learn-home .summary { color: var(--muted); font-size: 1.15rem; }
.guide-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.guide-list li { border-bottom: 1px solid var(--line); }
.guide-list a {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 8px 32px; align-items: baseline;
  padding: 22px 4px; text-decoration: none; color: var(--text);
}
.guide-list a:hover .title { color: var(--purple-soft); }
.guide-list .title { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; }
.guide-list .what { color: var(--muted); }
.start-here { color: var(--orange); font-size: 0.9rem; font-weight: 600; margin-left: 8px; }

@media (max-width: 900px) {
  .learn-shell { grid-template-columns: minmax(0, 1fr); }
  .guides { position: static; max-height: none; }
  .guides summary { display: block; cursor: pointer; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 600; }
  .guides details[open] summary { margin-bottom: 8px; }
  .guide-list a { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 901px) {
  .guides details > ol { display: flex; }
}
