/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --accent-color: #0066cc;
    --code-bg: #f5f5f5;
    --max-width: 800px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --text-secondary: #999999;
        --border-color: #333333;
        --accent-color: #4d9fff;
        --code-bg: #2d2d2d;
    }
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    font-size: 16px;
}

/* Header and Navigation */
header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-bottom: 3rem;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--accent-color);
}

/* Main Content */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    min-height: calc(100vh - 200px);
}

/* Home Page */
.home .content {
    margin-bottom: 3rem;
}

.home h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.recent-posts {
    margin-top: 3rem;
}

.recent-posts h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.posts-grid {
    display: grid;
    gap: 1.5rem;
}

.post-card {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: border-color 0.2s;
}

.post-card:hover {
    border-color: var(--accent-color);
}

.post-section {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-card h3 {
    margin: 0.5rem 0;
    font-size: 1.25rem;
}

.post-card a {
    text-decoration: none;
    color: var(--text-color);
}

.post-card time {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* List Pages */
.list-page {
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.posts-list {
    margin-top: 2rem;
}

.post-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.post-item:last-child {
    border-bottom: none;
}

.post-item h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.post-item h2 a {
    text-decoration: none;
    color: var(--text-color);
}

.post-item h2 a:hover {
    color: var(--accent-color);
}

.post-item time {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.post-item .summary {
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

/* Single Post */
.single {
    margin-bottom: 3rem;
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
}

.article-header time {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.tags {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Content Styles */
.content h1,
.content h2,
.content h3,
.content h4,
.content h5,
.content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.content h1 { font-size: 2rem; }
.content h2 { font-size: 1.75rem; }
.content h3 { font-size: 1.5rem; }
.content h4 { font-size: 1.25rem; }

.content p {
    margin-bottom: 1rem;
}

.content ul,
.content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content a {
    color: var(--accent-color);
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}

.content code {
    background-color: var(--code-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.875em;
}

.content pre {
    background-color: var(--code-bg);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

.content blockquote {
    border-left: 3px solid var(--accent-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
}

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

.content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

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

.content th {
    background-color: var(--code-bg);
}

/* Footer */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        gap: 1rem;
    }

    .home h1 {
        font-size: 2rem;
    }

    .article-header h1 {
        font-size: 1.75rem;
    }
}
