* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #fef8f0;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px solid #0066cc;
    transition: color 0.2s ease;
}

a:hover {
    color: #0052a3;
    border-bottom-color: #0052a3;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #222;
    font-weight: 600;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 1.2rem;
    color: #222;
    font-weight: 600;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
}

.post-date {
    color: #999;
    font-size: 0.9rem;
}

/* Home page: two-column layout */
body.home {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 40px;
    gap: 100px;
}

.main-content {
    max-width: 750px;
    flex-shrink: 0;
    padding-top: 40px;
}

.main-content p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 1rem;
}

.posts-sidebar {
    max-width: 250px;
    flex-shrink: 0;
    padding-top: 40px;
}

.posts-sidebar .posts-list {
    list-style: none;
}

.posts-sidebar .posts-list li {
    margin-bottom: 1.5rem;
}

.posts-sidebar .post-item a {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    border: none;
    border-bottom: 1px solid #0066cc;
}

.posts-sidebar .post-date {
    font-size: 0.85rem;
}

@media (max-width: 1024px) {
    body.home {
        flex-direction: column;
        gap: 40px;
    }

    .main-content,
    .posts-sidebar {
        max-width: 100%;
    }
}

/* Writing index and post pages: single-column */
body.page {
    display: flex;
    justify-content: flex-start;
    padding: 40px 60px;
}

body.page > * {
    max-width: 720px;
    width: 100%;
}

/* Writing index */
.writing-index .posts-list {
    list-style: none;
}

.writing-index .posts-list li {
    margin-bottom: 1.5rem;
}

.writing-index .post-item a {
    font-size: 1.1rem;
}

.writing-index .post-date {
    margin-top: 0.3rem;
}

/* Individual post */
article h1 {
    margin-bottom: 0.5rem;
}

article .post-date {
    margin-bottom: 2rem;
}

.post-content {
    font-size: 1.1rem;
    color: #555;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #222;
}

.post-content code {
    background-color: #f0ebe3;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-content pre {
    background-color: #f0ebe3;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

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

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

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