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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Courier New', Courier, monospace;
    line-height: 1.6;
    color: #000;
    background: #F5F5EA;
    padding: 2rem 1rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

/* Side Navigation */
.side-nav {
    position: sticky;
    top: 2rem;
    width: 120px;
    flex-shrink: 0;
}

.side-nav ul {
    list-style: none;
    border-left: 2px solid #ddd;
}

.side-nav li {
    margin-bottom: 0.5rem;
}

.side-nav a {
    display: block;
    padding: 0.5rem 0 0.5rem 1rem;
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 2px solid transparent;
    margin-left: -2px;
}

.side-nav a:hover {
    color: #000;
    border-left-color: #8B8B7A;
    background: rgba(139, 139, 122, 0.05);
}

.side-nav a.active {
    color: #000;
    font-weight: bold;
    border-left-color: #5A7A5A;
}

/* Main Content Area */
.main-content {
    flex: 1;
    max-width: 900px;
    min-width: 0;
    text-align: center;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 2rem;
    }

    .side-nav {
        position: static;
        width: 100%;
        border-bottom: 1px solid #ddd;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .side-nav ul {
        border-left: none;
        border-top: 2px solid #ddd;
        padding-top: 1rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .side-nav a {
        border-left: none;
        border-top: 2px solid transparent;
        padding: 0.5rem 1rem;
        margin-left: 0;
        margin-top: -2px;
    }

    .side-nav a:hover {
        border-left-color: transparent;
        border-top-color: #8B8B7A;
    }

    .side-nav a.active {
        border-left-color: transparent;
        border-top-color: #5A7A5A;
    }
}

/* Header with ASCII Art */
.writings-header {
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #ddd;
}


.ascii-art {
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.2;
    color: #666;
    margin-bottom: 2rem;
    overflow-x: auto;
}


h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
}


.byline {
    font-size: 0.9rem;
    color: #888;
}

.byline a {
    color: inherit;
    text-decoration: none;
}

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

/* Main Content */
main {
    text-align: left;
}

/* Section Dividers */
.section-divider {
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #333;
}


.section-divider h2 {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Paper Container */
.paper-container {
    margin-bottom: 4rem;
    padding-bottom: 3rem;
    border-bottom: 2px solid #ddd;
}


.writing-item {
    margin-bottom: 1.5rem;
}

.writing-item.featured {
    padding-bottom: 1.5rem;
}

.writing-item h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.writing-item h3 a {
    color: #333;
    text-decoration: none;
}


.writing-item h3 a:hover {
    text-decoration: underline;
}

.entry-links {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.entry-links a {
    color: #0066cc;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.entry-links a:hover {
    border-bottom-color: #0066cc;
}


/* Paper Subseries */
.paper-subseries {
    margin-top: 2rem;
    padding-left: 1.5rem;
    border-left: 2px solid #ddd;
}


.subseries-header {
    margin-bottom: 1rem;
}

.subseries-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}


/* Collapsible Sections */
.collapsible-section {
    margin-bottom: 1rem;
}

.collapse-toggle {
    width: 100%;
    background: none;
    border: none;
    padding: 0.75rem 0;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
}

.collapse-toggle:hover {
    opacity: 0.7;
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
    display: inline-block;
}

.collapse-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(90deg);
}

.section-title {
    font-weight: 600;
}

.post-count {
    color: #888;
    font-size: 0.9rem;
    margin-left: auto;
}


.collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapse-content.expanded {
    max-height: 2000px;
    transition: max-height 0.5s ease-in;
}

.post-list {
    list-style: none;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.post-list li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.post-list a {
    color: #0066cc;
    text-decoration: none;
}

.post-list a:hover {
    text-decoration: underline;
}


.post-list .desc {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.2rem;
    margin-left: 0;
}


.meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.theme-icons {
    font-family: monospace;
    font-size: 0.75rem;
    color: #b2abde;
    letter-spacing: 0.05em;
    padding: 0.15rem 0.4rem;
    background: rgba(178, 171, 222, 0.1);
    border-radius: 3px;
}

.status {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #f0f0f0;
    color: #666;
    border-radius: 3px;
    text-transform: lowercase;
    font-size: 0.8rem;
}

.date {
    color: #888;
}


.abstract {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
}


/* Footer */
footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
}


footer a {
    color: #666;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Links */
a {
    color: #0066cc;
    transition: color 0.2s ease;
}

a:hover {
    color: #004080;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.75rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .ascii-art {
        font-size: 0.7rem;
    }

    .writing-item h2 {
        font-size: 1.15rem;
    }
}
