/* ================================================================
   blog.css — Blog-specific styles for Qonvix
   Covers: blog card enhancements, blog listing hero,
           article detail layout, sidebar, related articles
   ================================================================ */

/* ── Blog card image link ─────────────────────────────────────── */
.blog-img-link {
    display: block;
    text-decoration: none;
}

.blog-img {
    height: 210px;
    background: linear-gradient(45deg, var(--bg-secondary), var(--primary-dark));
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-img {
    transform: scale(1.03);
}

.blog-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(10, 14, 39, 0.6));
    transition: opacity 0.3s ease;
}

.blog-card:hover .blog-img-overlay {
    opacity: 0.7;
}

/* ── Blog link with arrow icon ────────────────────────────────── */
.blog-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-link i {
    font-size: 0.75rem;
    transition: transform 0.25s ease;
}

.blog-link:hover i {
    transform: translateX(4px);
}

/* ── Blog meta icons ──────────────────────────────────────────── */
.blog-date i,
.blog-read i {
    margin-right: 4px;
    color: var(--primary);
    font-size: 0.8rem;
}

/* ── Blog section footer (home "View All") ────────────────────── */
.blog-section-footer {
    text-align: center;
    margin-top: 50px;
}

/* ── Loading indicator ────────────────────────────────────────── */
.blog-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1rem;
}

.blog-loading i {
    color: var(--primary);
    font-size: 1.4rem;
}

/* ── Blog listing hero ────────────────────────────────────────── */
.blog-listing-hero {
    position: relative;
    padding: 160px 0 80px;
    text-align: center;
    overflow: hidden;
}

.blog-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.18) 0%, transparent 45%),
        radial-gradient(circle at 80% 30%, rgba(6, 182, 212, 0.12) 0%, transparent 45%);
    z-index: -1;
}

.blog-hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.blog-hero-content .hero-eyebrow {
    display: inline-block;
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.blog-hero-content h1 {
    font-size: 3rem;
    margin-bottom: 16px;
    background: linear-gradient(to right, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.blog-hero-content p {
    color: var(--text-secondary);
    font-size: 1.15rem;
}

/* ── Blog listing grid ────────────────────────────────────────── */
.blog-grid-listing {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* ── Article hero ─────────────────────────────────────────────── */
.article-hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: flex-end;
    padding-bottom: 60px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
    overflow: hidden;
}

.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10, 14, 39, 0.35) 0%,
        rgba(10, 14, 39, 0.85) 100%
    );
}

.article-hero-content {
    position: relative;
    z-index: 2;
    padding-top: 120px; /* clear fixed header */
}

.back-to-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
    transition: color 0.3s ease;
}

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

.article-hero-content .blog-tag {
    font-size: 0.78rem;
    margin-bottom: 14px;
}

.article-hero-content h1 {
    font-size: 2.6rem;
    max-width: 800px;
    line-height: 1.2;
    margin-bottom: 20px;
}

.article-meta-bar {
    display: flex;
    align-items: center;
    gap: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Article body layout ──────────────────────────────────────── */
.article-body-section {
    padding-top: 60px;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 60px;
    align-items: start;
}

/* ── Article prose ────────────────────────────────────────────── */
.article-prose {
    color: var(--text-secondary);
    font-size: 1.075rem;
    line-height: 1.85;
}

.article-prose p {
    margin-bottom: 1.6rem;
}

.article-prose p:last-child {
    margin-bottom: 0;
}

/* ── Article in-line CTA box ──────────────────────────────────── */
.article-cta-box {
    margin-top: 60px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(6, 182, 212, 0.06));
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    padding: 36px 40px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.article-cta-icon {
    width: 56px;
    height: 56px;
    background-color: rgba(59, 130, 246, 0.15);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
}

.article-cta-box > div:nth-child(2) {
    flex: 1;
}

.article-cta-box h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
    color: white;
}

.article-cta-box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* ── Article sidebar ──────────────────────────────────────────── */
.article-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
}

.sidebar-widget h4 {
    font-size: 1rem;
    color: white;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* ── Share buttons ────────────────────────────────────────────── */
.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.share-linkedin {
    background-color: rgba(10, 102, 194, 0.15);
    color: #0a66c2;
    border: 1px solid rgba(10, 102, 194, 0.3);
}

.share-linkedin:hover {
    background-color: #0a66c2;
    color: white;
}

.share-twitter {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.share-twitter:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

/* ── Related articles section ─────────────────────────────────── */
.related-articles-section {
    background-color: var(--bg-secondary);
}

.related-articles-section .section-title {
    text-align: center;
    margin-bottom: 40px;
}

/* ── Nav active state ─────────────────────────────────────────── */
.nav-link.active {
    color: var(--primary);
}

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

    .article-sidebar {
        position: static;
    }

    .article-hero-content h1 {
        font-size: 2rem;
    }

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

@media (max-width: 768px) {
    .blog-listing-hero {
        padding: 140px 0 60px;
    }

    .article-hero {
        min-height: 420px;
        padding-bottom: 40px;
    }

    .article-hero-content h1 {
        font-size: 1.7rem;
    }

    .article-meta-bar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .article-cta-box {
        flex-direction: column;
        text-align: center;
    }

    .article-cta-icon {
        margin: 0 auto;
    }
}
