/* StudioPro documentation (/docs) — docs layout on top of marketing.css.
   Palette aligned to the marketing brand: indigo-600 #4f46e5 + zinc neutrals. */

:root {
    --docs-accent: #4f46e5;
    --docs-accent-soft: #eef2ff;
    --docs-ink: #18181b;
    --docs-body: #3f3f46;
    --docs-muted: #71717a;
    --docs-border: #e4e4e7;
    --docs-bg-soft: #fafafa;
}

.docs-wrap { padding: 2rem 0 4rem; background: #fff; }

.docs-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 220px;
    gap: 2.5rem;
    align-items: start;
}

/* ---- Mobile menu bar (hidden on desktop) ---- */
.docs-mobile-bar { display: none; }
.docs-overlay { display: none; }

/* ---- Sidebar ---- */
.docs-sidebar {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    font-size: .9rem;
    padding-right: .5rem;
}
.docs-search-box { position: relative; margin-bottom: 1.25rem; }
.docs-search-box i { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--docs-muted); font-size: .85rem; }
.docs-search-box input {
    width: 100%; padding: .5rem .7rem .5rem 2rem;
    border: 1px solid var(--docs-border); border-radius: 8px; font-size: .85rem; background: var(--docs-bg-soft);
}
.docs-search-box input:focus { outline: none; border-color: var(--docs-accent); background: #fff; }

.docs-nav-group { margin-bottom: 1rem; }
.docs-nav-cat {
    display: flex; align-items: center; gap: .4rem; width: 100%;
    font-weight: 700; color: var(--docs-ink); text-decoration: none; background: none; border: 0;
    text-transform: uppercase; letter-spacing: .03em; font-size: .72rem;
    padding: .25rem 0; margin-bottom: .25rem; cursor: pointer;
}
.docs-nav-cat:hover { color: var(--docs-accent); }
.docs-nav-cat .docs-nav-chevron { margin-left: auto; transition: transform .15s; font-size: .7rem; color: var(--docs-muted); }
.docs-nav-group.collapsed .docs-nav-chevron { transform: rotate(-90deg); }
.docs-nav-group.collapsed .docs-nav-body { display: none; }

.docs-nav-articles { list-style: none; padding: 0; margin: 0 0 .25rem; }
.docs-nav-articles li a {
    display: block; padding: .28rem .6rem; color: var(--docs-body); text-decoration: none;
    border-radius: 6px; border-left: 2px solid transparent;
}
.docs-nav-articles li a:hover { background: #f4f4f5; color: var(--docs-ink); }
.docs-nav-articles li a.active { color: var(--docs-accent); font-weight: 600; border-left-color: var(--docs-accent); background: var(--docs-accent-soft); }
.docs-nav-sub { margin: .35rem 0 .35rem .25rem; }
.docs-nav-subcat { display: block; font-weight: 600; color: #52525b; text-decoration: none; font-size: .82rem; margin: .3rem 0 .2rem; }
.docs-nav-subcat:hover { color: var(--docs-accent); }

/* ---- Main column ---- */
.docs-main { min-width: 0; }
.docs-main > * { max-width: 768px; }   /* comfortable reading measure */
.docs-breadcrumb { font-size: .82rem; color: var(--docs-muted); margin-bottom: 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
.docs-breadcrumb a { color: var(--docs-muted); text-decoration: none; }
.docs-breadcrumb a:hover { color: var(--docs-accent); }
.docs-breadcrumb i { font-size: .7rem; }

.docs-title { font-weight: 800; font-size: 2.1rem; color: var(--docs-ink); margin-bottom: 1rem; line-height: 1.2; }
.docs-lead { font-size: 1.05rem; color: var(--docs-body); margin-bottom: 1.5rem; }

/* Rendered Markdown content */
.docs-content { color: var(--docs-body); line-height: 1.7; font-size: 1rem; }
.docs-content > *:first-child { margin-top: 0; }
.docs-content h2 { font-weight: 700; font-size: 1.5rem; margin: 2.25rem 0 .85rem; color: var(--docs-ink); scroll-margin-top: 90px; line-height: 1.3; }
.docs-content h3 { font-weight: 700; font-size: 1.2rem; margin: 1.75rem 0 .5rem; color: var(--docs-ink); scroll-margin-top: 90px; }
.docs-content p { margin: 0 0 1rem; }
.docs-content ul, .docs-content ol { margin: 0 0 1rem 1.25rem; }
.docs-content li { margin-bottom: .4rem; }
.docs-content a { color: var(--docs-accent); text-decoration: underline; text-underline-offset: 2px; }
.docs-content img { max-width: 100%; height: auto; border-radius: 8px; }
.docs-content blockquote { border-left: 3px solid #c7d2fe; background: var(--docs-bg-soft); margin: 1rem 0; padding: .75rem 1rem; color: var(--docs-body); border-radius: 0 8px 8px 0; }
.docs-content code { background: #f4f4f5; padding: .15rem .4rem; border-radius: 4px; font-size: .88em; color: #be123c; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.docs-content pre { background: #18181b; color: #e4e4e7; padding: 1rem 1.1rem; border-radius: 10px; overflow-x: auto; margin: 0 0 1.25rem; font-size: .88rem; line-height: 1.5; }
.docs-content pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.docs-content table { width: 100%; border-collapse: collapse; margin: 0 0 1.25rem; font-size: .92rem; }
.docs-content th, .docs-content td { border: 1px solid var(--docs-border); padding: .5rem .7rem; text-align: left; }
.docs-content th { background: var(--docs-bg-soft); font-weight: 600; }

/* ---- Callouts / admonitions ---- */
.docs-callout { display: flex; gap: .7rem; padding: .85rem 1rem; border-radius: 10px; margin: 0 0 1.25rem; border: 1px solid; }
.docs-callout-icon { font-size: 1.1rem; line-height: 1.6; flex-shrink: 0; }
.docs-callout-body { min-width: 0; }
.docs-callout-body > *:last-child { margin-bottom: 0; }
.docs-callout-note,
.docs-callout-info      { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.docs-callout-note .docs-callout-icon,
.docs-callout-info .docs-callout-icon { color: #2563eb; }
.docs-callout-tip       { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.docs-callout-tip .docs-callout-icon { color: #059669; }
.docs-callout-warning   { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.docs-callout-warning .docs-callout-icon { color: #d97706; }
.docs-callout-important { background: var(--docs-accent-soft); border-color: #c7d2fe; color: #3730a3; }
.docs-callout-important .docs-callout-icon { color: var(--docs-accent); }
.docs-callout-danger    { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.docs-callout-danger .docs-callout-icon { color: #dc2626; }
.docs-callout a { color: inherit; }

/* Prev / next */
.docs-prevnext { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--docs-border); }
.docs-prevnext a { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; padding: .75rem 1rem; border: 1px solid var(--docs-border); border-radius: 10px; min-width: 0; max-width: 48%; }
.docs-prevnext a:hover { border-color: var(--docs-accent); background: var(--docs-bg-soft); }
.docs-next { text-align: right; margin-left: auto; }
.docs-pn-label { font-size: .75rem; color: var(--docs-muted); }
.docs-pn-title { font-weight: 600; color: var(--docs-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Right TOC ---- */
.docs-toc { position: sticky; top: 90px; font-size: .82rem; max-height: calc(100vh - 110px); overflow-y: auto; }
.docs-toc-title { text-transform: uppercase; letter-spacing: .04em; font-size: .7rem; font-weight: 700; color: var(--docs-muted); margin-bottom: .6rem; }
.docs-toc ul { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--docs-border); }
.docs-toc li a { display: block; padding: .25rem 0 .25rem .8rem; color: var(--docs-muted); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.docs-toc li a:hover { color: var(--docs-accent); border-left-color: var(--docs-accent); }
.docs-toc li a.active { color: var(--docs-accent); border-left-color: var(--docs-accent); font-weight: 600; }
.docs-toc-h3 a { padding-left: 1.5rem; font-size: .78rem; }

/* Draft preview banner */
.docs-draft-banner { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: .6rem .9rem; border-radius: 8px; margin-bottom: 1.25rem; font-size: .9rem; }

/* ---- Landing / cards ---- */
.docs-hero { margin-bottom: 2.5rem; }
.docs-hero h1 { font-weight: 800; font-size: 2.4rem; color: var(--docs-ink); margin-bottom: .5rem; }
.docs-hero p { color: var(--docs-body); font-size: 1.1rem; }
.docs-search-hero { position: relative; max-width: 520px; margin-top: 1.25rem; }
.docs-search-hero i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--docs-muted); }
.docs-search-hero input { width: 100%; padding: .8rem 1rem .8rem 2.6rem; border: 1px solid var(--docs-border); border-radius: 12px; font-size: 1rem; }
.docs-search-hero input:focus { outline: none; border-color: var(--docs-accent); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }

.docs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; max-width: none; }
.docs-card { border: 1px solid var(--docs-border); border-radius: 14px; padding: 1.25rem; transition: box-shadow .15s, border-color .15s; }
.docs-card:hover { border-color: #c7d2fe; box-shadow: 0 8px 24px rgba(24,24,27,.06); }
.docs-card-head { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--docs-ink); text-decoration: none; font-size: 1.05rem; margin-bottom: .75rem; }
.docs-card-head i { color: var(--docs-accent); }
.docs-card ul { list-style: none; padding: 0; margin: 0; }
.docs-card li a { display: block; padding: .28rem 0; color: var(--docs-body); text-decoration: none; font-size: .9rem; }
.docs-card li a:hover { color: var(--docs-accent); }

/* ---- Category / article list ---- */
.docs-subcats { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.docs-subcat-pill { padding: .35rem .85rem; border: 1px solid var(--docs-border); border-radius: 999px; color: var(--docs-body); text-decoration: none; font-size: .85rem; }
.docs-subcat-pill:hover { border-color: var(--docs-accent); color: var(--docs-accent); }
.docs-article-list { list-style: none; padding: 0; margin: 0; }
.docs-article-list li { border-bottom: 1px solid var(--docs-border); }
.docs-article-list li a { display: block; padding: .9rem .25rem; text-decoration: none; }
.docs-article-list li a:hover { background: var(--docs-bg-soft); }
.docs-al-title { display: block; font-weight: 600; color: var(--docs-ink); }
.docs-al-excerpt { display: block; font-size: .88rem; color: var(--docs-muted); margin-top: .15rem; }

/* ---- Not found ---- */
.docs-notfound { text-align: center; padding: 3rem 1rem; }
.docs-notfound i { font-size: 3rem; color: #c7d2fe; }
.docs-notfound h1 { font-weight: 800; margin: 1rem 0 .5rem; color: var(--docs-ink); }
.docs-notfound p { color: var(--docs-muted); margin-bottom: 1.5rem; }

/* ---- "Was this helpful?" feedback ---- */
.docs-feedback { margin-top: 2.5rem; padding: 1.25rem 0; border-top: 1px solid var(--docs-border); }
.docs-fb-prompt { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.docs-fb-prompt > span { font-weight: 600; color: var(--docs-ink); }
.docs-fb-btn {
    display: inline-flex; align-items: center; gap: .35rem;
    border: 1px solid var(--docs-border); background: #fff; color: var(--docs-body);
    border-radius: 8px; padding: .4rem .9rem; font-size: .9rem; cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.docs-fb-btn:hover { border-color: var(--docs-accent); color: var(--docs-accent); background: var(--docs-accent-soft); }
.docs-fb-comment { margin-top: 1rem; max-width: 560px; }
.docs-fb-comment label { display: block; font-size: .9rem; color: var(--docs-body); margin-bottom: .4rem; }
.docs-fb-comment textarea { width: 100%; border: 1px solid var(--docs-border); border-radius: 8px; padding: .6rem .8rem; font-size: .9rem; resize: vertical; }
.docs-fb-comment textarea:focus { outline: none; border-color: var(--docs-accent); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.docs-fb-send { margin-top: .6rem; border: 0; background: var(--docs-accent); color: #fff; border-radius: 8px; padding: .45rem 1rem; font-size: .9rem; cursor: pointer; }
.docs-fb-send:hover { filter: brightness(1.05); }
.docs-fb-thanks { font-weight: 600; color: #065f46; }

/* ---- Reading meta + related ---- */
.docs-meta { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--docs-muted); font-size: .85rem; margin: -.5rem 0 1.5rem; }
.docs-meta i { margin-right: .25rem; }
.docs-related { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--docs-border); }
.docs-related h2 { font-size: 1.2rem; font-weight: 700; color: var(--docs-ink); margin-bottom: .5rem; }

/* ---- Code copy button ---- */
.docs-content pre { position: relative; }
.docs-copy { position: absolute; top: .5rem; right: .5rem; background: rgba(255,255,255,.1); color: #e4e4e7; border: 0; border-radius: 6px; padding: .25rem .45rem; font-size: .8rem; cursor: pointer; opacity: 0; transition: opacity .15s; }
.docs-content pre:hover .docs-copy { opacity: 1; }
.docs-copy:hover { background: rgba(255,255,255,.22); }

/* ---- Heading hover-anchors ---- */
.docs-content h2, .docs-content h3 { position: relative; }
.docs-h-anchor { position: absolute; left: -1.1rem; top: 0; color: var(--docs-muted); text-decoration: none; opacity: 0; font-weight: 400; }
.docs-content h2:hover .docs-h-anchor, .docs-content h3:hover .docs-h-anchor { opacity: .55; }
.docs-h-anchor:hover { opacity: 1 !important; color: var(--docs-accent); }

/* ---- Search typeahead ---- */
.docs-kbd { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); font-size: .65rem; color: var(--docs-muted); border: 1px solid var(--docs-border); border-radius: 4px; padding: .05rem .3rem; background: #fff; pointer-events: none; }
.docs-suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--docs-border); border-radius: 10px; box-shadow: 0 8px 24px rgba(24,24,27,.1); z-index: 30; max-height: 340px; overflow-y: auto; }
.docs-suggest-item { display: block; padding: .55rem .8rem; text-decoration: none; border-bottom: 1px solid #f4f4f5; }
.docs-suggest-item:last-child { border-bottom: 0; }
.docs-suggest-item:hover { background: var(--docs-bg-soft); }
.docs-suggest-title { display: block; font-weight: 600; color: var(--docs-ink); font-size: .9rem; }
.docs-suggest-ex { display: block; font-size: .8rem; color: var(--docs-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-suggest-empty { padding: .6rem .8rem; color: var(--docs-muted); font-size: .85rem; }
.docs-suggest mark, .docs-content mark, .docs-article-list mark { background: #fef9c3; color: inherit; padding: 0 .1em; border-radius: 2px; }

/* ---- Responsive: sidebar becomes an off-canvas drawer ---- */
@media (max-width: 991px) {
    .docs-grid { grid-template-columns: 1fr; }
    .docs-toc { display: none; }
    .docs-main > * { max-width: none; }

    .docs-mobile-bar {
        display: flex; align-items: center; gap: .5rem;
        margin-bottom: 1.25rem;
    }
    .docs-menu-toggle {
        display: inline-flex; align-items: center; gap: .4rem;
        border: 1px solid var(--docs-border); background: #fff; border-radius: 8px;
        padding: .45rem .8rem; font-size: .9rem; color: var(--docs-ink); cursor: pointer;
    }

    .docs-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; z-index: 1050;
        width: 280px; max-height: none; background: #fff; padding: 1.25rem 1rem;
        box-shadow: 2px 0 16px rgba(0,0,0,.15);
        transform: translateX(-100%); transition: transform .2s ease;
        overflow-y: auto;
    }
    .docs-sidebar.open { transform: translateX(0); }
    .docs-overlay.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1040; }
}
