/* ============================================================================
   Help
   ----------------------------------------------------------------------------
   The public documentation pages: the /help topic index and its articles.
   The index is a grid of whole-card topic links (same anatomy as the project
   portfolio cards); articles are flowing prose on the page background at a
   readable measure — long-form text in full-width boxed cards reads badly.
   ============================================================================ */

@layer components {
  /* --- Topic index --------------------------------------------------------- */
  .help-topics {
    list-style: none;
    margin: 0 0 var(--space-5);
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
  }
  .help-topics > li { margin: 0; }

  /* The whole card is one link (nothing else on it is interactive), so it
     carries the card surface plus its own hover cue. */
  .help-topic {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    height: 100%;
    padding: var(--space-4) var(--space-5);
    background: var(--bg-primary);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: inherit;
  }
  .help-topic:hover {
    text-decoration: none;
    border-color: var(--border-strong);
  }
  .help-topic:hover .help-topic-title { text-decoration: underline; text-underline-offset: 2px; }
  .help-topic-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent);
  }
  .help-topic-copy {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
  }
  .help-topic-title { font-weight: 500; }
  .help-topic-summary { color: var(--text-secondary); font-size: 13px; }

  /* --- Articles ------------------------------------------------------------ */
  .help-article {
    /* A comfortable prose measure; the page header above stays full width. */
    max-width: 640px;
  }
  /* Each section's h2 is its first child, so the base h2:first-child rule
     zeroes the heading's own top margin; the section rhythm lives here. */
  .help-article section + section { margin-top: var(--space-8); }

  /* The rates on the metrics page: term over quiet definition, one hairline
     between entries so the list scans as rows without becoming a table. */
  .help-definitions { margin: var(--space-4) 0 0; }
  .help-definitions dt { font-weight: 500; }
  .help-definitions dd {
    margin: var(--space-1) 0 0;
    color: var(--text-secondary);
  }
  .help-definitions dd + dt {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 0.5px solid var(--border);
  }
}
