:root {
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
    
    --color-background: #ffffff;
    --color-text: #333333;
    --color-text-muted: #666666;
    --color-link: #0366d6;
    --color-link-hover: #2188ff;
    --color-border: #e1e4e8;
    --color-heading: #24292e;
    --color-code-bg: #f6f8fa;
    --color-blockquote: #f0f4f8;
    --color-sidebar-bg: #f8f9fa;
    
    --spacing-unit: 16px;
    --content-width: 760px;
    --sidebar-width: 280px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-background: #0d1117;
        --color-text: #c9d1d9;
        --color-text-muted: #8b949e;
        --color-link: #58a6ff;
        --color-link-hover: #79c0ff;
        --color-border: #30363d;
        --color-heading: #e6edf3;
        --color-code-bg: #161b22;
        --color-blockquote: #161b22;
        --color-sidebar-bg: #0d1117;
    }
}

html {
    box-sizing: border-box;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

*, *:before, *:after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    display: flex;
    min-height: 100vh;
    font-size: 1rem;
}

/* Layout */
aside {
    position: fixed;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    padding: var(--spacing-unit);
    border-right: 1px solid var(--color-border);
    background-color: var(--color-sidebar-bg);
}

aside nav ul {
    padding-left: 0;
    list-style-type: none;
}

aside nav li {
    margin-bottom: calc(var(--spacing-unit) / 2);
}

aside nav li a {
    display: block;
    padding: calc(var(--spacing-unit) / 4) 0;
    text-decoration: none;
    color: var(--color-text);
    border-radius: 4px;
    transition: color 0.2s ease;
}

aside nav li a:hover {
    color: var(--color-link-hover);
}

main {
    flex: 1;
    padding: var(--spacing-unit) var(--spacing-unit) var(--spacing-unit) calc(var(--sidebar-width) + var(--spacing-unit));
    max-width: calc(var(--content-width) + var(--sidebar-width) + var(--spacing-unit));
    margin: 0 auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: calc(var(--spacing-unit) * 2);
    margin-bottom: var(--spacing-unit);
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-heading);
}

h1 { font-size: 2em; border-bottom: 1px solid var(--color-border); padding-bottom: calc(var(--spacing-unit) / 2); }
h2 { font-size: 1.5em; border-bottom: 1px solid var(--color-border); padding-bottom: calc(var(--spacing-unit) / 2); }
h3 { font-size: 1.25em; }
h4 { font-size: 1em; }
h5 { font-size: 0.875em; }
h6 { font-size: 0.85em; color: var(--color-text-muted); }

p, ul, ol, dl, blockquote, table, pre {
    margin-top: 0;
    margin-bottom: var(--spacing-unit);
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

code, pre {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background-color: var(--color-code-bg);
    border-radius: 3px;
}

code {
    padding: 0.2em 0.4em;
}

pre {
    padding: var(--spacing-unit);
    overflow-x: auto;
    line-height: 1.45;
    border-radius: 6px;
}

pre code {
    padding: 0;
    background-color: transparent;
}

blockquote {
    margin-left: 0;
    padding: var(--spacing-unit);
    background-color: var(--color-blockquote);
    border-left: 4px solid var(--color-border);
}

table {
    border-collapse: collapse;
    width: 100%;
}

table th, table td {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
}

table th {
    background-color: var(--color-code-bg);
    font-weight: 600;
}

img {
    max-width: 100%;
    height: auto;
}

/* Custom styles for article content */
#articleContent {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

/* Responsive adjustments */
@media screen and (max-width: 900px) {
    :root {
        --sidebar-width: 220px;
    }
    
    body {
        font-size: 0.95rem;
    }
}

@media screen and (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    aside {
        position: static;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
    
    main {
        padding: var(--spacing-unit);
        max-width: var(--content-width);
        margin: 0 auto;
    }
} 