/**
 * @file help.css
 * @author Jouni Miikki
 * SPDX-License-Identifier: MIT
 * @description Styles for the AI Help Prompt page — warm white aesthetic,
 *   DM Sans body text, JetBrains Mono for the prompt code block.
 * @version-history
 *   v3.1.0 -- 2026-09-13 -- Compose the existing ink top rule from poster.css.
 *   v3.0.1 — 2026-08-29 — The prompt block reads var(--font-mono) instead of naming five monospace families.
 *   v3.0.0 — 2026-08-29 — The showroom face (design canvas "AIMEAT Index Pages"): no card, the title in
 *       the display face with the coral offset, the two tabs on a 3px rule with the open one on the
 *       sun, numbered steps with coral numerals, the questions as ink-framed boxes with a solid
 *       shadow, and the sun slab plus a door under "still stuck".
 *   v1.0.0 — 2026-03-23 — Initial implementation
 *   v1.1.0 — 2026-06-02 — Copied-state selector .hlp-copied → .copied (CopyButton component migration)
 *   v2.0.0 — 2026-07-28 — Two-tab shell (.hlp-tabs/.hlp-tab), human help (.hlp-steps/-questions/
 *     -answer/-stuck) and the rendered-markdown prompt box (.hlp-prompt-rendered). The page used
 *     to print the prompt's markdown source at a human who clicked "Help".
 *   v2.1.0 — 2026-08-08 — .hlp-copy-btn deleted — it reimplemented .btn-primary exactly (same gradient, same hover
 *       lift) and .hlp-copy-btn.copied reimplemented .btn-primary.success. Only the wider CTA
 *       footprint survives, as a container rule.
 */

/* ── Container ── */
.hlp-container {
  max-width: 840px;
  margin: 0 auto;
  padding: 44px 20px 64px;
  font-family: var(--font-showroom-body);
}

/* ── Card: gone since the showroom; the page is the page ── */
.hlp-card {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* ── Title ── */
.hlp-title {
  font-family: var(--font-showroom);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  line-height: 1;
  letter-spacing: .01em;
  color: var(--text);
  text-shadow: .075em .075em 0 var(--accent);
  margin: 0;
}

/* ── Description ── */
.hlp-desc {
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 28px;
}

/* ── Prompt wrapper ── */
.hlp-prompt-wrapper {
  background: var(--bg-surface, var(--card-bg-alt));
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm, 8px);
  max-height: 480px;
  overflow-y: auto;
  margin-bottom: 20px;
}

/* ── Prompt text ── */
.hlp-prompt-text {
  margin: 0;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
  tab-size: 2;
}

.hlp-prompt-text code {
  font-family: inherit;
  background: none;
  padding: 0;
}

/* ── Loading ── */
.hlp-loading {
  display: flex;
  justify-content: center;
  padding: 40px;
}

/* ── Error ── */
.hlp-error {
  padding: 20px;
  color: var(--accent);
  text-align: center;
  font-family: var(--font);
}

/* ── Copy button ──
   The button itself is the shared .btn-primary (same gradient, same hover lift, and its
   .copied state is the same green) — all this view adds is the wider CTA footprint. */
.hlp-agent .btn-primary { min-width: 180px; }

/* ── Responsive ── */
@media (max-width: 600px) {
  .hlp-container {
    padding: 24px 16px 48px;
  }
  .hlp-prompt-wrapper {
    max-height: 360px;
  }
}

/* ── Two audiences, two tabs (v2.0.0, 2026-07-28) ────────────────────────────
   The page used to be the agent prompt alone, printed as markdown SOURCE. The
   human tab is the default; the prompt now renders through <Markdown>. */
/* The tabs: on a 3px ink rule, the open one on the sun with ink words, the display face. */
.hlp-tabs { display: flex; gap: 0; margin: 1.75rem 0 2.25rem; border-bottom: 0; }
.hlp-tab {
  flex: 1; text-align: center;
  background: none; border: none; border-bottom: 3px solid transparent; border-radius: 0;
  padding: .8rem .75rem; margin: 0; cursor: pointer;
  color: var(--text-dim); font-family: var(--font-showroom); font-weight: 400; text-transform: uppercase; font-size: 1.05rem; letter-spacing: .04em;
}
.hlp-tab:hover { color: var(--text); }
.hlp-tab.active { color: var(--on-sun); background: var(--sun); border-bottom-color: var(--text); }

/* Section headlines in the display face; the steps numbered with coral numerals. */
.hlp-human .section-title, .hlp-agent .section-title {
  font-family: var(--font-showroom); font-weight: 400; text-transform: uppercase; font-size: 1.65rem; line-height: 1.05; letter-spacing: .01em;
  color: var(--text); margin: 2.75rem 0 .75rem;
}
.hlp-human > .section-title:first-child { margin-top: 0; }
.hlp-steps { list-style: none; margin: 0; padding: 0; counter-reset: hlp-step; }
/* The numeral is absolutely placed: a grid or flex row would split the sentence from the link
   that follows it inside the same <li>, which is what put "Yhdistämisohjeet" on its own line. */
.hlp-steps li {
  counter-increment: hlp-step;
  position: relative; padding: .875rem 0 .875rem 3.25rem;
  border-bottom: 1px solid var(--border); font-size: .95rem; line-height: 1.6;
}
.hlp-steps li:last-child { border-bottom: 0; }
.hlp-steps li::before {
  content: counter(hlp-step, decimal-leading-zero); position: absolute; left: 0; top: .95rem;
  font-family: var(--font-showroom); font-size: 1.4rem; line-height: 1; color: var(--accent);
}
.hlp-steps a { color: var(--text); font-weight: 800; text-decoration: none; border-bottom: 3px solid var(--accent); }
.hlp-steps a:hover { color: var(--accent); }
/* The questions: ink-framed boxes with a solid shadow, coral on the one that is open. */
.hlp-questions { display: grid; gap: .9rem; margin-bottom: 0; }
.hlp-questions .collapsible { border: 3px solid var(--text); border-radius: 0; margin: 0; background: var(--card-bg); box-shadow: 4px 4px 0 var(--text); }
.hlp-questions .collapsible:has(.collapsible-chevron.open) { box-shadow: 4px 4px 0 var(--accent); }
.hlp-questions .collapsible-header { padding: .9rem 1.1rem; border-radius: 0; font-family: var(--font-showroom-body); font-size: 1rem; font-weight: 800; }
.hlp-questions .collapsible-chevron { color: var(--text); font-size: .8rem; }
.hlp-questions .collapsible-body { padding: 0 1.1rem 1rem; }
.hlp-answer { margin: 0; color: var(--text-dim); font-size: .95rem; line-height: 1.6; }
/* Still stuck: the sun slab and a door. */
.hlp-stuck { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.hlp-btn {
  display: inline-block; font-family: var(--font-showroom); font-weight: 400; text-transform: uppercase; font-size: 1.05rem; letter-spacing: .04em;
  padding: .9rem 1.5rem; border: 3px solid var(--text); box-shadow: 6px 6px 0 var(--text); border-radius: 0;
  background: var(--sun); color: var(--on-sun); cursor: pointer; transition: transform 120ms ease, box-shadow 120ms ease;
}
.hlp-btn:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--text); }
.hlp-door { font-family: var(--font-showroom-body); font-size: .95rem; font-weight: 800; color: var(--text); text-decoration: none; border-bottom: 3px solid var(--accent); }
.hlp-door:hover { color: var(--accent); }

/* The rendered prompt is long; keep it scrollable inside its own box rather than
   letting it push the endpoint list off the bottom of a phone screen. */
.hlp-prompt-rendered { max-height: 60vh; overflow-y: auto; margin-top: 1rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-surface, var(--bg-dim)); }
.hlp-prompt-rendered table { display: block; overflow-x: auto; max-width: 100%; }
.hlp-endpoints { margin: .9rem 0 0; padding-left: 1.2rem; display: grid; gap: .4rem; color: var(--text-dim); font-size: .88rem; }
.hlp-endpoints code { background: var(--code-bg); padding: .1rem .4rem; border-radius: .25rem; }
