/* Typography */
:root {
    --text-color: #111;
    --background-color: #fffff8;
    --accent-color: #111;
    --link-color: #111;
    --side-note-color: #666;
    --side-note-background: #f3f3f3;
}

/* Base styles */
html {
    font-size: 15px;
}

body {
    font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    counter-reset: sidenote-counter;
}

/* Base container */
.container {
    max-width: 35rem;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Layout */
header, main, footer {
    max-width: 100%;  /* Changed from fixed width to use container width */
    margin: 0;        /* Remove margin since container handles centering */
    padding: 0;       /* Remove padding since container handles spacing */
}

/* Navigation */
nav {
    width: 100%;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Site title and main nav links */
nav .home,
.nav-links a {
    font-weight: bold;
    letter-spacing: 0.03em;
}

.nav-links a {
    margin-left: 2rem;
    font-size: 1.1rem;
}

/* Typography */
h1, h2, h3 {
    font-weight: normal;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.7rem; }

p { margin-bottom: 1.4rem; }

/* Links */
a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

a:hover {
    border-bottom-color: var(--link-color);
}

/* Paragraph links should always be underlined */
p a {
    border-bottom: 1px solid var(--link-color);
}

p a:hover {
    opacity: 0.7;
}

/* Sidenotes */
.sidenote {
    float: right;
    clear: right;
    margin-right: -13rem; /* Aligned with main padding-right */
    width: 12rem;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    line-height: 1.3;
    vertical-align: baseline;
    position: relative;
    color: var(--side-note-color);
}

.sidenote-number {
    counter-increment: sidenote-counter;
}

.sidenote-number:after {
    content: counter(sidenote-counter);
    vertical-align: super;
    font-size: 0.7rem;
}

/* Article styles */
article {
    margin-bottom: 4rem;
}

.article-meta {
    color: var(--side-note-color);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Figure styles */
figure {
    margin: 2rem 0;
    text-align: center;
}

figure img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--side-note-color);
    font-style: italic;
}

/* Code blocks */
pre, code {
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    background: var(--side-note-background);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

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

.post-list h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 1000px) {
    .container {
        padding: 0 1.5rem;
    }
    
    main {
        padding-right: 0;
    }

    header, footer {
        padding: 0 2rem;
    }

    .sidenote {
        float: none;
        display: block;
        margin: 1rem 0;
        padding: 1rem;
        width: auto;
        background: var(--side-note-background);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 0 1rem;
    }

    header, main, footer {
        padding: 0 1.5rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.2rem; }

    nav {
        flex-direction: column;
        text-align: center;
    }

    .nav-links {
        margin-top: 1rem;
    }

    .nav-links a {
        margin: 0 1rem;
    }
}

/* Post and Page styles */
.post-list {
    list-style: none;
    padding: 0;
}

.post-list li {
    margin-bottom: 2rem;
}

.post-meta {
    color: var(--side-note-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.post-header, .page-header {
    margin-bottom: 2rem;
}

.post-content, .page-content {
    margin-bottom: 4rem;
}

/* Essay list styling */
.essay-list {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.essay-item {
    margin-bottom: 2rem;
}

.essay-title {
    margin: 0 0 0.5rem 0;
    font-weight: normal;
    color: var(--text-color);
    opacity: 0.8;
}

.essay-description {
    color: var(--side-note-color);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0.5rem 0;
    opacity: 0.9;
}

.essay-date {
    color: var(--side-note-color);
    font-size: 0.9rem;
}

.essay-title a {
    border-bottom: none;
}

.essay-title a:hover {
    border-bottom: 1px solid var(--link-color);
}

/* Exception for nav links and essay titles */
.nav-links a,
.essay-title a {
    border-bottom: none;
}

.nav-links a:hover,
.essay-title a:hover {
    border-bottom: 1px solid var(--link-color);
    opacity: 1;
}

/* Error page */
.error-page {
    text-align: center;
    margin: 4rem 0;
}

.error-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.error-page h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.error-page ul {
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.error-page li {
    margin: 1rem 0;
}

/* Post styles */
.post {
    margin-bottom: 4rem;
}

.post h1 {
    margin-bottom: 0.5rem;
}

.post-date {
    display: block;
    color: var(--side-note-color);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.post-content {
    margin-top: 2rem;
}

/* Ensure proper spacing for lists in content */
.post-content ul,
.post-content ol {
    margin: 1.4rem 0;
    padding-left: 1.5rem;
}

/* Ensure proper spacing for paragraphs */
.post-content p {
    margin: 1.4rem 0;
}

/* Post styles */
.post-header {
    margin-bottom: 3rem;
}

.post-date {
    display: block;
    color: var(--side-note-color);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.post-content {
    margin-bottom: 4rem;
}

/* Ensure proper spacing for lists in content */
.post-content ul,
.post-content ol {
    margin-bottom: 1.4rem;
    padding-left: 1.5rem;
}

/* Home page specific styles */
.random-essays {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--text-color);
}

.random-essays h2 {
    margin-bottom: 2rem;
    font-size: 1.5rem;
    color: var(--side-note-color);
    font-weight: bold;
    letter-spacing: 0.03em;
}

.random-essays .essay-list {
    margin-top: 0;
} 