/* DigitalClay3D — Help / User Manual styling for the marketing website.
   ----------------------------------------------------------------------
   The help pages share style.css with the marketing site (so .site-nav,
   .brand, .nav-links, .site-footer all come from there — no redefinition
   here, no collisions). What this file adds is *only* the docs-specific
   layout + the .doc-article body rules, which are copied verbatim from
   wwwroot/css/app.css so the website pages and the in-app HelpViewer
   render content identically. If you change one, change the other. */

/* Mark the active "Documentation" item in the top nav. style.css doesn't
   define a `.nav-links a.active` rule, so we add one here without
   touching style.css. Class is `.active-help` to avoid colliding with
   any unrelated `.active` rule the marketing JS may toggle elsewhere. */
.nav-links a.active-help { color: var(--accent); }

/* ---------- Page layout ---------- */
/* Chapter pages — sticky ToC sidebar on the left, article on the right.
   Uses the marketing site's --max-w (1180px) so the help body lines up
   visually with the marketing sections. */
.help-page-grid {
    display: grid;
    grid-template-columns: 240px 1fr;
    max-width: var(--max-w);
    margin: 0 auto;
    min-height: calc(100vh - 56px);
}
/* Index page — flat container, no sidebar. Dedicated class (not a
   modifier on .help-page-grid) so the chapter grid can never be trapped
   in a 240px sidebar column. */
.help-page-flat {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 var(--pad);
    min-height: calc(100vh - 56px);
}

/* ---------- ToC sidebar (chapter pages) ---------- */
/* Mirrors the in-app .help-sidebar / .help-nav-item styling so the
   website chapter list reads the same as the in-app one. */
.help-toc {
    padding: 22px 12px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 56px;
    align-self: start;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
}
.help-toc-title {
    padding: 0 12px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.help-toc-title a { color: inherit; text-decoration: none; }
.help-nav-item {
    display: block;
    padding: 9px 14px;
    margin: 1px 0;
    border-radius: 6px;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font: 500 13px var(--font-ui);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}
.help-nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.help-nav-item.active {
    background: var(--bg-input);
    color: var(--accent-light);
    border-left: 3px solid var(--accent);
    padding-left: 11px;
}

/* ---------- Article body (.doc-article) ----------
   Copied verbatim from wwwroot/css/app.css so the website chapter pages
   and the in-app HelpViewer render content with identical typography,
   colors, and spacing. Both rely on the same CSS variables (--accent,
   --accent-light, --bg-input, --border, --text-primary, --text-muted)
   defined in :root by both stylesheets. Two fallbacks below cover the
   handful of vars the marketing site doesn't currently expose. */
:root {
    --accent-dim: rgba(217, 149, 107, 0.45);   /* used by .doc-article a underline */
    --bg-elevated: var(--bg-panel);            /* used by .doc-article img background */
}
.doc-article {
    max-width: 820px;
    margin: 0 auto;
    color: var(--text-primary);
    font: 15px/1.65 var(--font-ui);
    padding: 32px 48px;
}
.doc-article h1 {
    font: 700 28px/1.25 var(--font-ui);
    color: var(--accent-light);
    margin: 0 0 18px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.doc-article h2 {
    font: 600 21px/1.3 var(--font-ui);
    color: var(--text-primary);
    margin: 32px 0 12px 0;
}
.doc-article h3 {
    font: 600 17px/1.35 var(--font-ui);
    color: var(--accent-light);
    margin: 24px 0 8px 0;
}
.doc-article p { margin: 12px 0; }
.doc-article a {
    color: var(--accent-light);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-dim);
}
.doc-article a:hover { border-bottom-style: solid; }
.doc-article ul, .doc-article ol { padding-left: 24px; margin: 10px 0; }
.doc-article li { margin: 4px 0; }
.doc-article code {
    background: var(--bg-input);
    color: var(--accent-light);
    padding: 2px 6px;
    border-radius: 4px;
    font: 13px var(--font-mono);
    border: 1px solid var(--border);
}
.doc-article pre {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 18px;
    overflow-x: auto;
    font: 13px/1.5 var(--font-mono);
    color: var(--text-primary);
}
.doc-article pre code { background: transparent; padding: 0; border: none; }
.doc-article blockquote {
    border-left: 3px solid var(--accent);
    margin: 14px 0;
    padding: 8px 16px;
    background: rgba(255, 158, 64, 0.05);
    color: var(--text-secondary);
    border-radius: 0 4px 4px 0;
}
.doc-article table {
    border-collapse: collapse;
    margin: 16px 0;
    width: 100%;
    font-size: 14px;
}
.doc-article th, .doc-article td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
.doc-article th {
    background: var(--bg-panel);
    color: var(--accent-light);
    font-weight: 600;
}
.doc-article tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
.doc-article img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 12px 0;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}
.doc-article hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 28px 0;
}
.doc-article .doc-extlink-stub {
    color: var(--text-muted);
    font-style: italic;
}

/* Wide variant for the index page — stretches the article to fit the
   full page width so the chapter card grid lays out as multiple columns
   instead of stacking. Compound selector beats the bare .doc-article
   max-width regardless of source order. */
.doc-article.doc-article-wide {
    max-width: var(--max-w);
    padding: 32px 0;
}

/* ---------- Index-page chapter grid ----------
   Dark feature-card aesthetic matching the marketing site's
   .feature-card so the docs landing page feels like a continuation of
   the home page rather than a different site. */
.help-lede {
    font-size: 17px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 8px 0 28px;
    max-width: 720px;
}
.help-chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 28px 0 56px;
}
.help-chapter-card {
    display: block;
    padding: 22px 24px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s;
}
.help-chapter-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    text-decoration: none;
}
.help-chapter-card strong {
    display: block;
    color: var(--text-primary);
    font-size: 16px;
}

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
    .help-page-grid { grid-template-columns: 1fr; }
    .help-toc {
        position: static;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .doc-article { padding: 24px; font-size: 14px; }
    .help-chapter-grid { grid-template-columns: 1fr; }
}