/*
 * blog-post.css — shared styles for individual blog post pages.
 * Linked AFTER ../styles.css so these post-page rules (e.g. .tag, .blog-post-meta)
 * override the index-card versions defined in styles.css, exactly as the former
 * inline <style> blocks did. Only linked on post pages, so the index is unaffected.
 * Theme-aware: colors use the CSS variables from styles.css (light + dark).
 */

.blog-post-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0 3rem;
    margin-bottom: 2rem;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.blog-post-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    line-height: 1.7;
}

.blog-post-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.blog-post-content h2 {
    color: var(--primary-color);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.blog-post-content h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
}

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

.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
}

.blog-post-content th,
.blog-post-content td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.blog-post-content th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 500;
}

.blog-post-content tr:hover {
    background-color: var(--background-light);
}

.blog-post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #666;
}

.blog-post-content code {
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.blog-post-content pre {
    background-color: #f8f8f8;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
}

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

.blog-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 3rem 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-to-blog:hover {
    color: var(--primary-hover);
}

.tag-list {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.references {
    padding-left: 0;
    counter-reset: ref-counter;
}

.references li {
    list-style: none;
    margin-bottom: 1rem;
    padding-left: 2rem;
    position: relative;
    line-height: 1.5;
    text-align: justify;
}

.references li::before {
    content: "[" counter(ref-counter) "]";
    counter-increment: ref-counter;
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 600;
    color: var(--primary-color);
}

.references li a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-color);
    word-break: break-all;
}

.references li a:hover {
    border-bottom: 1px solid var(--primary-color);
}

/* Citation links in text */
.blog-post-content a[href^="#ref"] {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}

.blog-post-content a[href^="#ref"]:hover {
    background-color: var(--primary-color);
    color: white;
}

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

/* Highlight effect when jumping to reference */
.references li:target {
    background-color: rgba(0, 120, 212, 0.1);
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

@media (max-width: 768px) {
    .blog-post-header {
        padding: 3rem 0 2rem;
    }

    .blog-post-content {
        padding: 0 1rem;
    }

    .blog-post-content h1 {
        font-size: 2rem;
    }

    .blog-navigation {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}
