/* ============================================
   Blog Content Hub — Styles
   Uses existing CSS variables from styles.css
   ============================================ */

/* ---- Hub Page ---- */

.blog-hero {
    text-align: center;
    padding: 4rem 2rem 3rem;
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 3rem;
    background: linear-gradient(135deg, rgba(100, 108, 255, 0.08), rgba(80, 250, 123, 0.06));
    border: 1px solid var(--border);
}

.blog-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), #50fa7b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.15;
}

.blog-hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Category Filter Pills */
.blog-categories {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.category-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s ease;
    text-decoration: none;
}

.category-pill:hover {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(100, 108, 255, 0.08);
}

.category-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Featured Post (first article on hub) */
.blog-featured {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    margin-bottom: 3rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow);
}

.blog-featured-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 300px;
}

.blog-featured-body {
    padding: 2.5rem 2.5rem 2.5rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 1rem;
}

.blog-featured-title {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--text);
}

.blog-featured-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.blog-featured-title a:hover {
    color: var(--accent);
}

.blog-featured-excerpt {
    font-size: 1.05rem;
    color: var(--text-dim);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.blog-featured-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* Article Card Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.blog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px var(--shadow);
}

.blog-card-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

.blog-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-img {
    transform: scale(1.05);
}

.blog-card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(8px);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.blog-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.75rem;
}

.blog-card-title a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-card-title a:hover {
    color: var(--accent);
}

.blog-card-excerpt {
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1rem;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-dim);
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.blog-card-read {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.blog-card-read:hover {
    opacity: 0.8;
}

/* ---- Individual Post Pages ---- */

/* Reading Progress */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #50fa7b);
    z-index: 9999;
    width: 0%;
    transition: width 0.1s linear;
}

/* Post Hero */
.post-hero {
    text-align: center;
    padding: 0;
    margin-bottom: 2.5rem;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

.post-hero-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.post-hero-content {
    padding: 2rem 2rem 2.5rem;
    background: linear-gradient(135deg, rgba(100, 108, 255, 0.06), rgba(80, 250, 123, 0.04));
}

.post-category-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
}

.post-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text);
}

.post-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-dim);
    flex-wrap: wrap;
}

/* Post Layout */
.post-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 3rem;
    align-items: start;
}

/* Post Content */
.post-content {
    max-width: 100%;
}

.post-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--text);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.post-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--text);
}

.post-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
}

.post-content ul,
.post-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
    color: var(--text-dim);
    line-height: 1.8;
}

.post-content li {
    margin-bottom: 0.5rem;
    font-size: 1.02rem;
}

.post-content strong {
    color: var(--text);
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s;
}

.post-content a:hover {
    opacity: 0.8;
}

/* Callout Boxes (reused from guide) */
.post-callout {
    background: rgba(100, 108, 255, 0.06);
    border-left: 4px solid var(--accent);
    padding: 1.25rem 1.5rem;
    border-radius: 0 10px 10px 0;
    margin: 1.5rem 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-dim);
}

.post-callout.tip {
    background: rgba(80, 250, 123, 0.06);
    border-left-color: #50fa7b;
}

.post-callout.warning {
    background: rgba(255, 184, 108, 0.06);
    border-left-color: #ffb86c;
}

.post-callout strong {
    color: var(--text);
}

/* Data Tables */
.post-table-wrap {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.post-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.post-table thead {
    background: rgba(100, 108, 255, 0.08);
}

.post-table th {
    padding: 0.85rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.post-table td {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
}

.post-table tbody tr:hover {
    background: var(--surface-hover);
}

/* Key Takeaway */
.post-key-takeaway {
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.post-key-takeaway h4 {
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.post-key-takeaway p {
    margin-bottom: 0;
    font-size: 1rem;
}

/* Table of Contents Sidebar */
.post-toc {
    position: sticky;
    top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
}

.post-toc h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-bottom: 1rem;
    font-weight: 600;
}

.post-toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.post-toc li {
    counter-increment: toc-counter;
    margin-bottom: 0.5rem;
}

.post-toc a {
    display: block;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.88rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s;
    border-left: 2px solid transparent;
}

.post-toc a::before {
    content: counter(toc-counter) ". ";
    color: var(--accent);
    font-weight: 600;
}

.post-toc a:hover,
.post-toc a.active {
    color: var(--text);
    background: rgba(100, 108, 255, 0.06);
    border-left-color: var(--accent);
}

/* CTA Section */
.post-cta {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(100, 108, 255, 0.08), rgba(80, 250, 123, 0.06));
    border: 1px solid var(--border);
    border-radius: 16px;
    margin: 3rem 0;
}

.post-cta h2 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    border: none;
    padding: 0;
    color: var(--text);
}

.post-cta p {
    color: var(--text-dim);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.post-cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 108, 255, 0.3);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
}

/* Related Posts */
.related-posts {
    margin-top: 3rem;
}

.related-posts h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: block;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px var(--shadow);
}

.related-card-category {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.related-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.related-card-time {
    font-size: 0.82rem;
    color: var(--text-dim);
}

/* Author Box */
.author-box {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2.5rem 0;
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #50fa7b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    flex-shrink: 0;
}

.author-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.author-info p {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin: 0;
}

/* Affiliate Disclaimer */
.affiliate-disclaimer {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: rgba(100, 108, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-dim);
}

.affiliate-disclaimer strong {
    color: var(--text);
}

/* ---- Responsive ---- */

@media (max-width: 1024px) {
    .post-layout {
        grid-template-columns: 1fr;
    }

    .post-toc {
        position: static;
        margin-bottom: 2rem;
    }

    .blog-featured {
        grid-template-columns: 1fr;
    }

    .blog-featured-body {
        padding: 2rem;
    }

    .blog-featured-img {
        min-height: 220px;
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2rem;
    }

    .post-hero h1 {
        font-size: 1.8rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-featured-title {
        font-size: 1.4rem;
    }

    .blog-categories {
        gap: 0.35rem;
    }

    .category-pill {
        padding: 0.4rem 0.9rem;
        font-size: 0.82rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
    }
}