/* ========== BLOG — Core Matrix Trading School ========== */

.blog-hero {
    padding: 140px 0 60px;
    text-align: center;
    background: var(--bg-deep);
    position: relative;
}

.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 80%, rgba(201, 168, 76, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.blog-hero .section-description {
    margin-bottom: 0;
}

/* Filters */
.blog-filters {
    padding: 0 0 3rem;
    background: var(--bg-deep);
    position: sticky;
    top: 76px;
    z-index: 50;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-subtle);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 0.55rem 1.3rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--gold);
}

.filter-btn.active {
    background: rgba(201, 168, 76, 0.1);
    color: var(--gold);
    border-color: var(--gold);
}

/* Featured article */
.blog-featured {
    padding: 0 0 4rem;
}

.featured-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(201, 168, 76, 0.04) 0%, var(--glass-bg) 100%);
    border: 1px solid rgba(201, 168, 76, 0.15);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.featured-card:hover {
    border-color: rgba(201, 168, 76, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.featured-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--bg-surface);
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.article-category {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.8rem;
}

.featured-content h2 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1rem;
}

.featured-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.meta-separator {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-muted);
}

/* Articles grid */
.blog-grid-section {
    padding: 0 0 5rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.article-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
}

.article-card:hover {
    transform: translateY(-6px);
    border-color: rgba(201, 168, 76, 0.25);
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
}

.article-card:hover .article-thumb img {
    transform: scale(1.05);
}

.article-thumb {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-surface);
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.article-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article-body .article-category {
    margin-bottom: 0.5rem;
}

.article-body h3 {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.6rem;
}

.article-body p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.65;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.article-body .article-meta {
    margin-top: auto;
}

/* Category colors */
.cat-sistematico { color: #6c8cff; }
.cat-opzioni { color: #00d4aa; }
.cat-materie-prime { color: #e8854a; }
.cat-metodo { color: var(--gold); }

/* Loading & empty */
.blog-loading {
    text-align: center;
    padding: 4rem 0;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.blog-loading p,
.blog-empty p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Placeholder image for articles without imageUrl */
.thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
    font-size: 2.5rem;
    opacity: 0.3;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-card {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 120px 0 40px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        max-width: 500px;
        margin: 0 auto;
    }

    .featured-card {
        padding: 1.5rem;
    }

    .featured-content h2 {
        font-size: 1.3rem;
    }

    .filter-bar {
        padding: 0.8rem 0;
    }
}
