/* ============================================
   Blog Styles
   ============================================ */

/* Latest Posts Section */
.latest-posts-section {
    padding: 3rem 0 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.post-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow-hover);
}

.post-card .source-tag {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.post-card .source-tag.agentic { background: rgba(139, 92, 246, 0.15); color: #7c3aed; }
.post-card .source-tag.lifescience { background: rgba(16, 185, 129, 0.15); color: #059669; }
.post-card .source-tag.water { background: rgba(14, 165, 233, 0.15); color: #0284c7; }
.post-card .source-tag.investment { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.post-card .source-tag.options { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.post-card .source-tag.external { background: rgba(169, 143, 115, 0.15); color: #a98f73; }

.post-card h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card h3 a { color: inherit; text-decoration: none; }
.post-card h3 a:hover { color: var(--text-accent); }

.post-card .post-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.post-card .post-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.post-card .post-meta a { color: var(--text-accent); text-decoration: none; }
.post-card .post-meta a:hover { text-decoration: underline; }

/* ===== ARTICLE PAGE STYLES ===== */
.article-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.article-hero {
    text-align: center;
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.5rem;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.source-tag {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
}

.source-tag.external { 
    background: rgba(169, 143, 115, 0.15); 
    color: var(--accent); 
}

.article-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.article-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.article-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 560px;
    margin: 0 auto;
}

/* Article Body */
.article-body {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-primary);
}

.article-note {
    background: rgba(169, 143, 115, 0.1);
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.article-note a { color: var(--accent); }
.article-note a:hover { text-decoration: underline; }

.article-body h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem;
    padding-top: 0.5rem;
}

.article-body h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 0.75rem;
}

.article-body h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin: 1.5rem 0 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.article-body ul, .article-body ol {
    margin: 1rem 0 1.25rem 1.5rem;
}

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

.article-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.article-body em {
    font-style: italic;
    color: var(--text-secondary);
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1.25rem;
    margin: 1.5rem 0;
    background: rgba(169, 143, 115, 0.06);
    border-radius: 0 8px 8px 0;
}

.article-body blockquote p {
    margin-bottom: 0.5rem;
    font-style: italic;
}

.article-body blockquote cite {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: normal;
}

.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-body a:hover {
    color: var(--accent-dk);
}

/* Chapter Numbers */
.chapter-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background: var(--accent);
    color: white;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50%;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.chapter-header {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 2.5rem 0 1rem;
}

.chapter-header h2 {
    margin: 0;
    padding-top: 0.25rem;
}

/* Article Footer */
.article-footer {
    text-align: center;
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* Loading & Error States */
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.rss-error {
    text-align: center;
    padding: 2rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    color: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
    .posts-grid { grid-template-columns: 1fr; }
    .latest-posts-section { padding: 2rem 1rem 3rem; }
    .article-page { padding: 1.5rem 1rem 3rem; }
    .article-title { font-size: 1.75rem; }
    .article-body { font-size: 1rem; }
}
