/*
 * Custom CSS for Steve Hanov's Blog — Spore theme override
 * Modern, clean 2026 aesthetic inspired by Substack
 */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:ital,wght@0,400;0,600;1,400;1,600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Root variables ── */
:root {
    --color-bg: #fafafa;
    --color-surface: #ffffff;
    --color-text: #1a1a1a;
    --color-text-secondary: #6b7280;
    --color-accent: #e67e22;
    --color-accent-hover: #d35400;
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
    --color-code-bg: #f8f9fa;
    --color-tag-bg: #f0f0f0;
    --color-tag-text: #555;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --max-width: 680px;
    --max-width-wide: 1080px;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
    --transition: 0.2s ease;
}

/* ── Base reset ── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.7;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

pre {
  font-size: 0.8rem;
  padding: 10px;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 10px;
  overflow-x: scroll;

}

/* ── Layout: override spore defaults ── */

/* Site header / navbar */
.blog-header,
header.blog-header {
    background: var(--color-surface) !important;
    border-bottom: 1px solid var(--color-border) !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.blog-header .container,
.blog-header > div {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blog-header .blog-title,
.blog-header h1,
.blog-header a.blog-title {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text) !important;
    text-decoration: none !important;
    letter-spacing: -0.02em;
}

.blog-header .blog-title:hover {
    color: var(--color-accent) !important;
}

.blog-header nav a,
.blog-header .nav-links a {
    font-size: 0.9rem;
    color: var(--color-text-secondary) !important;
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color var(--transition);
}

.blog-header nav a:hover {
    color: var(--color-accent) !important;
}

/* ── Post list page ── */
.post-list,
.posts-container,
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Blog description / subtitle */
.blog-description {
    font-family: var(--font-serif);
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ── Post cards in listing ── */
.post-item,
.post-card,
article.post-summary {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
    position: relative;
}

.post-item:hover,
.post-card:hover,
article.post-summary:hover {
    box-shadow: var(--shadow-md);
    transform: scale(1.02) rotate(1deg);
}

.post-item a,
.post-card a,
article.post-summary a {
    text-decoration: none;
    color: inherit;
}

.post-item h2,
.post-card h2,
article.post-summary h2 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.35;
    margin: 0 0 0.5rem 0;
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.post-item h2 a,
.post-card h2 a {
    color: var(--color-text) !important;
    text-decoration: none !important;
}

.post-item h2 a:hover,
.post-card h2 a:hover {
    color: var(--color-accent) !important;
}

.post-item .post-date,
.post-card .post-date,
.post-meta,
time {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.post-item .post-excerpt,
.post-card .post-excerpt,
.post-description {
    font-family: var(--font-serif);
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.65;
    margin-top: 0.75rem;
}

/* ── Tags ── */
.tag-pill,
.post-tags a,
.tags a {
    display: inline-block;
    background: var(--color-tag-bg);
    color: var(--color-tag-text) !important;
    padding: 0.2em 0.7em;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none !important;
    margin-right: 0.4rem;
    margin-top: 0.5rem;
    transition: background var(--transition), color var(--transition);
}

.tag-pill:hover,
.post-tags a:hover,
.tags a:hover {
    background: var(--color-accent);
    color: #fff !important;
}

/* ── Single post view ── */
article.post,
.post-content,
.post-detail {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

article.post h1,
.post-detail h1,
.post-content h1 {
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 2.4rem;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    margin-top: 0;
    color: var(--color-text);
}

/* Post body typography */
.post-body,
.post-content .content,
article.post .content,
article.article-content {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-text);
}

.post-body h2,
.post-content h2 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.post-body h3,
.post-content h3 {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.post-body p,
.post-content p {
    margin-bottom: 1.5em;
}

.post-body a,
.post-content a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    transition: color var(--transition);
}

.post-body a:hover,
.post-content a:hover {
    color: var(--color-accent-hover);
}

.post-body img,
.post-content img,
article.post .content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.post-body blockquote,
.post-content blockquote {
    border-left: 3px solid var(--color-accent);
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: var(--color-border-light);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

.post-body blockquote p:last-child {
    margin-bottom: 0;
}

/* Code blocks */
.post-body pre,
.post-content pre {
    background: #1e1e1e !important;
    color: #d4d4d4;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 1.5rem 0;
}

.post-body code,
.post-content code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: rgba(30, 30, 30, 0.1); 
    color: #d4d4d4;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--color-border);
}

.post-body pre code,
.post-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
    font-size: 1em;
}

/* Lists */
.post-body ul,
.post-body ol,
.post-content ul,
.post-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5em;
}

.post-body li,
.post-content li {
    margin-bottom: 0.5em;
}

/* Tables */
.post-body table,
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.post-body th,
.post-body td,
.post-content th,
.post-content td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.post-body th,
.post-content th {
    background: var(--color-border-light);
    font-weight: 600;
}

/* Horizontal rule */
.post-body hr,
.post-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2.5rem 0;
}

/* ── Related posts ── */
.related-posts,
.related-posts-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--color-border);
}

.related-posts h2,
.related-posts-section h2 {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.related-posts a {
    display: block;
    padding: 0.6rem 0;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

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

/* ── Comments section ── */
.comments-section,
.comments {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--color-border);
}

.comments-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
}

.comment {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.comment .comment-author {
    font-weight: 600;
    color: var(--color-text);
}

.comment .comment-date {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.comment .comment-content {
    margin-top: 0.5rem;
    line-height: 1.65;
}

.comment .comment-reply {
    margin-left: 2rem;
    border-left: 2px solid var(--color-border);
    padding-left: 1rem;
}

/* Comment form */
.comment-form textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    transition: border-color var(--transition);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.comment-form input[type="text"],
.comment-form input[type="email"] {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: border-color var(--transition);
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.1);
}

.comment-form button,
.comment-form input[type="submit"] {
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

.comment-form button:hover,
.comment-form input[type="submit"]:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

/* ── Pagination ── */
.pagination,
.pager {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.pagination a,
.pager a {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition);
}

.pagination a:hover,
.pager a:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ── Footer ── */
.blog-footer,
footer {
    max-width: var(--max-width-wide);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.blog-footer a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.blog-footer a:hover {
    color: var(--color-accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    :root {
        --max-width: 100%;
    }

    .blog-header .container,
    .blog-header > div {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    article.post h1,
    .post-detail h1,
    .post-content h1 {
        font-size: 1.75rem;
    }

    .post-item,
    .post-card,
    article.post-summary {
        padding: 1.25rem;
    }

    .post-body,
    .post-content .content {
        font-size: 1.05rem;
    }
}

/* ── Smooth scroll ── */
html {
    scroll-behavior: smooth;
}

/* ── Selection color ── */
::selection {
    background: rgba(230, 126, 34, 0.2);
    color: var(--color-text);
}

/* ── Focus styles ── */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ── Loading transition for content ── */
.post-item,
article.post {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Override for Old Blog Look (Full Width Masonry) ── */

/* Full width container for list page */
.container-fluid {
    max-width: 1400px; /* Or whatever "full width" implies, usually padded */
    margin: 0 auto;
    padding: 0 20px;
}

/* Base modifications */
body {
    background-color: #cccccc; /* Light gray from screenshot approximation */
}

/* Header customization */
.site-header {
    background-color: transparent; /* Assuming gray carries through or header was gray */
    border-bottom: none;
    padding-bottom: 20px;
    text-align: center;
}

.site-header .header-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

/* Links in tagline */
.site-tagline a {
    color: #0000AA; /* Classic blue link color */
    text-decoration: underline;
}

/* Masonry Grid - Javascript Managed */
.masonry-grid {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.masonry-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

/* Post Cards */
.post-card {
    background: #ffffff;
    padding: 24px;
    margin-bottom: 20px;
    break-inside: avoid; /* Prevent split across columns */
    border-radius: 0; /* Boxy look from screenshot */
    box-shadow: none; /* Flat look or subtle? Screenshot looks flat-ish */
}

.card-title {
    margin-top: 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.card-title a {
    color: #000000;
    text-decoration: none;
    font-weight: bold;
}

.card-title a:hover {
    text-decoration: underline;
}

.card-excerpt {
    color: #1a1a1a;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.card-image-link {
    display: block;
    margin: -24px -24px 20px -24px;
}

.card-image-link img {
    width: 100%;
    height: auto;
    display: block;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}


.site-tagline {
    font-family: var(--font-serif);
    color: #000000; /* Darker black as per screenshot */
}
