/* Docs */

:root {
    /* START -- EDITABLE IN PANEL */
    --color-text: #1a1a1a;
    --color-link: #2d663d;
    --color-background: #ffffff;
    --color-border: #e5e5e5;
    /* END -- EDITABLE IN PANEL */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-background);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* Sidebar Navigation */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    padding: 1.5rem;
    background: #fafafa;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-sizing: border-box;
}

.site-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #000;
    display: block;
    line-height: 1.4;
}

.site-title a { color: inherit; text-decoration: none; }

.site-title-parent {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: #666;
    margin-bottom: 0.25rem;
}

.site-title-parent:hover { color: var(--color-link); }

.site-title-sep { display: none; }

.site-title-current {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #000;
}

.site-nav ul {
    padding: 0;
    margin: 0;
    display: block;
    list-style: none;
}

.site-nav li { margin-bottom: 2px; }

.site-nav a {
    display: block;
    padding: 6px 10px;
    color: #666;
    font-size: 14px;
    border-radius: 5px;
    transition: all 0.1s;
}

/* Typist Sidebar Folders / Hierarchy */
.site-nav .active a {
    background: #e8f0e9; /* Light green tint */
    color: var(--color-link);
    font-weight: 500;
}

.site-nav a:hover {
    background: #f5f5f5;
    color: var(--color-text);
    text-decoration: none;
}

/* Sidebar Section Headers (Upper Case) */
.site-nav li:has(ul)::before {
    content: "DOCUMENTATION"; /* Example static label if structure allows */
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #ccc;
    margin: 20px 0 10px 10px;
    letter-spacing: 0.1em;
}

/* Main Content Area */

.blocks {
    margin-left: 280px;
    padding: 2rem 3rem;
    max-width: 900px;
}

.block-detail-title {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

/* Text & Typography */

.block-text h2 {
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.block-text p { margin-bottom: 1.25rem; }

/* Callout / Note Style (Typist specific) */
.block-text blockquote {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: #f5f5f5;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-border);
    border-radius: 6px;
    color: #666;
    font-size: 14px;
}

.block-text blockquote::before {
    content: "Note";
    display: block;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    font-size: 13px;
}

/* Code Blocks */

.block-text pre {
    background: #fdfdfd;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.block-text code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9em;
    color: #d73a49; /* Standard "Readme" red for inline code */
    background: #f6f8fa;
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.block-text pre code {
    background: transparent;
    color: #24292e;
    padding: 0;
}

/* General */

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

.site-description {
    font-size: 14px;
    color: #666;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.site-description p { margin: 0.2em 0; }

.site-meta {
    font-size: 13px;
    color: #999;
    margin-bottom: 1rem;
}

.site-collaborators a { color: var(--color-link); }
.site-rss { color: #999; }

.collaborator-avatar {
    width: 1rem;
    height: 1rem;
    min-width: 1rem;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 0.25rem;
    object-fit: cover;
}

/* Blocks */

.block {
    margin-bottom: 2rem;
}

.block-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.block-title a {
    color: var(--color-text);
    text-decoration: none;
}

.block-title a:hover { color: var(--color-link); }

/* Images */

.block-image {
    margin-bottom: 2rem;
}

.block-image img {
    max-width: 100%;
    border-radius: 8px;
    display: block;
}

.block-image figcaption,
.block-image .block-title {
    font-size: 13px;
    font-weight: 400;
    color: #666;
    margin-top: 0.5rem;
}

/* Channel blocks */

.block-channel .block-content > a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    transition: border-color 0.15s, background 0.15s;
}

.block-channel .block-content > a:hover {
    border-color: var(--color-border);
    background: #f5f5f5;
    text-decoration: none;
}

.block-channel .channel-preview {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.block-channel .channel-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-link);
}

/* Link blocks */

.block-link .block-content > a {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.block-link .block-content > a:hover {
    border-color: var(--color-border);
    background: #f5f5f5;
    text-decoration: none;
}

.block-link .link-preview {
    width: 48px;
    min-width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.block-link .link-info { min-width: 0; }
.block-link .link-title { display: block; font-weight: 500; color: var(--color-link); font-size: 14px; }
.block-link .link-url { display: block; font-size: 12px; color: #999; margin-top: 2px; word-break: break-all; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 500px; }
.block-link .link-provider { display: block; font-size: 12px; color: #666; margin-top: 2px; }

/* Embed blocks */

.block-embed .embed-container {
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.block-embed .embed-container iframe {
    aspect-ratio: 16/9;
    width: 100%;
    border: none;
    border-radius: 8px;
}

.block-embed-video,
.block-attachment-video {
    width: 100%;
}

.block-embed-video video,
.block-attachment-video video {
    display: block;
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
}

.block-embed-audio audio,
.block-attachment-audio audio {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
}

/* Attachment blocks */

.block-attachment-file {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    background: #f5f5f5;
}

.block-attachment-file .attachment-preview {
    max-width: 100%;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: block;
}

.block-attachment-file a { color: var(--color-link); font-size: 14px; }

/* Continue reading */

.continue-reading {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-link);
    margin-top: 0.25rem;
}

/* Block meta */

.block-meta {
    font-size: 12px;
    color: #999;
    margin-top: 0.5rem;
}

.block-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.block-date { color: #999; }

.block-contributor a {
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.block-contributor a:hover { color: var(--color-link); text-decoration: none; }

.block-permalink {
    color: #999;
    text-decoration: none;
    font-size: 11px;
}

.block-permalink:hover { color: var(--color-link); }

.block-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 0.3rem;
    line-height: 1.5;
}

/* Block detail */

.block-detail {
    margin-left: 280px;
    max-width: 900px;
    padding: 2rem 3rem;
}

.block-detail .block { margin: 0; }

/* Text extras */

.block-text h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

.block-text h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
}

.block-text ul, .block-text ol {
    padding-left: 1.5em;
    margin-bottom: 1.25rem;
}

.block-text li { margin-bottom: 0.3em; }

.block-text a { color: var(--color-link); }

.block-text hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

.block-text img {
    max-width: 100%;
    border-radius: 8px;
}

.block-text table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: 14px;
}

.block-text th, .block-text td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.block-text th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 13px;
}

.block-text tr:hover td {
    background: #f5f5f5;
}

/* Pagination */

.pagination {
    margin-left: 280px;
    padding: 1.5rem 4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 14px;
    border-top: 1px solid var(--color-border);
}

.pagination a {
    color: var(--color-link);
    font-weight: 500;
}

.page-info { color: #999; }

/* Starstar badge */

.starstar-badge {
    margin-left: 280px;
    padding: 0 4rem 2rem;
    opacity: 0.25;
    display: inline-block;
}

.starstar-badge:hover { opacity: 0.5; }
.starstar-badge img { width: 60px; }

/* Responsive */

@media (max-width: 768px) {
    .site-header {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
    .blocks,
    .block-detail,
    .pagination,
    .starstar-badge {
        margin-left: 0;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    .blocks { padding-top: 2rem; padding-bottom: 2rem; }
}