/* curator documentation — pkg.go.dev inspired */

:root {
    --bg: #fff;
    --bg-secondary: #f8f9fa;
    --bg-code: #f6f8fa;
    --text: #202124;
    --text-secondary: #5f6368;
    --text-muted: #80868b;
    --link: #1967d2;
    --link-hover: #174ea6;
    --border: #dadce0;
    --accent: #1a73e8;
    --header-bg: #f8f9fa;
    --header-border: #e8eaed;
    --badge-bg: #e8f0fe;
    --badge-text: #1967d2;
    --code-bg: #f6f8fa;
    --max-width: 960px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1e1e1e;
        --bg-secondary: #252526;
        --bg-code: #2d2d2d;
        --text: #d4d4d4;
        --text-secondary: #a0a0a0;
        --text-muted: #707070;
        --link: #6cb6ff;
        --link-hover: #8dc9ff;
        --border: #404040;
        --accent: #6cb6ff;
        --header-bg: #252526;
        --header-border: #333;
        --badge-bg: #1e3a5f;
        --badge-text: #6cb6ff;
        --code-bg: #2d2d2d;
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

code, pre {
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
    font-size: 14px;
}

/* Header */
.header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    padding: 12px 0;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    font-weight: 600;
    font-size: 18px;
    color: var(--text);
}

.header-logo:hover { text-decoration: none; color: var(--text); }

/* Breadcrumb */
.breadcrumb {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 24px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--link); }

/* Main content */
.content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px;
}

/* Module header */
.module-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.module-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    word-break: break-all;
}

.module-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.version-badge {
    display: inline-block;
    padding: 2px 10px;
    background: var(--badge-bg);
    color: var(--badge-text);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.version-select {
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    gap: 0;
}

.tab {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab:hover { color: var(--text); text-decoration: none; }

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Documentation */
.doc-section {
    margin-bottom: 32px;
}

.doc-section h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.doc-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 8px;
}

.doc-comment {
    margin-bottom: 16px;
}

.doc-comment p { margin-bottom: 8px; }
.doc-comment pre {
    background: var(--code-bg);
    padding: 12px 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.5;
}
.doc-comment code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
}
.doc-comment ul, .doc-comment ol {
    padding-left: 24px;
    margin-bottom: 8px;
}
.doc-comment li {
    margin-bottom: 4px;
}
.doc-comment a { color: var(--link); }

/* Doc layout: inline or pinned sidebar */
.doc-layout {
    /* Default: stacked (index then body) */
}


/* Index */
.index {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.index h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.index > ul {
    list-style: none;
}

.index ul ul {
    list-style: none;
    padding-left: 20px;
}

.index li {
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    padding: 2px 0;
}


.idx-entry {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 6px;
    align-items: baseline;
}

.idx-entry > ul {
    grid-column: 1 / -1;
    padding-left: 24px;
}

.idx-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    font-family: system-ui, sans-serif;
    flex-shrink: 0;
}

.idx-func { background: #e3f2fd; color: #1565c0; }
.idx-type { background: #e8f5e9; color: #2e7d32; }
.idx-const { background: #fff3e0; color: #e65100; }
.idx-var { background: #f3e5f5; color: #7b1fa2; }
.idx-method { background: #e0f7fa; color: #00695c; }

@media (prefers-color-scheme: dark) {
    .idx-func { background: #1a3a5c; color: #90caf9; }
    .idx-type { background: #1b3a1b; color: #81c784; }
    .idx-const { background: #3e2723; color: #ffab91; }
    .idx-var { background: #2a1a3e; color: #ce93d8; }
    .idx-method { background: #1a3a3a; color: #80cbc4; }
}

a.idx-icon {
    text-decoration: none;
}

a.idx-icon:hover {
    opacity: 0.8;
}

/* Type and function blocks */
.type-block {
    border-top: 2px solid var(--border);
    padding-top: 20px;
    margin-top: 24px;
}

.type-block:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.type-heading {
    font-size: 20px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.func-block {
    border-top: 1px solid var(--border);
    padding-top: 16px;
    margin-top: 16px;
}

.func-block:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

/* Declaration blocks */
.decl {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 16px;
    margin: 8px 0 16px;
    overflow-x: auto;
}

.decl pre {
    margin: 0;
    white-space: pre;
}

.func-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.func-header h3 {
    margin: 0;
    font-size: 16px;
}

.func-header .source-link {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 3px;
}

.func-header .source-link:hover {
    background: var(--bg-secondary);
    text-decoration: none;
    color: var(--accent);
}

/* Sub-package table */
.pkg-table {
    width: 100%;
    border-collapse: collapse;
}

.pkg-table th {
    text-align: left;
    padding: 8px 12px;
    border-bottom: 2px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.pkg-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.pkg-table td:first-child {
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    white-space: nowrap;
}

/* README */
.readme {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 24px;
}

.readme pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 14px;
}

/* Source code */
.source-code {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.5;
}

.source-code td {
    padding: 0;
    vertical-align: top;
}

.source-code pre {
    margin: 0;
    padding: 0 12px;
    white-space: pre;
}

.line-num {
    width: 1%;
    min-width: 50px;
    padding: 0 12px 0 8px !important;
    text-align: right;
    color: var(--text-muted);
    user-select: none;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
}

.line-num a {
    color: var(--text-muted);
    text-decoration: none;
}

.line-num a:hover { color: var(--accent); }

.line-code { width: 99%; }

:target > .line-code {
    background: var(--badge-bg);
}

/* Versions list */
.version-list {
    list-style: none;
}

.version-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.version-list li:last-child { border-bottom: none; }

.version-list .version-tag {
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    font-weight: 500;
}

.version-list .version-current {
    color: var(--accent);
    font-weight: 600;
}

/* Files list */
.file-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.file-list li a {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", Menlo, monospace;
    font-size: 13px;
}

.file-list li a:hover {
    background: var(--badge-bg);
    text-decoration: none;
}

/* Footer */
.footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}
