/* How Stridefly works (/help): the feature guide's own layout. Only the help pages link it.
   Built on style.css's tokens, so light and dark follow the site's theme with no rules of their own.
   Can be folded into style.css (and its ?v bumped) once the guide is approved. */

/* ---- Breadcrumb and "jump to" panel ---- */
.help-crumb { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); margin: 0 0 14px; }
.help-crumb a { color: var(--gold); text-decoration: none; }
.help-crumb a:hover { text-decoration: underline; }

.help-jump {
  margin-top: 26px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px;
  background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius);
  box-shadow: var(--shadow-card); padding: 20px 22px; max-width: 780px;
}
.help-jump h2 { font-family: var(--font-mono); font-weight: 600; font-size: 0.74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-tertiary); margin: 0 0 8px; }
.help-jump ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.help-jump a { color: var(--text); text-decoration: none; font-weight: 600; line-height: 1.35; display: inline-flex; gap: 8px; }
.help-jump a::before { content: "\2192"; color: var(--gold); font-weight: 400; }
.help-jump a:hover { color: var(--gold); }
@media (min-width: 720px) { .help-jump { grid-template-columns: 1fr 1fr; gap: 28px; } }

/* ---- Sections ---- */
.help-sec { padding: 40px 0; scroll-margin-top: 72px; }
.help-sec + .help-sec { border-top: 1px solid var(--separator); }
.help-kicker { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 0 0 6px; }
.help-sec h2 { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.35rem, 2.6vw, 1.75rem); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 10px; }
.help-sec h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; margin: 26px 0 8px; scroll-margin-top: 72px; }
.help-lead { font-size: 1.06rem; color: var(--text-muted); margin: 0 0 16px; max-width: 62ch; }
.help-copy p { color: var(--text-muted); margin: 0 0 12px; max-width: 62ch; }
.help-copy strong { color: var(--text); }
.help-copy a, .help-sec .help-fixes a { color: var(--gold); text-underline-offset: 3px; text-decoration-color: var(--gold-line); }

/* Copy beside its picture on wide screens; picture under the copy on a phone. */
.help-task { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
@media (min-width: 900px) {
  .help-task { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; }
  .help-task.media-wide { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

/* ---- Numbered steps ---- */
.help-steps { list-style: none; counter-reset: step; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; max-width: 62ch; }
.help-steps > li { counter-increment: step; position: relative; padding-left: 40px; color: var(--text-muted); line-height: 1.5; }
.help-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -1px;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: 0.9rem;
}
.help-steps strong, .help-ui { color: var(--text); font-weight: 650; }
.help-result { color: var(--text-muted); margin: 0 0 12px; max-width: 62ch; }
.help-result::before { content: "Result: "; font-weight: 700; color: var(--text); }

/* ---- Tip callout ---- */
.help-tip {
  background: var(--surface); border: 1px solid var(--card-border); border-left: 3px solid var(--gold);
  border-radius: 12px; padding: 14px 18px; margin: 16px 0 0; max-width: 62ch;
  color: var(--text-muted); font-size: 0.98rem; box-shadow: var(--shadow-card);
}
.help-tip strong { color: var(--text); }
.help-tip p { margin: 0 0 8px; color: inherit; }
.help-tip p:last-child { margin: 0; }

/* ---- Media: screenshots, strips and short videos ----
   Real shots come from {{shot}} (build-site.py). A shot not taken yet is a .help-ph: a labelled
   phone-shaped placeholder whose text is the shot's alt, so it doubles as the shot list. */
.help-media { margin: 0; }
/* On a phone a single frame sits centred under its steps; a strip keeps its own left edge. */
.help-media:not(:has(.help-strip)) { justify-self: center; text-align: center; }
.help-media:not(:has(.help-strip)) figcaption { margin-left: auto; margin-right: auto; }
@media (min-width: 900px) { .help-task .help-media:not(:has(.help-strip)) { justify-self: start; text-align: left; } .help-task .help-media figcaption { margin-left: 0; } }
.help-media figcaption { font-size: 0.88rem; color: var(--text-tertiary); margin-top: 10px; line-height: 1.45; max-width: 52ch; }
.help-ph {
  aspect-ratio: 1206 / 2622; width: min(54vw, 210px);
  border: 2px dashed var(--gold-line); border-radius: 30px; background: var(--surface-2);
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px;
  padding: 18px 14px; text-align: center; color: var(--text-muted); font-size: 0.86rem; line-height: 1.4;
  position: relative;
}
.help-ph .kind { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.help-ph .play {
  width: 42px; height: 42px; border-radius: 50%; background: var(--gold-soft);
  display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 1rem;
}
/* Numbered pins on an annotated screenshot, matching .help-callouts below it. */
.help-ph .pin {
  position: absolute; right: -11px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold-fill); color: var(--gold-ink); font-size: 0.74rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* A strip: three or four screens in order. Scrolls sideways inside itself on a phone. */
.help-strip {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 10px; margin: 0; list-style: none;
}
.help-strip > li { flex: 0 0 auto; scroll-snap-align: start; display: grid; gap: 8px; justify-items: start; }
.help-strip .help-ph { width: min(40vw, 168px); border-radius: 24px; font-size: 0.8rem; padding: 12px 10px; }
.help-strip .step { font-size: 0.86rem; color: var(--text-muted); max-width: 168px; line-height: 1.4; }
.help-strip .step b { color: var(--gold); margin-right: 4px; }

/* Real screenshots ({{shot}} in build-site.py): one phone frame, smaller in a strip. */
.help-media .device-frame { width: min(62vw, 236px); margin: 0 auto; }
@media (min-width: 900px) { .help-task .help-media .device-frame { margin: 0; } }
.help-strip .device-frame { width: min(42vw, 176px); margin: 0; }
.help-media .device-caption { display: none; }
/* Pins over a real screenshot: .help-pinned wraps the frame; each pin's top is set inline. */
.help-pinned { position: relative; display: inline-block; }
.help-pinned .pin {
  position: absolute; right: -11px; width: 24px; height: 24px; border-radius: 50%; z-index: 2;
  background: var(--gold-fill); color: var(--gold-ink); font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 4px rgba(12,26,40,.25);
}
.help-pair { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.help-pair .device-frame { width: min(40vw, 200px); }

/* ---- "What you see": an annotated screen and its numbered list ---- */
.help-annot { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
@media (min-width: 720px) { .help-annot { grid-template-columns: auto minmax(0, 1fr); gap: 36px; } }
.help-callouts { list-style: none; counter-reset: pin; margin: 0; padding: 0; display: grid; gap: 12px; max-width: 58ch; }
.help-callouts > li { counter-increment: pin; position: relative; padding-left: 36px; color: var(--text-muted); line-height: 1.5; }
.help-callouts > li::before {
  content: counter(pin); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold-fill); color: var(--gold-ink); font-weight: 700; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}
.help-callouts strong { color: var(--text); }

/* ---- "Fix a problem": the site's FAQ look, left-aligned, with Why and Fix lines ---- */
.help-fixes.faq { margin: 0; max-width: 780px; }
.help-fixes details { scroll-margin-top: 84px; } /* clear of the sticky nav when a link opens one */
.help-fixes details > div { padding: 0 20px 18px; display: grid; gap: 8px; }
.help-fixes details > div p { margin: 0; padding: 0; color: var(--text-muted); max-width: 66ch; }
.help-fixes .why::before, .help-fixes .fix::before { font-weight: 700; color: var(--text); margin-right: 6px; }
.help-fixes .why::before { content: "Why:"; }
.help-fixes .fix::before { content: "Fix:"; }

/* ---- Glossary ---- */
.help-terms { margin: 0; display: grid; gap: 14px; max-width: 66ch; }
.help-terms dt { font-weight: 700; color: var(--text); }
.help-terms dd { margin: 2px 0 0; color: var(--text-muted); }

/* ---- Related and help footer ---- */
.help-related { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.help-related a { color: var(--gold); font-weight: 600; text-decoration: none; }
.help-related a:hover { text-decoration: underline; }

/* ---- Index: search, problems and topic cards ---- */
.help-search { margin-top: 24px; max-width: 560px; }
.help-search label { display: block; font-weight: 600; margin-bottom: 8px; }
.help-search input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 12px; padding: 12px 14px;
}
.help-search input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.help-search .help-count { font-size: 0.86rem; color: var(--text-tertiary); margin: 8px 0 0; min-height: 1.2em; }

.help-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 640px) { .help-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .help-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.help-card {
  display: grid; gap: 6px; height: 100%; box-sizing: border-box; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius);
  color: var(--text-muted); text-decoration: none; line-height: 1.45; font-size: 0.96rem;
}
a.help-card { box-shadow: var(--shadow-card); }
a.help-card:hover { border-color: var(--gold-line); }
a.help-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.help-card .t { color: var(--text); font-weight: 700; font-size: 1.04rem; }
a.help-card .t::after { content: " \2192"; color: var(--gold); }
.help-card .tag { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-tertiary); }
.help-card.is-planned { background: transparent; border-style: dashed; }
.help-card.is-planned .tag::after { content: " \00B7  Planned"; }
.help-group h2 { margin-bottom: 14px; }
[hidden] { display: none !important; }

/* ---- Getting around a topic page (help.js) ----
   Wide screens: one pane on the left, every topic, with this page's questions under it; the box at the top hides.
   Phones: a bar under the site menu with All topics and Contents, a Contents sheet, and Back to the questions. */
.help-bar { display: none; }
.js .help-bar { display: block; position: sticky; top: 68px; z-index: 15; border-bottom: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.help-bar .wrap { display: flex; align-items: center; gap: 10px; height: 50px; }
.help-bar-back { color: var(--gold); font-weight: 600; font-size: 0.92rem; text-decoration: none; white-space: nowrap; }
.help-bar-now { flex: 1; min-width: 0; font-size: 0.86rem; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.help-bar-open { font: inherit; font-weight: 600; font-size: 0.88rem; color: var(--text); background: var(--surface); border: 1px solid var(--control-border);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.help-bar-open:focus-visible, .help-copy-link:focus-visible, .help-pill:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.js .help-layout .help-sec, .js .help-layout .help-sec h3, .js .help-layout .help-jump { scroll-margin-top: 126px; }
.js .help-layout .help-fixes details { scroll-margin-top: 130px; }

.help-side { display: none; }
.help-side-search input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 12px; padding: 10px 12px 10px 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px 50%;
}
.help-side-search input:focus-visible, .help-sheet input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.help-side .tab { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-tertiary); margin: 18px 0 6px; }
.help-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.help-side a, .help-side span { display: block; padding: 6px 10px; border-radius: 8px; font-size: 0.94rem; line-height: 1.35; text-decoration: none; }
.help-side a { color: var(--text); }
.help-side a:hover { background: var(--gold-soft); }
.help-side span { color: var(--text-tertiary); }
.help-side .help-cur > a { font-weight: 800; }
.help-side .kind { font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-tertiary); margin: 10px 0 2px 12px; }
.help-side ul.help-sub { margin: 0 0 4px 12px; border-left: 2px solid var(--separator); gap: 0; }
.help-side .help-sub a { font-size: 0.88rem; color: var(--text-muted); padding: 5px 10px; border-radius: 0 8px 8px 0; margin-left: -2px; border-left: 2px solid transparent; }
.help-side .help-sub a.is-here { color: var(--gold); border-left-color: var(--gold); background: var(--gold-soft); font-weight: 700; }
.help-side .help-mail { margin-top: 22px; font-size: 0.92rem; color: var(--text-muted); }
.help-side .help-mail a { display: inline; padding: 0; color: var(--gold); font-weight: 600; }

.help-sheet { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 84vh; border: 0; border-radius: 20px 20px 0 0; padding: 0;
  background: var(--bg); color: var(--text); box-shadow: 0 -12px 40px rgba(0,0,0,.28); }
.help-sheet::backdrop { background: rgba(8,16,24,.45); }
.help-sheet-head { position: sticky; top: 0; z-index: 1; background: var(--bg); padding: 14px 20px 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--separator); }
.help-sheet-head b { font-family: var(--font-display); font-size: 1.05rem; }
.help-sheet-done { font: inherit; font-weight: 700; color: var(--gold); background: none; border: 0; cursor: pointer; padding: 4px; }
.help-sheet-body { padding: 14px 20px 30px; }
.help-sheet input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--control-border); border-radius: 12px; padding: 10px 12px;
}
.help-sheet h3 { font-family: var(--font-mono); font-weight: 600; font-size: 0.72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-tertiary); margin: 18px 0 4px; }
.help-sheet ul { list-style: none; margin: 0; padding: 0; }
.help-sheet li a { display: block; padding: 11px 0; border-bottom: 1px solid var(--separator); color: var(--text); text-decoration: none; font-weight: 600; }
.help-sheet li a.is-here { color: var(--gold); }
.help-sheet li a.is-here::after { content: "  \00B7  You're here"; font-weight: 400; color: var(--text-tertiary); font-size: 0.86rem; }

.help-pill { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 16; background: var(--text); color: var(--bg);
  border: 0; border-radius: 999px; padding: 11px 18px; font: inherit; font-weight: 700; font-size: 0.92rem; box-shadow: 0 8px 24px rgba(0,0,0,.28); cursor: pointer; white-space: nowrap; }
.help-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 76px; z-index: 50; background: var(--text); color: var(--bg); border-radius: 10px;
  padding: 9px 14px; font-size: 0.88rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.28); max-width: calc(100vw - 32px); overflow-wrap: anywhere; }

/* Copy link, and the line under each fix. */
.help-copy-link { display: none; }
.js .help-copy-link { display: inline-block; font-family: var(--font-sans); font-size: 0.82rem; font-weight: 600; letter-spacing: normal; text-transform: none;
  color: var(--gold); background: none; border: 1px solid var(--gold-line); border-radius: 999px; padding: 2px 10px; cursor: pointer; margin-left: 8px; vertical-align: 1px; }
.help-copy-link:hover { background: var(--gold-soft); }
.help-fixes p.help-after { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 0.9rem; margin-top: 4px; }
.help-after a { color: var(--gold); font-weight: 600; text-decoration: none; }
.help-after .help-copy-link { margin-left: 0; }

@media (min-width: 1100px) {
  .js .help-bar, .help-pill, .help-after .help-phone-only { display: none !important; }
  .help-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 52px; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
  .help-side { display: block; position: sticky; top: 68px; align-self: start; max-height: calc(100vh - 68px); overflow: auto; padding: 32px 4px 24px 0; }
  .help-layout .help-jump { display: none; }
  .help-main .wrap { max-width: none; padding: 0; }
  .help-main .page-hero { background: none; padding-top: 36px; }
  .help-main .help-task { grid-template-columns: minmax(0, 1fr) auto; gap: 40px; }
  .help-main .help-task.media-wide { grid-template-columns: minmax(0, 1fr); }
  .js .help-layout .help-sec, .js .help-layout .help-sec h3 { scroll-margin-top: 80px; }
  .js .help-layout .help-fixes details { scroll-margin-top: 84px; }
  .help-toast { bottom: 24px; }
}

/* Review fixes: no-JS pane search, no-match line, planned cue for screen readers, Copy link fallback, phone sheet. */
.help-side-search { display: none; }
.js .help-side-search { display: block; }
.help-none { font-size: 0.9rem; color: var(--text-tertiary); margin: 14px 0 0; }
.help-vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.help-toast { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.help-toast-link { flex: 1 1 200px; min-width: 0; font: inherit; font-size: 0.86rem; color: var(--text); background: var(--surface); border: 0; border-radius: 6px; padding: 5px 8px; }
.help-toast-done { font: inherit; font-weight: 700; color: inherit; text-decoration: underline; background: none; border: 0; cursor: pointer; padding: 4px; }
.help-sheet { max-height: 84dvh; }
.help-sheet-body { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
