/* Guide pages: a sticky contents list beside a reading column. Loaded after styles.css. */

.guide {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  padding-top: 48px;
  padding-bottom: 96px;
}

.toc {
  position: sticky;
  top: 88px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  font-size: 0.92rem;
}

.toc p {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.toc ol {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.toc li { margin: 0; }

.toc a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover,
.toc a.active {
  color: var(--text);
  border-left-color: var(--accent);
}

.toc ol ol a {
  padding-left: 24px;
  font-size: 0.88rem;
}

.doc {
  max-width: 780px;
  min-width: 0;
}

.doc-head {
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.doc-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin-bottom: 14px;
}

.doc-head .lede { max-width: none; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 28px 0 0;
}

.facts div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}

.facts dt {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
  font-size: 0.95rem;
}

.doc h2 {
  font-size: 1.9rem;
  margin: 72px 0 16px;
  padding-top: 8px;
}

.doc h2:first-of-type { margin-top: 0; }

.doc h3 {
  font-size: 1.3rem;
  margin: 40px 0 12px;
}

.doc h4 {
  font-size: 1.05rem;
  margin: 28px 0 8px;
}

.doc p, .doc li { color: var(--text); }

.doc :not(pre) > code { overflow-wrap: anywhere; }

.doc ul, .doc ol { padding-left: 24px; margin: 0 0 16px; }

.doc li { margin: 6px 0; }

.doc .code { margin: 20px 0 24px; }

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}

.doc th, .doc td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.doc th {
  font-weight: 650;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

/* Callouts: <aside class="callout tip|warn|note"><strong>Title</strong><p>…</p></aside> */

.callout {
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 24px 0;
}

.callout > strong {
  display: block;
  margin-bottom: 4px;
}

.callout p:last-child { margin-bottom: 0; }

.callout.tip { border-left-color: #1f9d55; }
.callout.warn { border-left-color: #d97706; }

/* Numbered walkthrough: <ol class="steps"><li><h4>…</h4>…</li></ol> */

.steps {
  list-style: none;
  counter-reset: step;
  padding-left: 0 !important;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 48px;
  margin: 28px 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}

.steps > li > h4 { margin-top: 4px; }

.next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.next a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
}

.next a span {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 2px;
}

.top nav a.current { color: var(--text); font-weight: 600; }

@media (max-width: 900px) {
  .guide { grid-template-columns: 1fr; gap: 24px; padding-top: 32px; }
  .toc {
    position: static;
    max-height: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    background: var(--surface);
  }
  .toc ol ol { display: none; }
  .toc ol { margin-bottom: 0; }
}
