/* ==========================================================================
   AutoCrafterAI — Docs + Help Center (index + article with sidebar)
   ========================================================================== */

/* --- Index: category cards --- */
.docs-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.docs-card {
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 24px 12px;
}
.docs-card-title { font-family: var(--font-heading); font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 0 0 14px; }
.docs-card-list { list-style: none; margin: 0; padding: 0; }
.docs-card-list li { border-top: 1px solid var(--border); }
.docs-card-list li:first-child { border-top: 0; }
.docs-card-link { display: block; padding: 12px 0; }
.docs-card-link-title { display: block; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.docs-card-link:hover .docs-card-link-title { color: var(--brand); }
.docs-card-link-excerpt { display: block; font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); margin-top: 2px; }

.docs-empty { max-width: 520px; margin: 0 auto; text-align: center; padding: 40px 0; }
.docs-empty h2 { font-family: var(--font-heading); font-size: 24px; margin: 0 0 10px; }
.docs-empty p { color: var(--text-secondary); }
.docs-empty a { color: var(--brand); font-weight: 600; }

/* --- Article: two-column layout --- */
.docs-layout { display: grid; grid-template-columns: 260px 1fr; gap: 48px; align-items: start; padding-top: 48px; padding-bottom: 72px; }

/* Sidebar */
.docs-sidebar { position: sticky; top: 96px; }
.docs-sidebar-toggle { display: none; }
.docs-nav { font-size: 14.5px; }
.docs-nav-home {
    display: block; font-weight: 700; color: var(--text-primary);
    padding: 6px 0 14px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
}
.docs-nav-home.is-active, .docs-nav-home:hover { color: var(--brand); }
.docs-search { margin: 14px 0 4px; }
.docs-search-input {
    width: 100%; padding: 8px 12px; font-size: 14px;
    color: var(--text-primary); background-color: var(--bg-main);
    border: 1px solid var(--border); border-radius: 8px;
}
.docs-search-input:focus { outline: none; border-color: var(--brand-bright); box-shadow: 0 0 0 3px var(--brand-tint); }
.docs-search-empty { font-size: 14px; color: var(--text-secondary); padding: 8px 0; }
.docs-nav-group { margin-top: 20px; }
.docs-nav-heading { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 8px; }
.docs-nav-list { list-style: none; margin: 0; padding: 0; }
.docs-nav-link {
    display: block; padding: 6px 12px; margin-left: -12px;
    color: var(--text-secondary); border-radius: 8px; line-height: 1.4;
}
.docs-nav-link:hover { color: var(--text-primary); background-color: var(--bg-soft); }
.docs-nav-link.is-active { color: var(--brand); font-weight: 600; background-color: var(--brand-tint); }

/* Article head */
.docs-article { min-width: 0; }
.docs-head { margin-bottom: 26px; }
.docs-eyebrow { display: inline-block; margin-bottom: 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--brand); }
.docs-title { font-family: var(--font-heading); font-size: clamp(28px, 4vw, 38px); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; color: var(--text-primary); }
.docs-lead { margin: 14px 0 0; font-size: 18px; line-height: 1.6; color: var(--text-secondary); }

/* Article body typography (self-contained — does not depend on blog.css) */
.docs-body { font-size: 16.5px; line-height: 1.8; color: var(--text-secondary); }
.docs-body > *:first-child { margin-top: 0; }
.docs-body h2 { font-family: var(--font-heading); font-size: clamp(22px, 3vw, 27px); font-weight: 800; color: var(--text-primary); margin: 40px 0 14px; letter-spacing: -0.01em; }
.docs-body h3 { font-family: var(--font-heading); font-size: 19px; font-weight: 700; color: var(--text-primary); margin: 30px 0 10px; }
.docs-body p { margin: 0 0 20px; }
.docs-body a { color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.docs-body ul, .docs-body ol { margin: 0 0 20px; padding-left: 24px; }
.docs-body li { margin: 0 0 8px; }
.docs-body blockquote { margin: 0 0 20px; padding: 4px 0 4px 22px; border-left: 3px solid var(--brand-bright); color: var(--text-primary); font-style: italic; }
.docs-body code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 14.5px; background-color: var(--brand-tint); padding: 2px 6px; border-radius: 4px; color: var(--text-primary); }
.docs-body pre { margin: 0 0 20px; padding: 18px 20px; overflow-x: auto; background-color: #0f1e25; color: #e8f1f3; border-radius: var(--radius); }
.docs-body pre code { background: transparent; padding: 0; color: inherit; font-size: 14px; }
.docs-body img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 8px 0 20px; }
.docs-body table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 15px; }
.docs-body th, .docs-body td { text-align: left; padding: 10px 12px; border: 1px solid var(--border); }
.docs-body th { background-color: var(--bg-soft); font-weight: 700; color: var(--text-primary); }

/* Prev / next pager */
.docs-pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.docs-pager-link { display: flex; flex-direction: column; gap: 4px; max-width: 48%; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); }
.docs-pager-link:hover { border-color: var(--brand-bright); }
.docs-pager-link--next { text-align: right; margin-left: auto; }
.docs-pager-dir { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.docs-pager-title { font-weight: 600; color: var(--text-primary); }

.docs-foot { margin-top: 32px; padding: 18px 20px; background-color: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.docs-foot p { margin: 0; font-size: 15px; color: var(--text-primary); }
.docs-foot a { color: var(--brand); font-weight: 700; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .docs-cards { grid-template-columns: 1fr; }
    .docs-layout { grid-template-columns: 1fr; gap: 0; }
    .docs-sidebar { position: static; margin-bottom: 24px; }
    .docs-sidebar-toggle {
        display: block; width: 100%; text-align: left;
        padding: 12px 16px; font-size: 15px; font-weight: 600;
        color: var(--text-primary); background-color: var(--bg-soft);
        border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
    }
    .docs-sidebar-panel { display: none; padding-top: 16px; }
    .docs-sidebar-panel.is-open { display: block; }
    .docs-pager-link { max-width: 100%; }
}
