/*
  Help & Documentation.

  Builds on top of website/css/onyxjar.css — reuses --ff-* tokens and the
  existing .ff-card / .ff-grid / .ff-legal / .ff-empty / .ff-form-card
  components; only adds what Help needs on top of them.
*/

:root {
    /* Docs pages get a wider shell than the marketing site's --ff-container
       (1140px): more room for a 3-column layout before text gets cramped.
       --ff-help-sidebar-w / --ff-help-toc-w / --ff-help-gap are shared
       between the layout grid and the breadcrumb row's desktop indent, so
       the breadcrumb lines up with the article column instead of the
       sidebar. */
    --ff-help-container: 1320px;
    --ff-help-sidebar-w: 16rem;
    --ff-help-toc-w: 15rem;
    --ff-help-gap: 3rem;
}

.ff-help-wide {
    --ff-container: var(--ff-help-container);
}

/* ---- Search -------------------------------------------------------------- */

.ff-help-search {
    max-width: 34rem;
    margin-top: 1.75rem;
}

.ff-help-search-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.ff-help-search-row {
    display: flex;
    gap: 0.75rem;
}

.ff-help-search-row input {
    flex: 1;
    min-width: 0;
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--ff-radius-sm);
    background: #fff;
    color: var(--ff-ink);
    font: inherit;
}

.ff-help-search-row input:focus {
    border-color: var(--ff-indigo);
    outline: 3px solid rgba(31, 27, 67, 0.25);
    outline-offset: 0;
}

.ff-help-search-prompt {
    color: var(--ff-text-muted);
}

.ff-help-results-count {
    margin-bottom: 1rem;
    color: var(--ff-text-muted);
    font-size: 0.9rem;
}

.ff-help-results {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 1.25rem;
}

.ff-help-result {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--ff-border);
}

.ff-help-result:last-child {
    border-bottom: none;
}

.ff-help-result-title {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
}

.ff-help-result-title:hover {
    text-decoration: underline;
}

.ff-help-result-excerpt {
    margin: 0.35rem 0 0;
    color: var(--ff-text-muted);
}

/* ---- Category grid -------------------------------------------------------- */

.ff-help-categories .ff-card {
    display: block;
    position: relative;
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ff-help-categories .ff-card:hover {
    border-color: var(--ff-slate);
    box-shadow: var(--ff-shadow);
}

.ff-help-categories .ff-card:nth-child(1) .ff-card-facet {
    background: linear-gradient(135deg, #1f1b43, #191636);
}

.ff-help-categories .ff-card:nth-child(2) .ff-card-facet {
    background: linear-gradient(135deg, #59957d, #2f7a5d);
}

.ff-help-categories .ff-card:nth-child(3) .ff-card-facet {
    background: linear-gradient(135deg, #5ea9b5, #3694a3);
}

.ff-help-categories .ff-card:nth-child(4) .ff-card-facet {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.ff-help-categories .ff-card:nth-child(5) .ff-card-facet {
    background: linear-gradient(135deg, #7a4a7a, #540054);
}

.ff-help-categories .ff-card:nth-child(6) .ff-card-facet {
    background: linear-gradient(135deg, #e0b35a, #cd912d);
}

.ff-badge {
    display: inline-flex;
    margin-top: 1rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.ff-badge--soon {
    background: var(--ff-mist);
    color: var(--ff-text-muted);
}

/* ---- Breadcrumbs ------------------------------------------------------------ */

.ff-help-breadcrumbs-row {
    padding-top: 1.5rem;
}

@media (min-width: 861px) {
    /* Only the article page's breadcrumb row sits above the 3-column grid,
       so only it (ff-help-wide) gets indented to line up with the article
       column rather than the sidebar. The category/landing/search pages
       have no sidebar to align against. */
    .ff-help-wide.ff-help-breadcrumbs-row {
        /* padding-left is a longhand, so it replaces (not adds to) the
           padding-inline gutter from .ff-container — include that gutter
           explicitly or the row loses its base inset entirely. */
        padding-left: calc(var(--ff-gutter) + var(--ff-help-sidebar-w) + var(--ff-help-gap));
    }
}

.ff-help-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    color: var(--ff-text-muted);
}

.ff-help-breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 0.4rem;
    color: var(--ff-slate);
}

.ff-help-breadcrumbs a {
    color: var(--ff-text-muted);
    text-decoration: none;
}

.ff-help-breadcrumbs a:hover {
    text-decoration: underline;
}

.ff-help-breadcrumbs [aria-current="page"] {
    color: var(--ff-text);
    font-weight: 600;
}

/* ---- Category article list -------------------------------------------------- */

.ff-help-article-list {
    display: grid;
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    max-width: 44rem;
}

.ff-help-article-list li {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--ff-border);
}

.ff-help-article-list li:last-child {
    border-bottom: none;
}

.ff-help-article-list a {
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
}

.ff-help-article-list a:hover {
    text-decoration: underline;
}

.ff-help-article-list p {
    margin: 0.35rem 0 0;
    color: var(--ff-text-muted);
}

/* ---- Article layout: sidebar / content / TOC -------------------------------- */

.ff-help-layout {
    display: grid;
    grid-template-columns: var(--ff-help-sidebar-w) minmax(0, 1fr) var(--ff-help-toc-w);
    gap: var(--ff-help-gap);
    align-items: start;
}

.ff-help-panel {
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius);
    background: var(--ff-surface);
}

.ff-help-panel--mobile summary {
    padding: 0.85rem 1rem;
    font-weight: 600;
    cursor: pointer;
}

.ff-help-panel-label {
    margin: 0;
    padding: 0.85rem 1rem 0.5rem;
    color: var(--ff-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ff-help-sidebar-body,
.ff-help-toc-body {
    padding: 0 1rem 1rem;
}

.ff-help-panel--mobile .ff-help-sidebar-body,
.ff-help-panel--mobile .ff-help-toc-body {
    padding-top: 0.25rem;
}

.ff-help-sidebar-group + .ff-help-sidebar-group {
    margin-top: 1.1rem;
}

.ff-help-sidebar-category {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ff-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}

.ff-help-sidebar-category:hover,
.ff-help-sidebar-category.is-active {
    color: var(--ff-indigo);
}

.ff-help-sidebar-body ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ff-help-sidebar-body li a {
    display: block;
    padding: 0.3rem 0 0.3rem 0.7rem;
    border-left: 2px solid transparent;
    color: var(--ff-text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    text-decoration: none;
}

.ff-help-sidebar-body li a:hover {
    color: var(--ff-text);
    border-left-color: var(--ff-border);
}

.ff-help-sidebar-body li a[aria-current="page"] {
    border-left-color: var(--ff-indigo);
    color: var(--ff-indigo);
    font-weight: 600;
    background: var(--ff-mist);
}

.ff-help-toc-body ul {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 2px solid var(--ff-border);
}

.ff-help-toc-item a {
    display: block;
    padding: 0.3rem 0 0.3rem 0.85rem;
    margin-left: -2px;
    border-left: 2px solid transparent;
    color: var(--ff-text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    text-decoration: none;
}

.ff-help-toc-item a:hover {
    color: var(--ff-text);
    border-left-color: var(--ff-slate);
}

.ff-help-toc-item--h3 a {
    padding-left: 1.6rem;
    font-size: 0.8rem;
}

/* The sidebar and TOC each render twice: a plain, always-visible <nav> for
   desktop, and a native <details> disclosure for mobile. Only one is shown
   at a time via plain display toggling — this is deliberate, not an
   oversight: an earlier version tried to force a *closed* <details> to stay
   visible on desktop via CSS, but Chromium (and other engines) hide a
   closed <details>'s content through an internal content box that a
   `display` override on the children does not reliably defeat. Two
   independent, ordinary elements sidestep that entirely. */
.ff-help-panel--desktop {
    display: none;
}

@media (min-width: 861px) {
    .ff-help-panel--desktop {
        display: block;
    }

    .ff-help-panel--mobile {
        display: none;
    }
}

@media (max-width: 860px) {
    .ff-help-layout {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ---- Article content: tables, code, callouts -------------------------------- */

.ff-help-updated {
    margin: 0.35rem 0 1.75rem;
    color: var(--ff-text-muted);
    font-size: 0.875rem;
}

.ff-help-article h2[id],
.ff-help-article h3[id] {
    scroll-margin-top: calc(var(--ff-header-h) + 1rem);
}

.ff-help-article table {
    width: 100%;
    margin: 1.25rem 0;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.ff-help-article th,
.ff-help-article td {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--ff-border);
    text-align: left;
}

.ff-help-article th {
    background: var(--ff-mist);
    font-weight: 700;
}

.ff-help-article pre {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border-radius: var(--ff-radius-sm);
    background: var(--ff-ink);
    color: #f1f5f9;
    overflow-x: auto;
    font-size: 0.9rem;
}

.ff-help-article code {
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: var(--ff-mist);
    font-size: 0.9em;
}

.ff-help-article pre code {
    padding: 0;
    background: none;
}

.ff-help-article .admonition {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--ff-border);
    border-left-width: 4px;
    border-radius: var(--ff-radius-sm);
    background: var(--ff-mist);
}

.ff-help-article .admonition-title {
    margin: 0 0 0.4rem;
    font-weight: 700;
}

.ff-help-article .admonition.note {
    border-left-color: var(--onyxjar-info);
}

.ff-help-article .admonition.warning {
    border-left-color: var(--onyxjar-warning);
}

/* ---- Prev/next and related --------------------------------------------------- */

.ff-help-after {
    display: grid;
    gap: 2rem;
    padding-bottom: var(--ff-section-y);
}

.ff-help-prevnext {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.ff-help-prevnext-link {
    display: block;
    padding: 1rem 1.25rem;
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius);
    background: var(--ff-surface);
    text-decoration: none;
    transition: border-color 0.15s;
}

.ff-help-prevnext-link:hover {
    border-color: var(--ff-slate);
}

.ff-help-prevnext-link--next {
    text-align: right;
}

.ff-help-prevnext-label {
    display: block;
    color: var(--ff-text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ff-help-prevnext-title {
    display: block;
    margin-top: 0.3rem;
    color: var(--ff-text);
    font-weight: 700;
}

.ff-help-related {
    padding-top: 0.5rem;
    border-top: 1px solid var(--ff-border);
}

.ff-help-related ul {
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.ff-help-related a {
    text-decoration: none;
}

.ff-help-related a:hover {
    text-decoration: underline;
}

@media (max-width: 720px) {
    .ff-help-prevnext {
        grid-template-columns: 1fr;
    }

    .ff-help-prevnext-link--next {
        text-align: left;
    }
}

/* ---- Intermediate widths: keep the 3-column grid from getting cramped ------- */

@media (min-width: 861px) and (max-width: 1080px) {
    :root {
        --ff-help-sidebar-w: 13rem;
        --ff-help-toc-w: 12rem;
        --ff-help-gap: 2rem;
    }
}
