/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Global list style: use filled circle bullets everywhere by default */
ul {
    list-style-type: disc;
}

:root {
    --font-body: Verdana, Geneva, sans-serif;
    --font-mono: 'SF Mono', Consolas, monospace;
    --color-text: #000;
    --color-text-light: #000;
    --color-link: #0000EE;
    --color-bg: #fff;
    /* Approximate Paul Graham essay column width */
    --content-width: 500px;
    --sidebar-width: 180px;
    --gap: 60px;
}

a,
a:visited {
    color: var(--color-link);
    text-decoration: underline;
}

a:hover,
a:active {
    text-decoration: underline;
}

html {
    font-size: 13px;
    line-height: 1.4;
}

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

/* Layout - Desktop: nav on left, title+content on right */
.container {
    /* Use CSS grid on larger screens so the nav starts at the very top
       of the container while the title sits above the content column. */
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, var(--content-width));
    grid-template-rows: auto 1fr;
    column-gap: var(--gap);
    max-width: calc(var(--content-width) + var(--sidebar-width) + var(--gap));
    margin: 0;
    padding: 2rem 2rem 4rem 3rem;
    align-items: stretch;
}

/* Sidebar navigation - on desktop: left side, spanning full height */
.nav {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: var(--sidebar-width);
    /* Subtle boxed nav inspired by HN colors */
    padding: 0.5rem 0.75rem 0.75rem; /* small top padding so links start near top */
    background: #fffaf0;
    border: 1px solid #f2e2c0;
    border-radius: 4px;
    align-self: stretch;
}


/* Site title: top of the content column */
.site-title {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
}

/* Main content area - on desktop: below the title, right side */
.content {
    grid-column: 2;
    grid-row: 2;
    max-width: var(--content-width);
}

.site-title {
    font-family: var(--font-body);
    font-size: 2.5rem;
    font-weight: normal;
    text-decoration: none;
    color: #551A8B;
    display: block;
    margin-bottom: 0.75rem; /* tighter so nav row height is closer to its own content */
}

.site-title:visited {
    color: #551A8B;
}

.site-title-home {
    /* Home page: echo navbar colors without losing logo feel */
    background: #fffaf0;
    border-bottom: 3px solid #ff6600;
    padding: 0.15rem 0.4rem 0.25rem;
    border-radius: 3px;
    text-decoration: none;
}

.site-title:hover {
    background: #fff0d5;
    text-decoration: none;
}

/* Sidebar navigation links */
.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    margin: 0.25rem 0;
}

/* Name item at top of nav */
.nav-name {
}

.nav-links a {
    display: block;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    text-decoration: none;
    color: #333;
}

/* Explicit styling for name in navbar (override generic nav link styles) */
.nav-links .nav-name a {
    font-size: 13px;
    color: #000000;
}

/* Selected state for nav links (overrides generic nav link styles) */
.nav-links a.nav-current {
    background: #ff6600;
    color: #000;
}

.nav-links a.nav-current:hover {
    background: #ff6600;
    text-decoration: none;
}

.nav-links a:hover {
    background: #fff0d5;
    text-decoration: underline;
}



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

.post-header h1 {
    font-size: 1.4rem;
    font-weight: normal;
    line-height: 1.3;
    margin-bottom: 0.6rem;
    color: #4A0404;
    font-family: var(--font-body);
}

.post-date {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.post-content h2 {
    font-size: 1.1rem;
    font-weight: normal;
    margin: 2rem 0 0.75rem; /* extra top space, like a new chapter */
    color: #111; /* slightly darker than body */
    font-family: var(--font-body);
}

.post-content h3 {
    font-size: 1.05rem;
    font-weight: normal;
    margin: 1rem 0 0.5rem;
    color: #000;
    font-family: var(--font-body);
}

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

.post-content a {
}

.post-content ul, .post-content ol {
    margin: 0.75rem 0 0.75rem 1.5rem;
}

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

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

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: #fff4e6; /* subtle light-orange tint, keeps black text crisp */
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
}

.post-content pre {
    background: #fff4e6; /* subtle light-orange tint for code blocks */
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 3px;
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
}

/* Homepage hero image */
.homepage-hero {
    margin-bottom: 1rem;
}

.homepage-hero img {
    max-width: 100%;
    height: auto;
    display: block;
}

.homepage-hero-caption {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #444;
    font-style: italic;
}

/* Listing pages */
.listing h1 {
    font-size: 1.2rem;
    font-weight: normal;
    margin-bottom: 1rem;
    color: #4A0404;
    font-family: var(--font-body);
}


.post-list {
    list-style: none;
}

.post-item {
    margin-bottom: 1.25rem;
}

.writings-list {
    list-style-type: disc;
    padding-left: 1.25rem;
}

.about-title {
    font-size: 1.2rem;
    font-weight: normal;
    margin-bottom: 1rem;
    color: #4A0404;
    font-family: var(--font-body);
}

.about-info {
    margin: 1rem 0 0 1.25rem;
}

.about-info li {
    margin-bottom: 0.35rem;
}

.about-info strong {
    color: #4A0404;
}


.writings-list li {
    margin-bottom: 0.4rem;
}

/* Gray hover only for top-level links in writings list */
.writings-list > li > a:hover,
.writings-list > li > a:active {
    background-color: #eeeeee;
}

.post-item a {
}

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

.post-item .post-date {
    margin-left: 0.5rem;
    font-size: 0.85rem;
}

.post-description {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Homepage Franklin-style lines */
.homepage-latest-label {
    font-size: 0.75rem;
    color: #4A0404;
    margin-bottom: 0.25rem;
    font-weight: bold;
    font-family: var(--font-body);
}

.franklin-line {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.franklin-line strong {
    color: var(--color-text);
}

.franklin-line a {
}


/* Footer */
.footer {
    margin-top: 4rem;
    padding-top: 1rem;
    border-top: 1px solid #eeeeee;
    color: #444;
    font-size: 10px;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .container {
        display: flex;
        flex-direction: column;
        margin-top: 1.25rem;
        padding: 0.25rem 0.75rem 0.75rem;
    }
    
    .site-title {
        order: 1;
        text-align: center;
        font-size: 2.1rem;
        margin-bottom: 0.25rem;
    }
    
    .nav {
        order: 2;
        width: 100%;
        margin: 0 0 0.5rem;
        padding: 0.3rem 0.35rem 0.25rem;
    }
    
    .nav-links {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .nav-links li {
        margin: 0;
    }
    
    .content {
        order: 3;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 16px;
    }
}
