/* css/page-help.css — page-scoped styles for the Help library (js/pages/help.js).
 *
 * Structure and the 768px behaviour follow page-settings.css: a sticky left
 * index plus a content pane, collapsing to a wrapped chip row on a phone. Names
 * are help-* scoped for the same reason that file is settings-* scoped — page
 * work never reaches into main.css / chrome.css / datatable.css.
 *
 * Vars are chrome.css's --color-* family.
 */

.help-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .help-layout { grid-template-columns: 1fr; }
}

/* --- topic index --- */

.help-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
}
.help-nav-group {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-secondary);
  padding: 0.75rem 0.75rem 0.25rem;
}
.help-nav-group:first-child { padding-top: 0; }
.help-nav-item {
  display: block;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border: none;
  border-left: 2px solid transparent;
  background: transparent;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  cursor: pointer;
}
.help-nav-item:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}
.help-nav-item.active {
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: 600;
}
@media (max-width: 768px) {
  .help-nav {
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
    align-items: center;
  }
  .help-nav-group {
    width: 100%;
    padding: 0.5rem 0 0.15rem;
  }
  .help-nav-item {
    border-left: none;
    border: 1px solid var(--color-border);
  }
  .help-nav-item.active { border-color: var(--color-primary); }
}

/* --- the article ---
   The reading measure is capped on the TEXT, not on the article, so a wide
   element can still use the full pane while prose stays at a comfortable line
   length. max-width is in ch, not px: these are paragraphs, and a 100-column
   line is the difference between help that gets read and help that gets
   skimmed and misunderstood. */

.help-article {
  min-width: 0;
  max-width: 100%;
  color: var(--color-text);
  font-size: 0.875rem;
  line-height: 1.65;
}
.help-article > p,
.help-article > .help-list,
.help-article > .help-h,
.help-article-title,
.help-article-summary {
  max-width: 72ch;
}
.help-article-title {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.35rem;
}
.help-article-summary {
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
  margin: 0 0 1rem;
}
.help-open {
  margin: 0 0 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.help-open a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}
.help-open a:hover { text-decoration: underline; }

.help-h {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.75rem 0 0.5rem;
}
.help-h:first-child { margin-top: 0; }
.help-article p { margin: 0 0 0.9rem; }
.help-list { margin: 0 0 0.9rem; padding-left: 1.35rem; }
.help-list li { margin-bottom: 0.4rem; }
.help-list li:last-child { margin-bottom: 0; }

/* A caution, not a decoration: warning-toned rule on the reading edge so it is
   findable when someone scrolls back looking for "the thing that bit me". */
.help-note {
  border-left: 3px solid var(--color-warning);
  background: var(--color-bg-surface);
  padding: 0.7rem 0.9rem;
  border-radius: 0 6px 6px 0;
  margin: 0 0 1.1rem;
}

/* --- screenshots ---
   Captured at 2x against a synthetic fixture (scripts/help-shots/), so the
   intrinsic size is double the rendered one and they stay crisp on a retina
   screen. The border matters: most of these are screenshots of a white UI on a
   white page, and without it the image has no edge. */
.help-figure {
  margin: 0 0 1.25rem;
  max-width: 1000px;
}
/* Portrait shots (a phone screenshot) opt in via { narrow: true } in the
   content. Without a cap one renders ~950px wide and over 2000px tall, and the
   rest of the topic is below the fold for no benefit. */
.help-figure-narrow {
  max-width: 300px;
}
.help-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.help-figure figcaption {
  max-width: 72ch;
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--color-text-secondary);
}
