/* Blog Post Specific Styles - Add to main.css or create separate blog.css */

/* Main Navigation */
.main-nav {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #0066cc;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #0066cc;
}

/* Blog Post Layout */
.blog-post {
    background: #ffffff;
}

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

.post-header .container {
    max-width: 800px;
    margin: 0 auto;
}

/* Article Header - Sticky positioning */
.article-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(100, 200, 255, 0.2);
    position: sticky;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 100%);
    z-index: 999;
}

/* Article Container - Remove top padding */
.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem 3rem 2rem;
}

/* Article Title - Remove top margin */
.article-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
    background: linear-gradient(135deg, #64c8ff 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.back-link {
    display: inline-block;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: white;
}

.post-header h1 {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

.post-subtitle {
    font-size: 1.25rem;
    margin: 0 0 1.5rem 0;
    opacity: 0.95;
    font-weight: 300;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.post-meta span::before {
    content: "• ";
    margin-right: 0.5rem;
}

.post-meta span:first-child::before {
    content: "";
    margin-right: 0;
}

/* Content Container */
.post-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

/* Typography */
.post-content h2 {
    font-size: 2rem;
    margin: 3rem 0 1.5rem 0;
    color: #1a1a1a;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    color: #333;
}

.post-content p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #444;
    font-size: 1.05rem;
}

.lead {
    font-size: 1.25rem;
    line-height: 1.7;
    color: #333;
    font-weight: 400;
}

.intro {
    margin-bottom: 3rem;
}

/* Table of Contents */
.toc {
    background: #f8f9fa;
    border-left: 4px solid #0066cc;
    padding: 2rem;
    margin: 2rem 0 3rem 0;
    border-radius: 4px;
}

.toc h2 {
    margin-top: 0;
    font-size: 1.3rem;
    border: none;
    padding-bottom: 0;
}

.toc ol {
    margin: 1rem 0 0 0;
    padding-left: 1.5rem;
}

.toc li {
    margin: 0.75rem 0;
}

.toc a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.toc a:hover {
    color: #004499;
    text-decoration: underline;
}

/* Lists */
.post-content ul,
.post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content li {
    margin: 0.75rem 0;
    line-height: 1.7;
    color: #444;
}

.post-content li strong {
    color: #1a1a1a;
}

/* Diagrams */
.diagram-container {
    margin: 2rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    overflow-x: auto;
}

.diagram-container pre {
    margin: 0;
}

/* Code Blocks */
.code-block {
    margin: 2rem 0;
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
}

.code-block pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
}

.code-block code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #d4d4d4;
}

/* Callouts */
.callout {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
}

.callout-info {
    background: #e3f2fd;
    border-color: #2196f3;
}

.callout-warning {
    background: #fff3e0;
    border-color: #ff9800;
}

.callout-success {
    background: #e8f5e9;
    border-color: #4caf50;
}

.callout strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

/* Sections */
section {
    margin-bottom: 4rem;
}

section:last-of-type {
    margin-bottom: 2rem;
}

/* Author Bio */
.author-bio {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin-top: 4rem;
}

.author-bio h3 {
    margin-top: 0;
}

/* Related Posts */
.related-posts {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid #e0e0e0;
}

.related-posts h3 {
    margin-top: 0;
    margin-bottom: 2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.related-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.related-card h4 {
    margin: 0 0 0.75rem 0;
}

.related-card h4 a {
    color: #0066cc;
    text-decoration: none;
}

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

.related-card p {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
}

/* Conclusion */
.conclusion {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Footer */
.main-footer {
    background: #1a1a1a;
    color: #ffffff;
    padding: 3rem 2rem 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #ffffff;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin: 0.5rem 0;
}

.footer-section a {
    color: #cccccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #ffffff;
}

.footer-bottom {
    max-width: 1200px;
    margin: 2rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid #333;
    text-align: center;
    color: #999;
}

/* Responsive Design */
@media (max-width: 768px) {
    .post-header {
        padding: 3rem 1.5rem 2rem;
    }
    
    .post-header h1 {
        font-size: 2rem;
    }
    
    .post-subtitle {
        font-size: 1.1rem;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .post-content {
        padding: 2rem 1.5rem;
    }
    
    .post-content h2 {
        font-size: 1.6rem;
    }
    
    .post-content h3 {
        font-size: 1.3rem;
    }
    
    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .diagram-container {
        padding: 1rem;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Navigation */
    .nav-container {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Post Header */
    .post-header {
        padding: 2rem 1rem;
    }
    
    .article-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    /* Content Container */
    .content-container {
        padding: 1rem;
    }
    
    /* Grid Layouts - Stack on Mobile */
    .service-grid,
    .diff-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contact-section {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Code Blocks - Horizontal Scroll */
    .code-block,
    pre {
        overflow-x: auto;
        font-size: 0.85rem;
    }
    
    /* Mermaid Diagrams - Scrollable */
    .mermaid {
        overflow-x: auto;
        max-width: 100%;
    }
    
    /* Tables */
    table {
        display: block;
        overflow-x: auto;
        font-size: 0.85rem;
    }
    
    /* Key Concepts Cards */
    .key-concepts {
        grid-template-columns: 1fr;
    }
    
    /* Buttons */
    .cta-button {
        width: 100%;
        padding: 1rem;
    }
    
    /* Timeline */
    .timeline {
        padding-left: 1rem;
    }
    
    .timeline-item::before {
        left: -1rem;
    }
}

/* Touch-Friendly Mobile Interactions */
@media (max-width: 768px) {
    a, button {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-links a {
        padding: 0.75rem 1rem;
    }
}

/* Diagram Container Mobile Fix */
@media (max-width: 768px) {
    .diagram-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 1rem -1rem;
        padding: 0 1rem;
    }
    
    .mermaid svg {
        max-width: 100%;
        height: auto;
    }
}