@import url('../base.css');

/* Blog-specific tokens */
:root {
    --border-subtle: rgba(0, 0, 0, 0.06);
    color-scheme: light;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* Logo - flat color variant for blog */
.logo {
    gap: 0.75rem;
}

.logo-text {
    font-weight: 600;
    color: var(--primary);
}

.logo-dot-ai {
    color: var(--primary-dark);
}

/* Blog Hero (index page) */
.blog-hero {
    padding: 5rem 0 3rem;
    text-align: center;
}

.blog-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.blog-hero-subtitle {
    color: var(--text-light);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Post Card Grid (index page) */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    padding-bottom: 4rem;
}

.post-card {
    display: block;
    text-decoration: none;
    color: var(--text);
    background: rgba(255, 248, 242, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 8px 24px var(--primary-10);
}

.post-card time {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-card h2 {
    font-size: 1.25rem;
    margin: 0.75rem 0 0.5rem;
    line-height: 1.3;
}

.post-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
}

.post-card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Tags */
.tag {
    display: inline-block;
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    border-radius: 1rem;
    background: var(--primary-10);
    color: var(--primary);
    text-transform: lowercase;
}

/* Blog Post Article */
.blog-post .post-header {
    padding: 4rem 0 2rem;
    text-align: center;
}

.blog-post .post-header h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    max-width: 800px;
    margin: 0 auto;
}

.post-meta {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.meta-separator {
    margin: 0 0.5rem;
    opacity: 0.4;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Article Content - Prose Styles */
.post-content {
    padding: 2rem 0 4rem;
}

.post-content .container {
    max-width: 720px;
}

.post-content h2 {
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
}

.post-content h3 {
    font-size: 1.2rem;
    margin: 2rem 0 0.75rem;
}

.post-content p {
    font-size: 1.125rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.post-content ul, .post-content ol {
    font-size: 1.125rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-style: italic;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

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

/* Code blocks */
.post-content code {
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', monospace;
    font-size: 0.9em;
    background: var(--primary-8);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
}

.post-content pre {
    background: rgba(3, 6, 23, 0.95);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.5;
}

.post-content pre code {
    background: none;
    padding: 0;
    font-size: 0.875rem;
    color: inherit;
}

/* Intro Box */
.intro-box {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    background: var(--primary-4);
}

.intro-box p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

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

.intro-box ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
    list-style: none;
}

.intro-box li {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-light);
    position: relative;
    padding-left: 0.25rem;
}

.intro-box li::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 0.65em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.6;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0 3rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    background: var(--primary-4);
    border: 1px solid var(--border-subtle);
}

.stat {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text);
}

.stat-label {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* Pipeline Flowchart */
.pipeline {
    margin: 2.5rem 0 3rem;
}

.pipeline-title {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-light);
    margin-bottom: 1.25rem;
}

.pipeline-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.pipeline-step {
    position: relative;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-subtle);
    background: var(--primary-3);
}

.pipeline-step.active {
    border-color: var(--border-accent);
    background: var(--primary-6);
}

.step-num {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 0.65rem;
    color: var(--primary);
    opacity: 0.6;
    margin-bottom: 0.25rem;
}

.step-name {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.step-desc {
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.4;
}

.pipeline-step::after {
    content: '';
    position: absolute;
    right: -0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 5px solid var(--primary);
    opacity: 0.4;
}

.pipeline-steps .pipeline-step:nth-child(4)::after,
.pipeline-steps .pipeline-step:last-child::after {
    display: none;
}

/* Row break arrow - between step 4 and 5 */
.pipeline-row-break {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 0.25rem 0;
}

.pipeline-row-break svg {
    opacity: 0.4;
}

/* CTA Box */
.cta-box {
    margin: 3rem 0 1rem;
    padding: 2.5rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary-12), rgba(245, 187, 80, 0.08));
    border: 1px solid var(--primary-30);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top left, var(--primary-15), transparent 60%),
                radial-gradient(ellipse at bottom right, rgba(245, 187, 80, 0.1), transparent 60%);
    pointer-events: none;
}

.cta-box h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.cta-box p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.cta-btn {
    display: inline-block;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: white !important;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--primary-30);
}

/* Plotly charts */
.plotly-container {
    margin: 2rem -1rem;
    padding: 0;
}

.plotly-chart {
    width: 100%;
    min-height: 400px;
}

/* Footer */
.blog-footer {
    background: rgba(255, 248, 242, 0.25);
    backdrop-filter: blur(30px);
    border-top: 1px solid rgba(255, 248, 242, 0.3);
    padding: 2rem 0;
}

.blog-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.blog-footer a {
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 767px) {
    .blog-hero {
        padding: 3rem 0 2rem;
    }

    .blog-hero h1 {
        font-size: 1.75rem;
    }

    .post-grid {
        grid-template-columns: 1fr;
    }

    .blog-post .post-header h1 {
        font-size: 1.75rem;
    }

    .post-content p,
    .post-content ul,
    .post-content ol {
        font-size: 1rem;
    }

    .plotly-container {
        margin: 1.5rem -0.5rem;
    }

    .stats-bar {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .stat {
        flex: 0 0 calc(50% - 0.5rem);
    }

    .pipeline-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .pipeline-steps .pipeline-step:nth-child(2)::after,
    .pipeline-steps .pipeline-step:nth-child(4)::after,
    .pipeline-steps .pipeline-step:nth-child(6)::after {
        display: none;
    }

    .pipeline-row-break {
        display: none;
    }

    .cta-box {
        padding: 1.5rem;
    }

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