/* Blog-specific styles */

@import url('globals.css');

body {
    background: var(--bg-primary);
    padding-top: 60px;
    transition: background-color 0.3s ease;
    position: relative;
}

.content {
    padding: 32px 32px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Blog Index Page */
.blog-container {
    max-width: 900px;
    margin: 0 auto;
}

.rss-link {
    float: right;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

.rss-link.animated-underline-link:hover {
    color: var(--accent);
}

.blog-title {
    color: var(--text-primary);
    font-size: 4rem;
    font-weight: 300;
    margin: 0 0 48px 0;
    font-family: Georgia, serif;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-align: center;
}

.blog-post-preview {
    display: block;
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 40px;
    position: relative;
    margin-bottom: 32px;
    text-decoration: none;
}

.blog-post-preview:hover {
    border-color: var(--border-hover);
    box-shadow: 0 12px 40px var(--shadow);
    transform: translateY(-2px);
}

.blog-post-preview h3 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-family: Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0 0 12px 0;
}

.blog-post-preview p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

.blog-post-preview .post-date {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0 0 12px 0;
    padding: 0;
    border: none;
    text-align: left;
}

/* Blog Post Page */
h1.post-title {
    color: var(--text-primary);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 300;
    margin: 0 0 16px 0;
    font-family: Georgia, serif;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-align: center;
}

.post-date {
    color: var(--text-tertiary);
    font-size: 0.95rem;
    font-style: italic;
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

article {
    max-width: 900px;
    margin: 0 auto;
    padding: 50px 48px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 20px var(--shadow);
}

article h2 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 400;
    font-family: Georgia, serif;
    letter-spacing: -0.02em;
    margin-top: 48px;
    margin-bottom: 20px;
}

article h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 400;
    font-family: Georgia, serif;
    letter-spacing: -0.02em;
    margin-top: 36px;
    margin-bottom: 16px;
}

article h4, article h5, article h6 {
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 32px;
    margin-bottom: 12px;
}

article p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.8;
    margin: 24px 0;
}

article a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

article a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

article strong {
    color: var(--text-primary);
    font-weight: 600;
}

article em {
    color: var(--text-secondary);
    font-style: italic;
}

article ul, article ol {
    color: var(--text-secondary);
    margin: 24px 0;
    padding-left: 32px;
}

article li {
    margin: 12px 0;
    line-height: 1.8;
}

article sup {
    font-size: 0.75em;
    vertical-align: super;
}

article sup a {
    text-decoration: none;
}

/* Figures and Images */
figure {
    margin: 40px -20px;
    text-align: center;
}

figure img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

article img {
    display: block;
    margin: 32px auto;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

img.spatial,
picture.spatial img {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

img.spatial:hover,
picture.spatial img:hover {
    transform: scale(1.02);
    opacity: 0.95;
}

figcaption {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 12px;
    line-height: 1.6;
}

/* Code blocks */
pre {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    padding: 24px;
    margin: 32px -20px;
    overflow-x: auto;
}

code {
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.9em;
}

/* Footnotes */
article ol#footnotes {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Mobile adjustments */
@media (max-width: 900px) {
    .blog-title {
        font-size: 3rem;
    }

    .blog-post-preview {
        padding: 32px;
    }

    article {
        padding: 40px 36px;
    }

    figure, pre {
        margin-left: -12px;
        margin-right: -12px;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 28px 20px;
    }

    .blog-title {
        font-size: 2.5rem;
    }

    .blog-post-preview {
        padding: 28px;
    }

    .blog-post-preview h3 {
        font-size: 1.5rem;
    }

    article {
        padding: 36px 28px;
        border-radius: 12px;
    }

    article h2 {
        font-size: 1.6rem;
        margin-top: 36px;
    }

    article h3 {
        font-size: 1.3rem;
    }

    article p {
        font-size: 1rem;
    }

    figure, pre {
        margin-left: -16px;
        margin-right: -16px;
    }

    .post-date {
        margin-bottom: 32px;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 24px 16px;
    }

    .blog-title {
        font-size: 2rem;
    }

    .back-home, .back-link, .rss-link {
        font-size: 0.9rem;
    }

    .blog-post-preview {
        padding: 24px;
        border-radius: 12px;
    }

    .blog-post-preview h3 {
        font-size: 1.3rem;
    }

    .blog-post-preview p {
        font-size: 0.95rem;
    }

    article {
        padding: 28px 20px;
    }

    article h2 {
        font-size: 1.4rem;
    }

    article h3 {
        font-size: 1.2rem;
    }

    article p {
        font-size: 0.95rem;
    }

    figure, pre {
        margin-left: -20px;
        margin-right: -20px;
        border-radius: 8px;
    }

    pre {
        padding: 16px;
    }
}
