/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-text: #2c3e50;
    --color-text-light: #5a6c7d;
    --color-bg: #ffffff;
    --color-bg-alt: #f8f9fa;
    --color-accent: #3498db;
    --color-border: #e1e8ed;
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica', 'Arial', sans-serif;
    --max-width: 720px;
}

html {
    font-size: 18px;
    line-height: 1.6;
}

body {
    font-family: var(--font-serif);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.site-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 3rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

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

.site-title a:hover {
    color: var(--color-accent);
}

.site-nav {
    display: flex;
    gap: 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

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

.nav-link:hover {
    color: var(--color-accent);
}

/* Main content */
main {
    min-height: calc(100vh - 300px);
    padding-bottom: 4rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
}

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

a:hover {
    opacity: 0.8;
}

/* Home page */
.home-content h1 {
    margin-top: 0;
}

.home-content h2 {
    margin-top: 3rem;
}

/* Post list */
.post-list {
    margin-top: 2rem;
}

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

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

.post-title {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

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

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

.post-subtitle {
    font-family: var(--font-sans);
    color: rgba(44, 62, 80, 0.8);
    line-height: 1.4;
}

.post-header .post-subtitle {
    font-size: 1.3rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.post-preview .post-subtitle {
    font-size: 1.0rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.post-date {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
}

.post-summary {
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.post-summary img {
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
    display: block;
}

.continue-link {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.continue-link:hover {
    opacity: 0.7;
}

/* Single post */
.post {
    max-width: 100%;
}

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

.post-header .post-title {
    margin-top: 0;
}

.post-header .post-date {
    margin-bottom: 0;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    margin-top: 2.5rem;
}

.post-content blockquote {
    margin: 2rem 0;
    padding-left: 1.5rem;
    border-left: 3px solid var(--color-border);
    color: var(--color-text-light);
    font-style: italic;
}

.post-content blockquote em,
.post-content blockquote i {
    font-style: normal;
}

.post-content code {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    background-color: var(--color-bg-alt);
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.post-content pre {
    background-color: var(--color-bg-alt);
    padding: 1.5rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 2rem 0;
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    display: block;
}

.post-content hr {
    border: none;
    margin: 1.5rem 0;
    text-align: center;
}

.post-content hr::after {
    content: "***";
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 1em;
    padding-left: 1em;
    color: var(--color-text-light);
}

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.back-link {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.back-link:hover {
    color: var(--color-accent);
}

/* Footnotes */
.footnotes {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: none;
    font-size: 0.9rem;
}

.footnotes hr {
    display: none;
}

.footnotes ol {
    padding-left: 1.5rem;
}

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

/* Footer */
.site-footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    .container {
        padding: 0 1.5rem;
    }

    .site-header {
        padding: 2rem 0 1.5rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .post-content {
        font-size: 1rem;
    }
}

/* Image Captions */
.post-content figure,
.post-summary figure {
    margin: 2rem auto;
    display: block;
    text-align: center;
}

.post-content figure img,
.post-summary figure img {
    margin: 0 auto 0.5rem auto;
}

.post-content figcaption,
.post-summary figcaption {
    font-size: 0.9rem;
    color: var(--color-text-light);
    font-family: var(--font-sans);
    line-height: 1.4;
}