/* Blog Post Styles - Unified CSS with length variants */

/* CSS Custom Properties */
:root {
    --post-max-width: 650px;
    --post-line-height: 1.7;
    --post-font-size: 17px;
    --color-text: #000;
    --color-text-muted: #666;
    --color-link: #00e;
    --color-border: #ccc;
    --color-border-light: #eee;
    --color-bg: #fff;
    --color-bg-accent: #f9f9f9;
}

/* Base body styles */
body {
    font-family: 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #fff;
    color: #000;
}

/* Site Header - matches main pages */
.site-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #000;
}

.site-header h1 {
    font-size: 2.5em;
    margin-bottom: 0.5em;
    font-weight: 300;
}

.site-header nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.site-header nav ul li {
    display: inline;
    margin: 0 10px;
}

.site-header a {
    text-decoration: none;
    color: #000;
    transition: color 0.3s ease;
}

.site-header a:hover {
    color: #0000ff;
}

/* Container for post content */
.container {
    width: 80%;
    max-width: 800px;
    margin: auto;
    padding: 20px;
}

/* Base Post Styles */
.post {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: var(--post-font-size);
    line-height: var(--post-line-height);
    color: var(--color-text);
    background: var(--color-bg);
    max-width: var(--post-max-width);
    margin: 0 auto;
    padding: 20px 0;
}

/* Length Variants */
.post[data-length="long"] {
    --post-max-width: 680px;
    --post-line-height: 1.75;
}

.post[data-length="short"] {
    --post-max-width: 600px;
    --post-line-height: 1.6;
    --post-font-size: 16px;
}

/* Post Header */
.post-header {
    margin-bottom: 2.5em;
}

.post-title {
    font-size: 2em;
    font-weight: 600;
    margin: 0 0 0.5em;
    line-height: 1.2;
}

.post[data-length="short"] .post-title {
    font-size: 1.6em;
}

.post-meta {
    color: var(--color-text-muted);
    font-size: 0.9em;
}

.post-meta span {
    margin-right: 1em;
}

.post-meta .reading-time::before {
    content: "\00B7";
    margin-right: 1em;
}

/* Epigraph - Long form only */
.epigraph {
    margin: 2em 0 3em;
    padding: 1.5em 2em;
    border-left: 3px solid var(--color-border);
    background: var(--color-bg-accent);
    font-style: italic;
}

.epigraph p {
    margin: 0;
}

.epigraph cite {
    display: block;
    margin-top: 1em;
    font-style: normal;
    font-size: 0.9em;
    color: var(--color-text-muted);
}

.epigraph cite::before {
    content: "\2014 ";
}

/* Table of Contents - Long form only */
.toc {
    margin: 2em 0;
    padding: 1.5em;
    background: var(--color-bg-accent);
    border-radius: 4px;
}

.toc-title {
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin: 0 0 1em;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 0.5em 0;
}

.toc-list a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95em;
}

.toc-list a:hover {
    color: var(--color-link);
}

/* Mobile TOC Toggle */
.toc-toggle {
    display: none;
    width: 100%;
    padding: 0.75em;
    background: var(--color-bg-accent);
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    font-size: 0.9em;
    cursor: pointer;
    text-align: left;
}

.toc-toggle::after {
    content: "+";
    float: right;
}

.toc-toggle.active::after {
    content: "-";
}

/* Post Content */
.post-content h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 2em 0 0.75em;
}

.post-content h3 {
    font-size: 1.2em;
    font-weight: 600;
    margin: 1.5em 0 0.5em;
}

.post-content p {
    margin: 1em 0;
}

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

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

.post-content ul,
.post-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.post-content li {
    margin: 0.5em 0;
}

.post-content strong {
    font-weight: 600;
}

/* Pull Quote */
.pullquote {
    margin: 2em 0;
    padding: 1em 1.5em;
    border-left: 4px solid var(--color-text);
    font-size: 1.15em;
    font-weight: 500;
    line-height: 1.5;
}

/* Callout Box */
.callout {
    margin: 1.5em 0;
    padding: 1.25em 1.5em;
    background: var(--color-bg-accent);
    border-radius: 4px;
    border: 1px solid var(--color-border-light);
}

.callout p:first-child {
    margin-top: 0;
}

.callout p:last-child {
    margin-bottom: 0;
}

/* Section Break */
.section-break {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2.5em 0;
}

/* Post Images */
.post-image {
    margin: 2em 0;
    padding: 0;
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    background: var(--color-bg-accent);
    /* Placeholder styling - shows a light gray box when image is missing */
    min-height: 200px;
    object-fit: cover;
}

.post-image figcaption {
    margin-top: 0.75em;
    font-size: 0.85em;
    color: var(--color-text-muted);
    text-align: center;
    font-style: italic;
}

/* Post Footer */
.post-footer {
    margin-top: 3em;
    padding-top: 2em;
    border-top: 1px solid var(--color-border);
}

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

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

/* Related Posts */
.related-posts {
    margin-top: 2em;
}

.related-posts-title {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 1em;
}

.related-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-posts-list li {
    margin: 0.75em 0;
}

.related-posts-list a {
    color: var(--color-text);
    text-decoration: none;
}

.related-posts-list a:hover {
    color: var(--color-link);
}

/* Responsive */
@media (max-width: 768px) {
    .post {
        padding: 30px 16px;
    }

    .post-title {
        font-size: 1.75em;
    }

    .post[data-length="short"] .post-title {
        font-size: 1.4em;
    }

    .toc {
        padding: 0;
        background: none;
    }

    .toc-toggle {
        display: block;
    }

    .toc-list {
        display: none;
        padding: 1em;
        background: var(--color-bg-accent);
        margin-top: 0.5em;
        border-radius: 4px;
    }

    .toc-list.active {
        display: block;
    }

    .toc-title {
        display: none;
    }

    .epigraph {
        padding: 1em 1.25em;
        margin: 1.5em 0 2em;
    }

    .pullquote {
        font-size: 1.1em;
        padding: 0.75em 1em;
    }
}

@media (max-width: 600px) {
    .container {
        width: 90%;
        padding: 15px;
    }

    .site-header h1 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .post {
        padding: 20px 0;
    }

    .post-title {
        font-size: 1.5em;
    }

    .post[data-length="short"] .post-title {
        font-size: 1.3em;
    }

    .post-meta span {
        display: block;
        margin-bottom: 0.25em;
    }

    .post-meta .reading-time::before {
        display: none;
    }
}
