/* ============================================================================
   help-center.css — public Help Center + shared article-content components.
   Scoped under .help-center; uses design tokens only (no raw px for type/
   spacing/radii per the UI-token doctrine). Class prefix: .help-*
   ============================================================================ */

.help-center {
  max-width: var(--max-content-w, 980px);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-3xl);
  color: var(--text);
  font-family: var(--font);
}

/* Public pages render inside .static-container, whose global rule
   `.static-container a { color: accent; text-decoration: underline }`
   (specificity 0,1,1) would underline every link here — including card
   titles, descriptions and breadcrumbs. Links in the Help Center get their
   own affordances (card/row hover, prose underline-on-hover) instead, so
   strip the inherited underline with a selector that outranks it. */
.static-container .help-center a,
.help-center a { text-decoration: none; }
.help-center .help-article-body a:hover,
.help-center .help-breadcrumb a:hover,
.help-center .help-still-stuck a:hover { text-decoration: underline; }

/* ── Hero + search ─────────────────────────────────────────────────────── */
.help-hero {
  text-align: center;
  padding: var(--space-2xl) var(--space-md) var(--space-xl);
}
.help-home-link {
  display: inline-block;
  font-size: var(--font-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: .02em;
  color: var(--text-3);
  text-decoration: none;
  margin-bottom: var(--space-sm);
}
.help-home-link span { color: var(--accent); }
.help-hero-title {
  font-size: var(--font-3xl);
  font-weight: var(--weight-bold);
  margin: 0 0 var(--space-lg);
}
.help-search-form {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.help-search-icon {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.help-search-input {
  width: 100%;
  height: var(--ctl-h-lg, 48px);
  padding: 0 var(--space-md) 0 calc(var(--space-md) * 2.4);
  font-size: var(--font-md);
  color: var(--text);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-full, 999px);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.help-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* Instant-search dropdown */
.help-search-results {
  max-width: 560px;
  margin: var(--space-xs) auto 0;
  text-align: left;
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.help-search-results a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  text-decoration: none;
  color: var(--text);
  border-bottom: var(--border-w) solid var(--border);
}
.help-search-results a:last-child { border-bottom: 0; }
.help-search-results a:hover,
.help-search-results a.is-active { background: var(--accent-bg); }
.help-search-results .hsr-title { font-weight: var(--weight-semibold); }
.help-search-results .hsr-cat { font-size: var(--font-xs); color: var(--text-3); }
.help-search-results .hsr-empty { padding: var(--space-md); color: var(--text-3); }

/* ── Category grid ─────────────────────────────────────────────────────── */
.help-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
}
.help-cat-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-lg);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.help-cat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.help-cat-title { font-size: var(--font-lg); font-weight: var(--weight-semibold); }
.help-cat-desc { font-size: var(--font-sm); color: var(--text-2); }
.help-cat-count { font-size: var(--font-xs); color: var(--text-3); margin-top: var(--space-xs); }

/* ── Breadcrumb ────────────────────────────────────────────────────────── */
.help-breadcrumb {
  font-size: var(--font-sm);
  color: var(--text-3);
  margin-bottom: var(--space-md);
}
.help-breadcrumb a { color: var(--accent); text-decoration: none; }
.help-breadcrumb span { margin: 0 var(--space-2xs); }
.help-breadcrumb .current { color: var(--text-2); }

/* ── Article list / rows ───────────────────────────────────────────────── */
.help-section-title { font-size: var(--font-2xl); font-weight: var(--weight-bold); margin: 0 0 var(--space-xs); }
.help-section-desc { color: var(--text-2); margin: 0 0 var(--space-lg); }
.help-art-row {
  display: block;
  padding: var(--space-md);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.help-art-row:hover { border-color: var(--accent); background: var(--accent-bg); }
.help-art-row-title { display: block; font-weight: var(--weight-semibold); }
.help-art-row-sum { display: block; font-size: var(--font-sm); color: var(--text-3); margin-top: var(--space-2xs); }
.help-lock { margin-left: var(--space-2xs); font-size: var(--font-xs); }
.help-art-row.is-locked { opacity: .85; }

/* ── Article page ──────────────────────────────────────────────────────── */
.help-article-page { max-width: 760px; margin: 0 auto; }
.help-article-title { font-size: var(--font-3xl); font-weight: var(--weight-bold); margin: 0 0 var(--space-xs); }
.help-article-summary { font-size: var(--font-lg); color: var(--text-2); margin: 0 0 var(--space-xl); }

.help-article-body { font-size: var(--font-md); line-height: var(--leading-loose, 1.7); }
.help-article-body h2 { font-size: var(--font-xl); margin: var(--space-xl) 0 var(--space-sm); }
.help-article-body h3 { font-size: var(--font-lg); margin: var(--space-lg) 0 var(--space-xs); }
.help-article-body p { margin: 0 0 var(--space-md); }
.help-article-body ul,
.help-article-body ol { margin: 0 0 var(--space-md); padding-left: var(--list-indent-base, 1.4em); }
.help-article-body li { margin-bottom: var(--space-2xs); }
.help-article-body a { color: var(--accent); }
.help-article-body code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--bg-2);
  padding: .1em .35em;
  border-radius: var(--radius-xs, 4px);
}
.help-article-body pre {
  background: var(--bg-2);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  overflow: auto;
}
.help-article-body pre code { background: none; padding: 0; }
.help-article-body blockquote {
  margin: 0 0 var(--space-md);
  padding: var(--space-xs) var(--space-md);
  border-left: 3px solid var(--accent);
  color: var(--text-2);
}

/* ── Callout boxes ─────────────────────────────────────────────────────── */
.help-callout {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin: 0 0 var(--space-md);
  border: var(--border-w) solid var(--border);
  background: var(--surface-2);
}
.help-callout-body > :last-child { margin-bottom: 0; }
.help-callout--tip     { border-left: 3px solid #2e9e5b; }
.help-callout--warning { border-left: 3px solid #d9822b; }
.help-callout--info    { border-left: 3px solid var(--accent); }
.help-callout--note    { border-left: 3px solid var(--text-3); }

/* ── App-link button ───────────────────────────────────────────────────── */
.help-applink {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-2xs) var(--space-md);
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-full, 999px);
  text-decoration: none;
  font-weight: var(--weight-medium);
  margin: var(--space-2xs) 0;
}
.help-applink:hover { background: var(--accent-hover); }

/* ── Embeds (live fretboard / diagram / audio; hydrated by JS) ─────────── */
.help-embed {
  min-height: 120px;
  margin: var(--space-md) 0;
  border: var(--border-w) dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-embed.is-hydrated { border-style: solid; min-height: 0; }
.help-embed-fallback {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--text-3);
  font-size: var(--font-sm);
  padding: var(--space-md);
}
.help-embed-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: help-spin .8s linear infinite;
}
@keyframes help-spin { to { transform: rotate(360deg); } }
.help-shortcuts-ref { margin: var(--space-md) 0; }
.help-shortcuts-ref table { width: 100%; border-collapse: collapse; font-size: var(--font-sm); }
.help-shortcuts-ref td { padding: var(--space-2xs) var(--space-sm); border-bottom: var(--border-w) solid var(--border); }
.help-shortcuts-ref kbd {
  font-family: var(--font-mono);
  background: var(--bg-2);
  border: var(--border-w) solid var(--border-strong);
  border-radius: var(--radius-xs, 4px);
  padding: .05em .4em;
}

/* Tutorial video embed */
.help-video {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: var(--space-md) 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-2);
}
.help-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Hydrated embed cards (drawn by help-embeds.js) */
.help-embed-card {
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.help-embed-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2xs) var(--space-sm);
  border-bottom: var(--border-w) solid var(--border);
}
.help-embed-title { font-size: var(--font-sm); font-weight: var(--weight-semibold); text-transform: capitalize; }
.help-embed-tools { display: inline-flex; gap: var(--space-2xs); }
.help-embed-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 var(--space-sm);
  font-size: var(--font-sm); color: var(--text);
  background: var(--surface); border: var(--border-w) solid var(--border);
  border-radius: var(--radius-full, 999px); cursor: pointer; text-decoration: none;
}
.help-embed-btn:hover { border-color: var(--accent); color: var(--accent); }
.help-embed-board { display: block; width: 100%; height: auto; padding: var(--space-xs); }
.help-embed-chord { display: block; width: 150px; height: auto; margin: 0 auto var(--space-xs); }
.help-embed-card--chord { width: max-content; }
.help-embed-card--audio { display: inline-flex; padding: var(--space-2xs); }
.help-embed-legend {
  display: flex; gap: var(--space-md); padding: var(--space-2xs) var(--space-sm);
  border-top: var(--border-w) solid var(--border); font-size: var(--font-xs); color: var(--text-2);
}
.help-embed-legend span { display: inline-flex; align-items: center; gap: 5px; }
.help-embed-legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.help-embed-legend .sw-root  { background: #1D9E75; }   /* root note (data colour) */
.help-embed-legend .sw-scale { background: #378ADD; }   /* scale tone (data colour) */
.help-embed-chord-name { text-align: center; padding: var(--space-2xs); }

/* ── Feedback widget ───────────────────────────────────────────────────── */
.help-feedback {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-2xl) 0 var(--space-md);
  padding: var(--space-md);
  border-top: var(--border-w) solid var(--border);
  border-bottom: var(--border-w) solid var(--border);
}
.help-feedback-q { font-weight: var(--weight-semibold); }
.help-feedback-btn {
  padding: var(--space-2xs) var(--space-md);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-full, 999px);
  cursor: pointer;
  color: var(--text);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.help-feedback-btn:hover { border-color: var(--accent); }
.help-feedback-btn.is-selected { background: var(--accent-bg); border-color: var(--accent); }
.help-feedback-thanks { color: var(--text-2); }

.help-feedback-note { display: flex; gap: var(--space-xs); margin: var(--space-sm) 0; }
.help-feedback-note textarea {
  flex: 1;
  min-height: 60px;
  padding: var(--space-xs);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
}

/* ── Gate / still-stuck ────────────────────────────────────────────────── */
.help-gate {
  padding: var(--space-xl);
  text-align: center;
  background: var(--surface-2);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-lg);
}
.help-gate-cta {
  display: inline-block;
  margin-top: var(--space-sm);
  padding: var(--space-xs) var(--space-lg);
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-full, 999px);
  text-decoration: none;
}
.help-still-stuck {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  justify-content: center;
  margin-top: var(--space-xl);
  color: var(--text-3);
  font-size: var(--font-sm);
}
.help-still-stuck a { color: var(--accent); }
.help-empty { color: var(--text-3); padding: var(--space-lg) 0; }

@media (max-width: 600px) {
  .help-hero-title { font-size: var(--font-2xl); }
  .help-categories { grid-template-columns: 1fr; }
}
