/* ================================================================
   blog.css — Additive styles for the Sensor Fusion Lab blog section
   Never overrides style.css. Relies on CSS variables declared there.
   ================================================================ */

/* ── Active nav link (Blog page) ─────────────────────────────── */
.nav-link--active {
    color: var(--text-main) !important;
}
.nav-link--active::after {
    width: 100% !important;
}

/* ── Breadcrumb ──────────────────────────────────────────────── */
.breadcrumb {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.6rem 1.4rem 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}
.breadcrumb li + li::before {
    content: "/";
    margin-right: 0.3rem;
    color: var(--text-muted);
    opacity: 0.5;
}
.breadcrumb a {
    color: var(--primary);
    transition: opacity 180ms ease-out;
}
.breadcrumb a:hover {
    opacity: 0.75;
}
.breadcrumb [aria-current="page"] {
    color: var(--text-muted);
}

/* ── Blog listing hero ───────────────────────────────────────── */
.blog-hero {
    padding-top: 2.2rem;
    margin-bottom: 0.4rem;
}
.blog-hero-desc {
    font-size: 0.96rem;
    color: var(--text-muted);
    margin-top: 0.6rem;
    max-width: 42rem;
}

/* ── Article card grid ───────────────────────────────────────── */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.4rem;
    margin-top: 1.6rem;
}

.blog-card {
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.2rem 1.1rem;
}

.blog-card-meta {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.55rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.blog-card-meta .meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.14rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(101, 184, 190, 0.6);
    color: var(--primary);
    background: #fff;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.blog-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
.blog-card-title a {
    color: inherit;
    transition: color 180ms ease-out;
}
.blog-card-title a:hover {
    color: var(--primary);
}

.blog-card-excerpt {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.blog-card-footer {
    margin-top: auto;
    padding-top: 0.4rem;
}

/* ── Blog listing teaser on homepage ─────────────────────────── */
.blog-teaser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.2rem;
}

.blog-teaser-meta {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.blog-teaser-title {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-main);
}
.blog-teaser-title a {
    color: inherit;
    transition: color 180ms ease-out;
}
.blog-teaser-title a:hover {
    color: var(--primary);
}

.blog-teaser-actions {
    margin-top: 1.4rem;
}

/* ── Article page layout ─────────────────────────────────────── */
.blog-article {
    max-width: 72ch;
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.blog-article-header {
    margin-bottom: 2.2rem;
}

.blog-article-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}
.blog-article-meta .meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(101, 184, 190, 0.6);
    color: var(--primary);
    background: #fff;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.blog-article-meta .meta-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.blog-article-meta .meta-read {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.blog-article-meta .meta-sep {
    color: var(--text-muted);
    opacity: 0.4;
}

.blog-article-title {
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    font-weight: 650;
    line-height: 1.15;
    color: var(--text-main);
    margin-bottom: 0.8rem;
}

.blog-article-lead {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 0.8rem;
}

.blog-article-byline {
    font-size: 0.78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-soft);
    padding-top: 0.8rem;
    margin-top: 0.4rem;
}

/* ── Article body prose ──────────────────────────────────────── */
.blog-article-body {
    font-size: 0.96rem;
    line-height: 1.78;
    color: var(--text-main);
}

.blog-article-body h2 {
    font-size: 1.25rem;
    font-weight: 650;
    margin: 2.2rem 0 0.6rem;
    color: var(--text-main);
    line-height: 1.2;
}

.blog-article-body h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.6rem 0 0.4rem;
    color: var(--text-main);
}

.blog-article-body p {
    margin-bottom: 1.1rem;
}

.blog-article-body ul,
.blog-article-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1.1rem;
}

.blog-article-body li {
    margin-bottom: 0.4rem;
    line-height: 1.7;
}

.blog-article-body blockquote {
    border-left: 3px solid var(--primary-soft);
    padding-left: 1.1rem;
    margin: 1.4rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.blog-article-body code {
    background: rgba(30, 138, 146, 0.09);
    padding: 0.15em 0.45em;
    border-radius: 5px;
    font-size: 0.87em;
    font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

.blog-article-body pre {
    background: #111827;
    color: #e5ecff;
    border-radius: 14px;
    padding: 1.2rem 1.4rem;
    overflow-x: auto;
    margin: 1.4rem 0;
    box-shadow: var(--shadow-soft);
}

.blog-article-body pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    color: inherit;
}

.blog-article-body strong {
    font-weight: 650;
    color: var(--text-main);
}

.blog-article-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.blog-article-body a:hover {
    opacity: 0.8;
}

.blog-article-body hr {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 2rem 0;
}

/* ── Article bottom CTA ──────────────────────────────────────── */
.blog-article-cta {
    margin-top: 3rem;
    background: linear-gradient(135deg, var(--primary-soft), var(--primary));
    border-radius: var(--radius-lg);
    padding: 1.8rem 2rem;
    color: #ffffff;
    box-shadow: 0 12px 32px rgba(23, 94, 110, 0.32);
}

.blog-article-cta h3 {
    font-size: 1.1rem;
    font-weight: 650;
    margin-bottom: 0.5rem;
}

.blog-article-cta p {
    font-size: 0.9rem;
    opacity: 0.92;
    margin-bottom: 1.2rem;
    line-height: 1.6;
}

.blog-article-cta .btn-ghost {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

.blog-article-cta .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.8);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-article {
        padding: 1.4rem 0 3rem;
    }

    .blog-article-title {
        font-size: 1.55rem;
    }

    .blog-article-cta {
        padding: 1.3rem 1.2rem;
    }

    .blog-teaser-grid {
        grid-template-columns: 1fr;
    }
}
