﻿/* =========================================================
   StoryInterpreter Documentation – Stylesheet
   ========================================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg:           #0f1117;
    --color-surface:      #1a1d27;
    --color-surface-alt:  #21253a;
    --color-border:       #2d3250;
    --color-accent:       #7c9eff;
    --color-accent-dim:   #3d5299;
    --color-text:         #c4c9f0;
    --color-text-muted:   #9ab2c6;
    --color-heading:      #e0e8ff;
    --color-tag-bg:       #1e2a4a;
    --color-tag-text:     #88aaff;
    --color-return-bg:    #1a2e22;
    --color-return-text:  #6fcf97;
    --color-param-bg:     #2a1e3a;
    --color-param-text:   #c792ea;
    --color-code-bg:      #141722;
    --color-code-text:    #a5d6ff;
    --color-note-bg:      #1e2a1e;
    --color-note-border:  #4a7a4a;
    --color-warn-bg:      #2a2010;
    --color-warn-border:  #c08020;
    --color-warn-text:    #f0c060;
    --radius:             8px;
    --radius-sm:          4px;
    --sidebar-width:      260px;
    --font-mono:          "Cascadia Code", "Fira Code", "Consolas", monospace;
    --font-sans:          "Segoe UI", system-ui, -apple-system, sans-serif;
    --transition:         0.18s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.7;
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────── */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--color-surface);
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 16px;
}

.sidebar-logo h2 {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-logo h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--color-heading);
    margin-top: 4px;
}

.sidebar nav {
    padding: 0 8px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    padding: 12px 12px 4px;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li a {
    display: block;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 13.5px;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
    background-color: var(--color-surface-alt);
    color: var(--color-accent);
}

/* ── Main content ─────────────────────────────────────────── */

.main {
    margin-left: var(--sidebar-width);
    flex: 1;
    max-width: 960px;
    padding: 48px 52px 80px;
}

/* ── Page header ──────────────────────────────────────────── */

.page-header {
    margin-bottom: 48px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--color-border);
}

.breadcrumb {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.breadcrumb span {
    color: var(--color-accent);
}

.page-header h1 {
    font-size: 34px;
    font-weight: 700;
    color: var(--color-heading);
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.page-header .summary {
    font-size: 16px;
    color: var(--color-text-muted);
    max-width: 700px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.tag {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    background: var(--color-tag-bg);
    color: var(--color-tag-text);
    border: 1px solid var(--color-accent-dim);
}

/* ── Sections ─────────────────────────────────────────────── */

section {
    margin-bottom: 52px;
}

section h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 8px;
}

/* ── Overview table ───────────────────────────────────────── */

.overview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.overview-table th {
    text-align: left;
    padding: 8px 14px;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--color-border);
}

.overview-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.overview-table tr:last-child td {
    border-bottom: none;
}

.overview-table tr:hover td {
    background: var(--color-surface);
}

.overview-table td a {
    color: var(--color-accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 13px;
}

.overview-table td a:hover {
    text-decoration: underline;
}

.overview-table td:last-child {
    color: var(--color-text-muted);
}

/* ── Member cards ─────────────────────────────────────────── */

.member-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}

.member-card-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 14px 20px;
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.member-card-header .member-name {
    font-family: var(--font-mono);
    font-size: 14.5px;
    color: var(--color-code-text);
    font-weight: 600;
}

.member-card-header .member-type {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--color-param-text);
}

.member-card-header .member-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    background: var(--color-tag-bg);
    color: var(--color-tag-text);
    border: 1px solid var(--color-accent-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.member-card-body {
    padding: 16px 20px;
}

.member-card-body p {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-bottom: 14px;
}

.member-card-body p:last-child {
    margin-bottom: 0;
}

/* ── Parameter / Returns tables ───────────────────────────── */

.params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin-top: 10px;
}

.params-table th {
    text-align: left;
    padding: 6px 12px;
    background: var(--color-code-bg);
    color: var(--color-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--color-border);
}

.params-table td {
    padding: 7px 12px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.params-table tr:last-child td {
    border-bottom: none;
}

.params-table .col-name {
    font-family: var(--font-mono);
    color: var(--color-param-text);
    white-space: nowrap;
}

.params-table .col-type {
    font-family: var(--font-mono);
    color: var(--color-code-text);
    white-space: nowrap;
}

.params-table .col-desc {
    color: var(--color-text-muted);
}

.return-row {
    margin-top: 10px;
    padding: 8px 12px;
    background: var(--color-return-bg);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(111, 207, 151, 0.25);
    font-size: 13.5px;
}

.return-row .return-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-return-text);
    margin-bottom: 2px;
}

.return-row .return-type {
    font-family: var(--font-mono);
    color: var(--color-code-text);
}

.return-row .return-desc {
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* ── Code blocks ──────────────────────────────────────────── */

code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    background: var(--color-code-bg);
    color: var(--color-code-text);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

pre {
    background: var(--color-code-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-code-text);
    margin: 12px 0;
}

/* ── Callout boxes ────────────────────────────────────────── */

.callout {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 3px solid;
    margin: 14px 0;
    font-size: 13.5px;
}

.callout.note {
    background: var(--color-note-bg);
    border-color: var(--color-note-border);
    color: var(--color-text-muted);
}

.callout.warning {
    background: var(--color-warn-bg);
    border-color: var(--color-warn-border);
    color: var(--color-warn-text);
}

.callout strong {
    color: var(--color-heading);
}

/* ── Command reference table ──────────────────────────────── */

.command-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.command-table th {
    text-align: left;
    padding: 8px 14px;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--color-border);
}

.command-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.command-table tr:last-child td {
    border-bottom: none;
}

.command-table tr:hover td {
    background: var(--color-surface);
}

.command-table .col-keyword {
    font-family: var(--font-mono);
    color: var(--color-code-text);
    font-weight: 600;
    white-space: nowrap;
}

.command-table .col-class {
    font-family: var(--font-mono);
    color: var(--color-param-text);
    font-size: 13px;
}

.command-table .col-desc {
    color: var(--color-text-muted);
}

/* ── Return-code table ────────────────────────────────────── */

.return-code-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.return-code-table th {
    text-align: left;
    padding: 8px 14px;
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 1px solid var(--color-border);
}

.return-code-table td {
    padding: 8px 14px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.return-code-table tr:last-child td {
    border-bottom: none;
}

.return-code-table tr:hover td {
    background: var(--color-surface);
}

.return-code-table .col-code {
    font-family: var(--font-mono);
    color: var(--color-code-text);
    font-weight: 700;
    text-align: center;
}

.return-code-table .col-name {
    font-weight: 600;
    color: var(--color-heading);
}

.return-code-table .col-desc {
    color: var(--color-text-muted);
}

/* ── Struct block ─────────────────────────────────────────── */

.struct-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.struct-block-header {
    padding: 10px 20px;
    background: var(--color-surface-alt);
    border-bottom: 1px solid var(--color-border);
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--color-code-text);
    font-weight: 600;
}

.struct-block-body {
    padding: 14px 20px;
}

/* ── Scrollbar ────────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-dim);
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 800px) {
    .sidebar {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 28px 20px 60px;
    }
}
