/* FileConvert — the help centre (/help).

   This file layers over theme.css and never redefines its tokens. Every colour
   below is either a --t-* semantic token, a --primary-* brand step, or a
   deliberate translucent white used *only* on the dark .vhero gradient, where
   the background is fixed in both themes.

   Selectors are namespaced .help-*, .faq-*. Where a shared theme.css component
   is adjusted (.vhero, .liftcard, .catchip, .band, .pairlink, .termcard), the
   override is scoped by a .help-* ancestor so it out-specifies theme.css — which
   matters, because help.css is linked before theme.css. */

/* ------------------------------------------------------------------- Hero */

.help-hero {
    padding-bottom: 150px;
}

/* One centred column: the help hero has no illustration to sit beside. */
.help-hero .vhero__inner {
    grid-template-columns: 1fr;
    gap: 0;
}

.help-hero .vhero__copy {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.help-hero .vhero__title,
.help-hero .vhero__lede {
    text-align: center;
}

.help-hero .vhero__lede {
    max-width: 620px;
    margin-inline: auto;
}

.help-hero .vhero__meta {
    justify-content: center;
}

.help-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    margin-bottom: 18px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 999px;
    /* On the fixed dark hero gradient, so a translucent wash reads correctly
       in both themes. */
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--primary-200);
}

/* ----------------------------------------------------------- Hero search */

.help-find {
    position: relative;
    max-width: 620px;
    margin: 28px auto 0;
}

.help-find__icon {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    font-size: 0.9375rem;
    color: var(--n-400);
    pointer-events: none;
}

.help-find__input {
    width: 100%;
    padding: 16px 18px 16px 50px;
    font: inherit;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--hero-ink);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-xl);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.help-find__input::placeholder {
    color: var(--n-400);
    text-overflow: ellipsis;
}

.help-find__input:hover {
    border-color: rgba(255, 255, 255, 0.26);
}

.help-find__input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.10);
    border-color: var(--primary-400);
    box-shadow: 0 0 0 4px rgba(229, 50, 45, 0.30);
}

.help-find__input:focus-visible {
    outline: 2px solid transparent;
}

.help-find__input::-webkit-search-cancel-button {
    cursor: pointer;
}

.help-find__hint {
    margin-top: 10px;
    font-size: 0.8125rem;
    text-align: center;
    color: var(--hero-faint);
}

/* -------------------------------------------------------- Topic chip card */

.help-topics.liftcard {
    width: min(100% - 32px, 1000px);
    margin-bottom: 56px;
    padding: 22px 24px 24px;
    text-align: left;
}

.help-topics .minilabel {
    margin-bottom: 14px;
}

.help-topics__list.catchips {
    margin-top: 0;
    gap: 8px;
}

/* The chips are anchors here, so they get a hit area and a focus ring. */
.help-topics .catchip {
    padding: 8px 12px;
    border: 1px solid var(--t-border);
    border-radius: 999px;
    background: var(--t-elevated);
    font-size: 0.8125rem;
    transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.help-topics .catchip:hover {
    border-color: var(--primary-400);
    background: var(--brand-tint);
    color: var(--primary-600);
}

.help-topics .catchip:hover i {
    color: var(--primary-500);
}

.help-topics .catchip:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.help-topics .catchip__count {
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--t-accented);
    color: var(--t-muted);
}

:root[data-theme="dark"] .help-topics .catchip:hover {
    color: var(--primary-300);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .help-topics .catchip:hover {
        color: var(--primary-300);
    }
}

/* -------------------------------------------------------------- FAQ bands */

.help-faq {
    padding-bottom: 8px;
}

.help-band__head {
    max-width: 46rem;
}

.help-band .band__lede {
    max-width: 46rem;
}

.help-note {
    max-width: 46rem;
    margin-top: 18px;
    padding: 14px 16px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--t-default);
    background: var(--t-elevated);
    border: 1px solid var(--t-border);
    border-left: 3px solid var(--primary-500);
    border-radius: var(--radius);
}

.help-note i {
    margin-right: 8px;
    color: var(--primary-500);
}

.help-note a {
    font-weight: 600;
    color: var(--primary-600);
    text-decoration: underline;
    text-underline-offset: 2px;
}

:root[data-theme="dark"] .help-note a {
    color: var(--primary-300);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .help-note a {
        color: var(--primary-300);
    }
}

.help-note code,
.help-contact code {
    padding: 1px 5px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
    color: var(--t-highlighted);
    background: var(--t-accented);
    border: 1px solid var(--t-border);
    border-radius: var(--radius-sm);
    overflow-wrap: anywhere;
}

/* ------------------------------------------------------------- Accordions */

.faq-list {
    max-width: 52rem;
    margin-top: 22px;
    overflow: hidden;
    background: var(--t-surface);
    border: 1px solid var(--t-border);
    border-radius: var(--radius-xl);
}

.faq-item + .faq-item {
    border-top: 1px solid var(--t-border);
}

.faq-item__heading {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
}

.faq-item__trigger {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    padding: 17px 20px;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    color: var(--t-highlighted);
    background: none;
    border: 0;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.faq-item__trigger:hover {
    background: var(--t-elevated);
}

.faq-item__trigger:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: -2px;
}

.faq-item__q {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.faq-item__chevron {
    flex: 0 0 auto;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--t-dimmed);
    transition: transform 0.2s ease, color 0.15s ease;
}

.faq-item__trigger:hover .faq-item__chevron {
    color: var(--t-muted);
}

.faq-item__trigger[aria-expanded="true"] {
    color: var(--primary-600);
    background: var(--t-elevated);
}

.faq-item__trigger[aria-expanded="true"] .faq-item__chevron {
    color: var(--primary-500);
    transform: rotate(180deg);
}

:root[data-theme="dark"] .faq-item__trigger[aria-expanded="true"] {
    color: var(--primary-300);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .faq-item__trigger[aria-expanded="true"] {
        color: var(--primary-300);
    }
}

.faq-item__panel {
    background: var(--t-elevated);
    border-top: 1px solid var(--t-border);
}

.faq-item__body {
    padding: 18px 20px 20px;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--t-default);
}

.faq-item__body p + p {
    margin-top: 12px;
}

/* Code answers ride theme.css's terminal card. */
.faq-item__body .termcard {
    margin-top: 16px;
    background: var(--t-surface);
}

.faq-item__body .termcard__bar {
    background: var(--t-accented);
}

.faq-item__body .termcard pre {
    color: var(--t-default);
}

.faq-item__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 16px;
}

.faq-item__links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-600);
}

.faq-item__links a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.faq-item__links a:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 3px;
}

.faq-item__links i {
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.faq-item__links a:hover i {
    transform: translateX(3px);
}

:root[data-theme="dark"] .faq-item__links a {
    color: var(--primary-300);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .faq-item__links a {
        color: var(--primary-300);
    }
}

/* ---------------------------------------------------------- Empty results */

.help-empty {
    width: min(100% - 48px, 520px);
    margin: 0 auto;
    padding: 60px 0 64px;
    text-align: center;
}

.help-empty__icon {
    font-size: 1.5rem;
    color: var(--t-dimmed);
}

.help-empty__title {
    margin-top: 14px;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--t-highlighted);
}

.help-empty__text {
    margin-top: 8px;
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--t-muted);
}

.help-empty__text a {
    font-weight: 600;
    color: var(--primary-600);
    text-decoration: underline;
    text-underline-offset: 3px;
}

:root[data-theme="dark"] .help-empty__text a {
    color: var(--primary-300);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .help-empty__text a {
        color: var(--primary-300);
    }
}

/* -------------------------------------------------------- Longer reading */

.help-reading__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 4px 32px;
    margin-top: 22px;
}

.help-reading__grid .pairlink + .pairlink {
    margin-top: 0;
}

.help-reading__item {
    padding: 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-xl);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.help-reading__item:hover {
    background: var(--t-elevated);
    border-color: var(--t-border);
}

.help-reading__item:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* --------------------------------------------------------------- Contact */

.help-contact .band__grid {
    gap: 40px 64px;
    align-items: start;
}

.help-contact__list.banlist li {
    line-height: 1.65;
}

.help-contact__aside {
    padding: 20px;
    background: var(--t-elevated);
    border: 1px solid var(--t-border);
    border-radius: var(--radius-2xl);
}

.help-contact__aside .pairlink {
    display: block;
    padding: 10px 0;
}

.help-contact__aside .pairlink + .pairlink {
    margin-top: 0;
    border-top: 1px solid var(--t-border);
}

.help-contact__aside .pairlink__row {
    overflow-wrap: anywhere;
}

.help-contact__aside .pairlink:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

.help-contact__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--t-border);
}

/* ---------------------------------------------------------- Narrow width */

@media (max-width: 640px) {
    .help-hero {
        padding-top: 56px;
        padding-bottom: 132px;
    }

    .help-find__input {
        padding: 14px 14px 14px 44px;
        font-size: 0.9375rem;
    }

    .help-find__icon {
        left: 17px;
    }

    .help-topics.liftcard {
        padding: 18px 16px 20px;
    }

    .faq-item__trigger {
        gap: 12px;
        padding: 15px 16px;
        font-size: 0.9375rem;
    }

    .faq-item__body {
        padding: 16px;
    }

    .help-contact__aside {
        padding: 16px;
    }

    .help-contact__actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .help-topics .catchip {
        padding: 7px 10px;
        font-size: 0.75rem;
    }

    .help-contact__actions .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .help-find__input,
    .faq-item__trigger,
    .faq-item__chevron,
    .faq-item__links i,
    .help-reading__item,
    .help-topics .catchip {
        transition: none;
    }

    .faq-item__links a:hover i {
        transform: none;
    }
}
