/* Pigskin Prophet docs site — Stripe-ish layout built on our ff-* design tokens */

/* Docs is a standalone site (the global app rail is suppressed on /docs) — this
   is its own dedicated two-pane layout with navigation back to the app. */
.docs-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    background: transparent;          /* sits on the app body (navy-800) */
    color: #e2e8f0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Sidebar — the docs site's own full-height nav (on-brand navy/gold chrome) */
.docs-sidebar {
    background: var(--pp-navy-900, #060E1A);
    border-right: 1px solid var(--pp-gold-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.docs-sidebar-header {
    padding: 0 1.25rem 1rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15);
    margin-bottom: 1rem;
}
.docs-backlink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    letter-spacing: .03em;
    color: var(--pp-text-muted, #94a3b8);
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: color 0.1s;
}
.docs-backlink:hover { color: var(--pp-gold, #f59e0b); }
.docs-home {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    text-decoration: none;
    margin-bottom: 0.6rem;
}
.docs-home:hover { color: #f59e0b; }
.docs-search-trigger {
    display: flex; align-items: center; gap: 6px;
    width: 100%;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(100, 116, 139, 0.2);
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
}
.docs-search-trigger:hover { border-color: #f59e0b; color: #e2e8f0; }
.docs-search-trigger kbd {
    margin-left: auto;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(100, 116, 139, 0.2);
    font-size: 10px;
    color: #cbd5e1;
}

.docs-nav { padding: 0 0.75rem; }
.docs-nav-section { margin-bottom: 1.5rem; }
.docs-nav-heading {
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    padding: 0 0.75rem 0.4rem;
    margin: 0;
}
.docs-nav-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex; flex-direction: column;
    gap: 1px;
}
.docs-nav-link {
    display: block;
    padding: 6px 12px;
    border-radius: 6px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    transition: 0.1s;
}
.docs-nav-link:hover { background: rgba(30, 41, 59, 0.6); color: #f1f5f9; }
.docs-nav-link.is-active {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    font-weight: 600;
}

/* Main column */
.docs-main {
    padding: 2.5rem 3rem 5rem;
    max-width: 860px;
    margin: 0 auto;
    width: 100%;
}
.docs-breadcrumb {
    display: flex; gap: 6px;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 0.5rem;
}
.docs-breadcrumb a { color: #64748b; text-decoration: none; }
.docs-breadcrumb a:hover { color: #f59e0b; }

.docs-article-header h1 {
    font-size: 32px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin: 0.25rem 0 0;
}
.docs-article-subtitle {
    font-size: 16px;
    color: #94a3b8;
    margin: 0.6rem 0 2rem;
    line-height: 1.5;
}

/* Markdown body */
.markdown-body h1 {
    font-size: 30px; font-weight: 800; color: #f8fafc;
    letter-spacing: -0.5px; line-height: 1.15;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}
.markdown-body h1:first-child { margin-top: 0; }
.markdown-body h2 {
    font-size: 22px; font-weight: 700; color: #f1f5f9;
    margin: 2rem 0 0.75rem;
    scroll-margin-top: 80px;
}
.markdown-body h3 {
    font-size: 17px; font-weight: 700; color: #e2e8f0;
    margin: 1.5rem 0 0.5rem;
}
.markdown-body p, .markdown-body li {
    font-size: 15px; line-height: 1.7; color: #cbd5e1;
}
.markdown-body p { margin: 0 0 1rem; }
.markdown-body a { color: #f59e0b; text-decoration: none; }
.markdown-body a:hover { text-decoration: underline; }

.markdown-body ul, .markdown-body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.markdown-body li { margin-bottom: 0.3rem; }
.markdown-body li > p { margin-bottom: 0.3rem; }

.markdown-body code {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    color: #fbbf24;
}
.markdown-body pre {
    background: #1e293b;
    border: 1px solid rgba(100, 116, 139, 0.25);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1rem 0 1.5rem;
    font-size: 13px;
}
.markdown-body pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 13px;
}

.markdown-body blockquote {
    border-left: 3px solid #f59e0b;
    background: rgba(245, 158, 11, 0.06);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    color: #cbd5e1;
    font-style: italic;
}

/* Tables */
.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0 1.5rem;
    font-size: 13px;
    border: 1px solid rgba(100, 116, 139, 0.2);
}
.markdown-body th, .markdown-body td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15);
}
.markdown-body th {
    background: rgba(30, 41, 59, 0.7);
    color: #f1f5f9;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
.markdown-body tr:last-child td { border-bottom: none; }
.markdown-body tbody tr:hover { background: rgba(30, 41, 59, 0.4); }

/* Admonitions (mkdocs-style) */
.markdown-body .admonition {
    border-left: 3px solid #0ea5e9;
    background: rgba(14, 165, 233, 0.08);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 6px 6px 0;
}
.markdown-body .admonition.tip { border-left-color: #10b981; background: rgba(16, 185, 129, 0.08); }
.markdown-body .admonition.warning { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.markdown-body .admonition.caution,
.markdown-body .admonition.danger { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.markdown-body .admonition-title {
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 0.25rem;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Heading anchor links */
.docs-heading-anchor {
    margin-left: 8px;
    color: #475569;
    font-size: 13px;
    opacity: 0;
    transition: 0.15s;
    text-decoration: none;
}
.markdown-body h2:hover .docs-heading-anchor,
.markdown-body h3:hover .docs-heading-anchor { opacity: 1; }

/* Mermaid */
.mermaid {
    background: #1e293b;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

/* Footer nav */
.docs-footer-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(100, 116, 139, 0.2);
}
.docs-nav-prev, .docs-nav-next {
    display: flex;
    flex-direction: column;
    padding: 0.8rem 1rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(100, 116, 139, 0.2);
    border-radius: 8px;
    text-decoration: none;
    color: #cbd5e1;
    transition: 0.15s;
}
.docs-nav-next { text-align: right; align-items: flex-end; }
.docs-nav-prev:hover, .docs-nav-next:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}
.docs-nav-direction {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 3px;
}
.docs-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
}

/* Floating Ask AI trigger */
.docs-ask-ai-trigger {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 24px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #1e293b;
    font-weight: 700;
    font-size: 13px;
    border: none;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3), 0 2px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: 0.2s;
}
.docs-ask-ai-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
}
.docs-ask-ai-trigger i { font-size: 16px; }

/* Search overlay */
.docs-search-overlay, .docs-ask-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding: 6vh 1rem 1rem;
}
.docs-search-overlay.is-open, .docs-ask-overlay.is-open { display: flex; }

.docs-search-panel {
    width: min(600px, 100%);
    background: #1e293b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.docs-search-panel input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    color: #f1f5f9;
    font-size: 16px;
    outline: none;
}
#docs-search-results {
    max-height: 60vh;
    overflow-y: auto;
}
.docs-search-result {
    display: block;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(100, 116, 139, 0.15);
    text-decoration: none;
    color: #cbd5e1;
    transition: 0.1s;
}
.docs-search-result:hover, .docs-search-result.is-focused {
    background: rgba(245, 158, 11, 0.1);
    color: #f1f5f9;
}
.docs-search-result-title {
    font-weight: 600;
    color: #f1f5f9;
    font-size: 13px;
}
.docs-search-result-section {
    color: #64748b;
    font-size: 11px;
    margin-left: 6px;
}
.docs-search-result-snippet {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 2px;
}
.docs-search-result-snippet mark {
    background: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    padding: 0 2px;
}
.docs-search-hint {
    padding: 8px 16px;
    border-top: 1px solid rgba(100, 116, 139, 0.15);
    font-size: 11px;
    color: #64748b;
    text-align: right;
}
.docs-search-hint kbd {
    padding: 1px 5px;
    background: rgba(100, 116, 139, 0.2);
    border-radius: 3px;
}

/* Ask AI overlay */
.docs-ask-panel {
    width: min(680px, 100%);
    background: #1e293b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}
.docs-ask-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(100, 116, 139, 0.2);
}
.docs-ask-header h3 {
    margin: 0;
    font-size: 16px;
    color: #f1f5f9;
}
.docs-ask-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
}
.docs-ask-close:hover { color: #ef4444; }
.docs-ask-intro {
    padding: 0.75rem 1.25rem;
    font-size: 12px;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.6);
    border-bottom: 1px solid rgba(100, 116, 139, 0.15);
}
.docs-ask-intro code {
    background: rgba(100, 116, 139, 0.2);
    padding: 1px 4px;
    border-radius: 3px;
    color: #fbbf24;
}
.docs-ask-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    font-size: 14px;
    color: #e2e8f0;
}
.docs-ask-message {
    margin-bottom: 1.25rem;
}
.docs-ask-message.user {
    font-weight: 600;
    color: #fbbf24;
}
.docs-ask-message.ai {
    line-height: 1.6;
}
.docs-ask-message.ai pre, .docs-ask-message.ai code {
    background: rgba(15, 23, 42, 0.8);
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 13px;
}
.docs-ask-sources {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.docs-ask-source-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
    text-decoration: none;
}
.docs-ask-source-chip:hover { background: rgba(14, 165, 233, 0.2); }
.docs-ask-form {
    display: flex;
    gap: 8px;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(100, 116, 139, 0.15);
}
.docs-ask-form input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(100, 116, 139, 0.3);
    background: rgba(15, 23, 42, 0.8);
    color: #f1f5f9;
    font-size: 14px;
}
.docs-ask-form input:focus { outline: none; border-color: #f59e0b; }
.docs-ask-submit {
    padding: 8px 14px;
    background: #f59e0b;
    color: #1e293b;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
}
.docs-ask-submit:hover { background: #d97706; }
.docs-ask-submit:disabled { opacity: 0.5; cursor: wait; }

/* Mobile */
@media (max-width: 800px) {
    .docs-shell { grid-template-columns: 1fr; }
    .docs-sidebar {
        position: static;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    }
    .docs-main { padding: 1.5rem 1rem 3rem; }
    .docs-footer-nav { grid-template-columns: 1fr; }
    .docs-nav-next { text-align: left; align-items: flex-start; }
}

/* ==========================================================================
   Light theme overrides — flip surfaces, keep gold accents
   ========================================================================== */

[data-theme="light"] .docs-shell {
    background: transparent;
    color: #0A1628;
}
/* .docs-sidebar background uses var(--pp-navy-900) which is #FFFFFF in light mode,
   so no background override is needed here — just keep the gold hairline. */
[data-theme="light"] .docs-sidebar {
    border-right: 1px solid var(--pp-gold-border);
}
[data-theme="light"] .docs-sidebar-header {
    border-bottom-color: rgba(10, 22, 40, 0.06);
}
[data-theme="light"] .docs-home {
    color: #0A1628;
}
[data-theme="light"] .docs-home:hover { color: #B8941E; }
[data-theme="light"] .docs-search-trigger {
    background: #F5F7FA;
    border-color: rgba(10, 22, 40, 0.1);
    color: #3D4A5F;
}
[data-theme="light"] .docs-search-trigger:hover {
    border-color: #B8941E;
    color: #0A1628;
}
[data-theme="light"] .docs-search-trigger kbd {
    background: rgba(10, 22, 40, 0.06);
    color: #3D4A5F;
}
[data-theme="light"] .docs-nav-heading {
    color: #6B7F99;
}
[data-theme="light"] .docs-nav-link {
    color: #3D4A5F;
}
[data-theme="light"] .docs-nav-link:hover,
[data-theme="light"] .docs-nav-link.active {
    background: rgba(184, 148, 30, 0.08);
    color: #B8941E;
}
[data-theme="light"] .docs-main {
    background: #F5F7FA;
    color: #0A1628;
}
[data-theme="light"] .docs-breadcrumb {
    color: #6B7F99;
}
[data-theme="light"] .docs-breadcrumb a {
    color: #3D4A5F;
}
[data-theme="light"] .docs-article h1,
[data-theme="light"] .docs-article h2,
[data-theme="light"] .docs-article h3 {
    color: #0A1628;
}
[data-theme="light"] .docs-article p,
[data-theme="light"] .docs-article li {
    color: #3D4A5F;
}
[data-theme="light"] .docs-article a {
    color: #B8941E;
}
[data-theme="light"] .docs-article a:hover {
    color: #8A6E0E;
}
[data-theme="light"] .docs-article code {
    background: rgba(184, 148, 30, 0.1);
    color: #8A6E0E;
}
[data-theme="light"] .docs-article pre {
    background: #0A1628;
    color: #E8ECF1;
}
[data-theme="light"] .docs-article pre code {
    background: transparent;
    color: inherit;
}
[data-theme="light"] .docs-article blockquote,
[data-theme="light"] .docs-callout {
    background: #FFFFFF;
    border-left-color: #B8941E;
    color: #0A1628;
}
[data-theme="light"] .docs-article table {
    border-color: rgba(10, 22, 40, 0.1);
}
[data-theme="light"] .docs-article th {
    background: #F5F7FA;
    color: #0A1628;
}
[data-theme="light"] .docs-article td {
    border-color: rgba(10, 22, 40, 0.06);
    color: #3D4A5F;
}
[data-theme="light"] .docs-footer-nav {
    border-top-color: rgba(10, 22, 40, 0.1);
}
[data-theme="light"] .docs-nav-prev a,
[data-theme="light"] .docs-nav-next a {
    background: #FFFFFF;
    border: 1px solid rgba(10, 22, 40, 0.1);
    color: #0A1628;
}
[data-theme="light"] .docs-nav-prev a:hover,
[data-theme="light"] .docs-nav-next a:hover {
    border-color: #B8941E;
}
[data-theme="light"] .docs-ask-button {
    background: #B8941E;
    color: #FFFFFF;
}
[data-theme="light"] .docs-ask-modal {
    background: rgba(10, 22, 40, 0.5);
}
[data-theme="light"] .docs-ask-panel {
    background: #FFFFFF;
    color: #0A1628;
}
[data-theme="light"] .docs-ask-input {
    background: #F5F7FA;
    border-color: rgba(10, 22, 40, 0.1);
    color: #0A1628;
}
