/* The Help Center (public/help.php): the index (search, categories, guide cards) and an article (video, steps,
   "Still stuck?", related). Colors are site.css's variables, so light and dark both follow. */

.help-hero .container { max-width: 880px; text-align: center; }
.help-hero .lead { margin-inline: auto; }
.help-search { display: flex; gap: 10px; max-width: 620px; margin: 26px auto 0; }
.help-search input { flex: 1; min-width: 0; min-height: 52px; padding: 0 18px; font: inherit; font-size: 1.02rem; color: var(--ink); background: var(--surface);
    border: 1.5px solid var(--line-strong); border-radius: 999px; }
.help-search input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
/* The button sits in the page hero, whose ".page-hero .btn { margin-top: 28px }" (spacing for the hero's call-to-action)
   pushed it 14px below the field's centre and stretched the field to 86px: no margin here, and no block padding, so the
   field and the button are both exactly 52px and share a centre at every width and zoom */
.help-search { align-items: stretch; }
.help-search .btn { min-height: 52px; margin: 0; padding-block: 0; }
.help-count { min-height: 1.4em; margin: 12px 0 0; color: var(--muted); font-size: 0.92rem; }

.help-index .container { display: grid; gap: 44px; }
.help-cat[hidden], .help-card[hidden] { display: none; }
.help-cat-head h2 { margin: 0; font-size: 1.5rem; letter-spacing: -0.01em; }
.help-cat-head p { margin: 6px 0 0; color: var(--muted); }
.help-cards { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.help-card a { display: flex; flex-direction: column; height: 100%; overflow: hidden; color: var(--ink); text-decoration: none; background: var(--surface);
    border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s, transform .2s; }
.help-card a:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.help-card a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.help-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.help-card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.help-card-body b { font-size: 1.04rem; line-height: 1.3; }
.help-card-body > span { color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
.help-card-len { margin-top: auto; padding-top: 6px; color: var(--accent-text); font-weight: 700; font-size: 0.82rem; }
.help-none { text-align: center; color: var(--muted); }

/* An article */
.help-wrap { max-width: 880px; }
.help-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; font-size: 0.92rem; color: var(--muted); }
.help-crumbs a { color: var(--accent-text); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }   /* 44px targets (phones and touch screens) */
.help-title { margin: 0; }
.help-summary { margin-top: 12px; }
/* Desktop / Phone: the guide on a computer or on a phone. With no choice, phones see the phone one and computers the
   computer one; a choice (help.js preselects the screen's) shows that one at any width. */
.help-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 26px 0 0; padding: 0; border: 0; min-width: 0; }
.help-switch legend { float: left; padding: 0; margin: 0; font-weight: 700; color: var(--ink); }
.help-switch-opts { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; }
.help-switch-opts label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 18px; border-radius: 999px; cursor: pointer;
    font-weight: 700; color: var(--ink); }
.help-switch-opts label svg { display: block; }
.help-switch-input:checked + label { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-sm); outline: 1px solid var(--line-strong); }
.help-switch-input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.help-ver { margin: 22px 0 0; }
.help-ver[data-help-ver="mobile"] { display: none; }
.help-article:has(#help-ver-desktop:checked) .help-ver[data-help-ver="desktop"] { display: block; }
.help-article:has(#help-ver-desktop:checked) .help-ver[data-help-ver="mobile"] { display: none; }
.help-article:has(#help-ver-mobile:checked) .help-ver[data-help-ver="mobile"] { display: block; }
.help-article:has(#help-ver-mobile:checked) .help-ver[data-help-ver="desktop"] { display: none; }
.help-steps-on { color: var(--muted); font-weight: 600; font-size: 1rem; }

.help-video { margin: 0; }
.help-video video { display: block; width: 100%; height: auto; background: var(--dark-band); border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); }
/* The phone version on a computer: phone-sized, centred */
.help-ver[data-help-ver="mobile"] .help-video, .help-ver[data-help-ver="mobile"] .help-step-body img { max-width: 360px; }
.help-ver[data-help-ver="mobile"] .help-video { margin-inline: auto; }
.help-video-cap { margin-top: 10px; color: var(--muted); font-size: 0.88rem; }
.help-transcript { margin: 14px 0 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.help-transcript summary { min-height: 48px; display: flex; align-items: center; padding: 0 18px; cursor: pointer; font-weight: 700; color: var(--ink); }
.help-transcript summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 14px; }
.help-transcript > div { padding: 0 18px 12px; color: var(--ink); }
.help-transcript p { margin: 0 0 8px; }

.help-steps-title { margin: 44px 0 0; font-size: 1.5rem; }
.help-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 28px; counter-reset: none; }
.help-step { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; align-items: start; }
.help-step-n { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; font-weight: 800; font-size: 1.05rem;
    color: var(--accent-ink); background: var(--accent); }
.help-step-body p { margin: 9px 0 14px; font-size: 1.04rem; line-height: 1.6; color: var(--ink); }
.help-step-body img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); background: var(--bg-soft); }

.help-stuck { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; margin: 44px 0 0; padding: 22px 24px;
    background: var(--accent-soft); border: 1px solid var(--line); border-radius: 20px; }
.help-stuck-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 16px; color: var(--accent-text); background: var(--surface); }
.help-stuck h2 { margin: 0; font-size: 1.2rem; }
.help-stuck p { margin: 6px 0 0; color: var(--ink); }
.help-stuck-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.help-stuck-actions .btn { min-height: 44px; }

.help-related { margin: 44px 0 0; }
.help-related h2 { font-size: 1.3rem; margin: 0 0 12px; }
.help-related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.help-related li a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 700; color: var(--accent-text); }
.help-related li span { display: block; margin: -6px 0 10px; color: var(--muted); font-size: 0.92rem; }
.help-related > p a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 700; color: var(--accent-text); }

/* Phones: the phone version unless the switch says otherwise */
@media (max-width: 700px) {
    .help-ver[data-help-ver="desktop"] { display: none; }
    .help-ver[data-help-ver="mobile"] { display: block; }
    .help-ver[data-help-ver="mobile"] .help-video, .help-ver[data-help-ver="mobile"] .help-step-body img { max-width: 420px; }
    .help-switch-opts { width: 100%; }
    .help-switch-opts label { flex: 1; justify-content: center; }
    .help-search { flex-direction: column; }
    .help-step { grid-template-columns: 1fr; gap: 10px; }
    .help-step-body img { margin-inline: auto; }
    .help-stuck { grid-template-columns: 1fr; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    .help-card a { transition: none; }
    .help-card a:hover { transform: none; }
}
