/* ============================================================
   PeptideRank — Blog Styles
   Clean typography optimized for long-form reading
   ============================================================ */

/* --- Blog Page Layout --- */
.blog-page {
    padding: 40px 0 80px;
    background: var(--bg-primary);
    min-height: 60vh;
}

.blog-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.blog-page-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.blog-page-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Category Filter --- */
.blog-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.2s;
}

.cat-pill:hover {
    color: var(--text-heading);
    border-color: var(--border-strong);
    background: var(--bg-tertiary);
}

.cat-pill.active {
    color: var(--accent);
    background: var(--accent-light);
    border-color: var(--accent);
}

.cat-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* --- Blog Layout (Main + Sidebar) --- */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: start;
}

@media (max-width: 900px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* --- Article Cards --- */
.articles-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.article-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.82rem;
}

.article-category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-date,
.article-read-time {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.article-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
    line-height: 1.35;
    letter-spacing: -0.01em;
}

.article-card:hover .article-card-title {
    color: var(--accent);
}

.article-card-excerpt {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 16px;
}

.article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.article-author {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.read-more {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
}

/* --- Sidebar --- */
.blog-sidebar {
    position: sticky;
    top: 80px;
}

.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sidebar-vendors {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-vendor {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar-vendor:hover {
    background: var(--bg-secondary);
}

.sidebar-vendor-rank {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 22px;
    font-family: 'IBM Plex Mono', monospace;
}

.sidebar-vendor-name {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
}

.sidebar-vendor-score {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    font-family: 'IBM Plex Mono', monospace;
}

.sidebar-cta {
    display: block;
    text-align: center;
    padding: 10px;
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    border-top: 1px solid var(--border);
}

.sidebar-cta:hover {
    color: var(--accent-hover);
}

.sidebar-disclaimer {
    background: #FFFBEB;
    border-color: #FDE68A;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.sidebar-disclaimer p {
    margin-bottom: 6px;
}

.sidebar-disclaimer p:last-child {
    margin-bottom: 0;
}

.disclaimer-icon {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

/* ===== Individual Article Page ===== */

/* Breadcrumb */
.breadcrumb {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.bc-sep {
    margin: 0 8px;
    opacity: 0.4;
}

.bc-current {
    color: var(--text-muted);
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: bottom;
}

/* Article Header */
.article-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.article-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.article-title {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
    color: var(--text-heading);
    margin-bottom: 16px;
}

.article-excerpt-hero {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 640px;
}

.article-author-line {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.author-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-heading);
}

.author-role {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* --- Article Body (Prose) --- */
.prose {
    font-family: 'Lora', 'Georgia', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.prose h1 {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    margin: 48px 0 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.prose h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    margin: 40px 0 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-heading);
}

.prose h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    margin: 32px 0 12px;
    font-weight: 700;
    color: var(--text-heading);
}

.prose h4 {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    margin: 24px 0 10px;
    font-weight: 600;
    color: var(--text-heading);
}

.prose p {
    margin-bottom: 20px;
}

.prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(15, 118, 110, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}

.prose a:hover {
    text-decoration-color: var(--accent);
}

.prose strong {
    font-weight: 700;
    color: var(--text-heading);
}

.prose ul,
.prose ol {
    margin: 16px 0 20px;
    padding-left: 24px;
}

.prose li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.prose li::marker {
    color: var(--accent);
}

.prose code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.88em;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

.prose hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 40px 0;
}

.prose img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 24px 0;
}

/* Tables in prose */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
}

.prose th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-heading);
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.prose td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.prose tr:last-child td {
    border-bottom: none;
}

.prose tr:hover td {
    background: var(--bg-secondary);
}

/* --- Tags --- */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.tag {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 100px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* --- Article Disclaimer --- */
.article-disclaimer {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin: 32px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
}

.article-disclaimer strong {
    display: block;
    margin-bottom: 6px;
    color: #92400E;
    font-size: 0.92rem;
}

.article-disclaimer p {
    margin: 0;
}

/* --- Related Articles --- */
.related-articles {
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.related-articles h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    font-family: 'Inter', sans-serif;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.related-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.related-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
}

.related-card .article-category {
    margin-bottom: 10px;
}

.related-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.4;
    margin: 8px 0;
}

.related-card:hover h3 {
    color: var(--accent);
}

.related-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
}

.related-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* --- 404 --- */
.not-found {
    text-align: center;
    padding: 80px 0;
}

.not-found h1 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.not-found p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* --- No Articles --- */
.no-articles {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .blog-page-title {
        font-size: 1.7rem;
    }

    .blog-page-subtitle {
        font-size: 0.95rem;
    }

    .article-card {
        padding: 20px;
    }

    .article-card-title {
        font-size: 1.1rem;
    }

    .article-title {
        font-size: 1.6rem;
    }

    .article-excerpt-hero {
        font-size: 1rem;
    }

    .prose {
        font-size: 1rem;
    }

    .prose h2 {
        font-size: 1.3rem;
    }

    .prose h3 {
        font-size: 1.1rem;
    }

    .blog-categories {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .cat-pill {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .article-meta-top {
        flex-wrap: wrap;
        gap: 8px;
    }

    .bc-current {
        max-width: 160px;
    }
}

@media (max-width: 500px) {
    .article-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .article-title {
        font-size: 1.4rem;
    }

    .prose table {
        font-size: 0.82rem;
    }

    .prose th,
    .prose td {
        padding: 8px 10px;
    }
}
