/*
 * Phase 2 — User Guide styling. All chapter-body rules are scoped to
 * `.help-content` so the typography in `app/views/help/chapters/*.html`
 * doesn't leak into the rest of the dealer UI. The Phase 1 build runs
 * kramdown with `header_offset: 1`, so chapter `## N.N` headings render
 * as `<h3>`, `### N.N.N` as `<h4>`, and so on.
 *
 * The `.help-icon` rule at the bottom belongs to Phase 4 (per-page "?"
 * affordance) but the styling lives here so the help system's CSS sits
 * in one file.
 */

/* Smooth-scroll for in-page anchor jumps. Kept on the document root so
 * the browser handles the scroll for any anchor link, including the ones
 * the help_toc_controller wires up dynamically. */
html {
  scroll-behavior: smooth;
}

.help-content {
  color: #1f2937;
  line-height: 1.65;
  max-width: 70ch;
}

.help-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-top: 0.25rem;
  scroll-margin-top: 1.5rem;
}

.help-content h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #111827;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  scroll-margin-top: 1.5rem;
}

.help-content h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.help-content p {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.help-content ul,
.help-content ol {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.help-content ul {
  list-style: disc;
}

.help-content ol {
  list-style: decimal;
}

.help-content li {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.help-content li > ul,
.help-content li > ol {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.help-content a {
  color: #2563eb;
  text-decoration: underline;
}

.help-content a:hover {
  color: #1d4ed8;
}

.help-content strong {
  font-weight: 600;
  color: #111827;
}

.help-content em {
  font-style: italic;
}

.help-content code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  background-color: #f3f4f6;
  color: #111827;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
}

.help-content pre {
  background-color: #f3f4f6;
  color: #111827;
  padding: 1rem;
  border-radius: 0.375rem;
  overflow-x: auto;
  margin-top: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.help-content pre code {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

/* Chapter-opening "Audience:" / "Purpose:" callouts come through as
 * blockquotes from the markdown source. Style them as a left-bordered
 * card so they read as a callout, not a quotation. */
.help-content blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid #3b82f6;
  background-color: #eff6ff;
  color: #1e3a8a;
  border-radius: 0 0.375rem 0.375rem 0;
}

.help-content blockquote p {
  margin: 0.25rem 0;
}

.help-content blockquote strong {
  color: #1e3a8a;
}

/* Status / matrix tables (chapters 5, 9, 11). */
.help-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

.help-content th,
.help-content td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.help-content thead {
  background-color: #f9fafb;
}

.help-content th {
  font-weight: 600;
  color: #111827;
}

.help-content tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.help-content hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 2rem 0;
}

/* ---------------------------------------------------------------- */
/* Phase 4 — per-page "?" affordance.
 *
 * The icon is rendered by `HelpHelper#help_icon` next to a page's <h1>
 * and links into the right chapter (and anchor) for that page. Subtle
 * by default, brighter on hover so it reads as secondary chrome rather
 * than a primary action. The CSS lands in this file in Phase 2 so the
 * whole help system's styling lives together. */
.help-icon {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.7em;
  vertical-align: middle;
  color: #6b7280;
  opacity: 0.55;
  text-decoration: none;
  transition: opacity 120ms ease, color 120ms ease;
}

.help-icon:hover,
.help-icon:focus {
  opacity: 1;
  color: #2563eb;
  text-decoration: none;
}
