/* How To page — page-specific styles. Tokens, base form controls, button
   variants, and the .rb-topnav primitive come from /shared/brand.css. */

html { scroll-behavior: smooth; }

#app {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#page-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 0 4px 0;
}
.page-sub a { color: var(--fg-muted); }
.page-sub a:hover { color: var(--accent); }

/* Table of contents */
.ht-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ht-toc-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ht-toc-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.ht-toc-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ht-toc-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.ht-toc a {
  font-size: 14px;
  color: var(--fg);
  text-decoration: none;
}
.ht-toc a:hover { color: var(--accent); }

/* Sections */
.ht-section {
  border-top: 1px solid var(--border);
  padding: 28px 0 4px;
  /* keep anchor targets clear of the sticky topnav */
  scroll-margin-top: 76px;
}
/* On narrow screens the sticky topnav wraps to several rows, so anchor
   targets need much more clearance. */
@media (max-width: 920px) {
  .ht-section { scroll-margin-top: 150px; }
}
.ht-section h2 {
  margin: 0 0 10px;
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ht-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  padding: 3px 8px;
  white-space: nowrap;
}
.ht-section p,
.ht-section li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
}
.ht-lede {
  color: var(--fg-muted);
  margin: 0 0 12px;
}
.ht-section ul {
  margin: 0 0 12px;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Numbered steps */
.ht-steps {
  list-style: none;
  counter-reset: ht-step;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ht-steps > li {
  counter-increment: ht-step;
  position: relative;
  padding-left: 42px;
}
.ht-steps > li::before {
  content: counter(ht-step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-muted);
  background: var(--surface);
}

/* Embedded demo video */
.ht-video {
  margin: 4px 0 16px;
}
.ht-video video {
  display: block;
  width: 100%;
  height: auto;
  background: var(--rb-black);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.ht-video figcaption {
  margin-top: 6px;
  font-size: 13px;
  color: var(--fg-subtle);
}

/* Callout note */
.ht-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  margin: 4px 0 12px;
}

/* Inline code */
.ht-section code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* Keyboard shortcut table */
.ht-kbd {
  border-collapse: collapse;
  margin: 4px 0 12px;
  font-size: 14px;
}
.ht-kbd caption {
  caption-side: top;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 8px;
}
.ht-kbd td {
  border-top: 1px solid var(--border);
  padding: 7px 24px 7px 0;
  vertical-align: top;
}
.ht-kbd td:first-child { white-space: nowrap; }
.ht-kbd kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 7px;
  display: inline-block;
  min-width: 16px;
  text-align: center;
}

.ht-footer {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  font-size: 13px;
  color: var(--fg-subtle);
  margin: 0;
}

@media (max-width: 640px) {
  .ht-toc-cols { grid-template-columns: 1fr; }
  .ht-steps > li { padding-left: 36px; }
}
