/* Help page styles — ported from the current app's public/help.html inline
   <style>. The page renders inside the app layout (header + nav chrome), so the
   original dark header band was dropped; its rules are removed here too. The
   static page's generic .content/.h2/etc. are scoped under .help-page (with
   .content -> .help-content) so they don't collide with the app chrome. CSS
   custom properties come from variables.css (light + dark), so no scoped :root
   override is needed. */

.help-page {
  font-family: 'Barlow', sans-serif;
  font-size: calc(18px + var(--text-bump));
  color: var(--text-dark);
  background: var(--bg-secondary);
  line-height: 1.7;
}

.help-page .help-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.help-page .quick-nav {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.help-page .quick-nav a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dark);
  text-decoration: none;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  background: var(--bg-secondary);
  transition: background var(--motion-quick) var(--ease-out), color var(--motion-quick) var(--ease-out);
}

.help-page .quick-nav a:hover {
  background: var(--teal-light);
  color: var(--teal-ink);
}

.help-page .quick-nav i {
  color: var(--teal-ink);
  font-size: calc(1.2rem + var(--text-bump));
}

.help-page h2 {
  font-family: 'Frank Ruhl Libre', Georgia, serif;
  color: var(--text-dark);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
}

.help-page h3 {
  color: var(--text-dark);
  font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.help-page p,
.help-page li {
  color: var(--text-secondary);
}

.help-page ul {
  padding-left: 1.5rem;
}

.help-page li {
  margin-bottom: 0.5rem;
}

.help-page .highlight-box {
  background: var(--teal-light);
  border-left: 4px solid var(--teal-accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 6px 6px 0;
}

.help-page .highlight-box p {
  margin: 0;
  color: var(--text-dark);
}

.help-page .module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.help-page .module-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.25rem;
}

.help-page .module-card h4 {
  font-family: 'Frank Ruhl Libre', Georgia, serif;
  color: var(--text-dark);
  margin: 0 0 0.5rem 0;
  font-size: calc(1.1rem + var(--text-bump));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-page .module-card h4 i {
  color: var(--teal-ink);
}

.help-page .module-card p {
  margin: 0;
  font-size: calc(0.95rem + var(--text-bump));
}

.help-page .ai-modes {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

.help-page .ai-mode {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.help-page .ai-mode i {
  color: var(--teal-ink);
  font-size: calc(1.5rem + var(--text-bump));
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.help-page .ai-mode h4 {
  margin: 0 0 0.25rem 0;
  color: var(--text-dark);
  font-weight: 600;
}

.help-page .ai-mode p {
  margin: 0;
  font-size: calc(0.95rem + var(--text-bump));
}

.help-page .faq-item {
  margin-bottom: 1.5rem;
}

.help-page .faq-item h4 {
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.help-page .faq-item p {
  margin: 0;
}

.help-page a {
  color: var(--teal-ink);
}

.help-page .footer-note {
  color: var(--text-secondary);
  font-size: calc(0.9rem + var(--text-bump));
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

/* ============================================================
   Help tray (the header drawer) — transcribed from
   docs/design-reference/extracted/drawer-help.html.

   Each FAQ is a full-width toggle: the question in the heading face at
   16.5px with a chevron on the right, a hairline under every item, and the
   answer in 15px/1.75 body copy. Native <details>/<summary> drives it, so
   the chevron flips off the [open] state rather than a controller.

   Literal pixel type from the capture is written calc(Npx * var(--text-scale)),
   the convention modules/hub.css established.
   ============================================================ */

.help-faq-list { display: flex; flex-direction: column; }

.help-drawer .faq-item {
  margin: 0;
  border-bottom: 1px solid var(--border-light);
}

.help-drawer .faq-question {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0.85rem 0;
  cursor: pointer;
  list-style: none;
  text-align: left;
}

/* Safari still paints the default disclosure marker without this. */
.help-drawer .faq-question::-webkit-details-marker { display: none; }

.help-drawer .faq-question h4 {
  flex: 1;
  margin: 0;
  font-family: var(--font-heading);
  font-size: calc(16.5px * var(--text-scale));
  font-weight: 500;
  line-height: 1.35;
  color: var(--navy-primary);
}

.help-drawer .faq-question i {
  flex-shrink: 0;
  font-size: calc(12px * var(--text-scale));
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.help-drawer .faq-item[open] .faq-question i { transform: rotate(180deg); }

.help-drawer .faq-answer {
  font-family: var(--font-body);
  font-size: calc(15px * var(--text-scale));
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0 0 1rem;
}

/* ── Video walkthroughs (drawer rows) ─────────────────────────────
   Each row is a full-width button — play glyph, title over the one-line
   description, duration on the right, hairline under each item, the FAQ
   list's type — that opens the player dialog below. Tokens only, so dark
   mode follows. */

.help-videos { margin-top: 1.5rem; }

.help-video-list { display: flex; flex-direction: column; }

.help-drawer .help-video-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0.85rem 0;
  margin: 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  text-align: left;
}

.help-drawer .help-video-row > .fa-circle-play {
  flex-shrink: 0;
  font-size: calc(16px * var(--text-scale));
  color: var(--text-muted);
}

.help-drawer .help-video-row:hover > .fa-circle-play { color: var(--navy-primary); }

.help-video-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.help-video-title {
  font-family: var(--font-heading);
  font-size: calc(16.5px * var(--text-scale));
  font-weight: 500;
  line-height: 1.35;
  color: var(--navy-primary);
}

.help-drawer .help-video-description {
  font-family: var(--font-body);
  font-size: calc(13.5px * var(--text-scale));
  line-height: 1.5;
  color: var(--text-secondary);
}

.help-video-duration {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.15rem;
  font-family: var(--font-ui);
  font-size: calc(13px * var(--text-scale));
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

/* ── The walkthrough player dialog ────────────────────────────────
   Near-fullscreen, sized to the VIDEO's shape: --help-video-ar is set per
   video by the controller, the width derives from it against a 90vh height
   budget (minus the head and caption rows), capped at 90vw, and the player
   keeps the same ratio — so the picture fills the dialog with no letterbox
   bars. House dialog chrome (square, tokened, shadowed) like the
   confirm dialog. */

.help-video-dialog {
  --help-video-ar: 1.3913; /* 1920 / 1380, overridden per video at open */
  --help-video-chrome: 7rem; /* head row + caption row, off the height budget */
  width: min(90vw, calc((90vh - var(--help-video-chrome)) * var(--help-video-ar)));
  /* interview.css caps every bare <dialog> at 900px; this one is sized to the
     video and must be allowed near-fullscreen. */
  max-width: 90vw;
  max-height: 90vh;
  padding: 0;
  border: none;
  background: var(--bg-primary);
  color: var(--text-dark);
  box-shadow: var(--shadow-lg);
}

.help-video-dialog::backdrop { background: rgba(19, 19, 19, 0.45); }

.help-video-dialog-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
}

.help-video-dialog-title {
  flex: 1;
  font-family: var(--font-heading);
  font-size: calc(18px * var(--text-scale));
  font-weight: 500;
  line-height: 1.3;
  color: var(--navy-primary);
}

.help-video-dialog-close {
  flex-shrink: 0;
  min-width: var(--tap);
  min-height: var(--tap);
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: calc(18px * var(--text-scale));
  color: var(--text-muted);
}

.help-video-dialog-close:hover { color: var(--navy-primary); }

.help-video-dialog-player {
  display: block;
  width: 100%;
  aspect-ratio: var(--help-video-ar);
}

.help-video-dialog-description {
  font-family: var(--font-body);
  font-size: calc(14px * var(--text-scale));
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  padding: 0.6rem 1rem 0.85rem;
}

.help-also-here { margin-top: 1.5rem; }

.help-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
