/* ============================================================
   Patient Funnel — Blog System v1.0 (SEO-Optimized)
   Extends AURORA Design System v8.0
   ============================================================ */

/* ============ BLOG HERO ============ */
.blog-hero {
    position: relative;
    padding: calc(88px + var(--s-16)) 0 var(--s-16);
    overflow: hidden;
    background: var(--bg);
}
.blog-hero__aurora {
    position: absolute; inset: -20%;
    background: var(--aurora-1);
    filter: blur(60px);
    pointer-events: none;
}
.blog-hero .container { position: relative; z-index: var(--z-content); }
.blog-hero__breadcrumb {
    display: flex; align-items: center; gap: var(--s-2);
    font-size: 0.8125rem; color: var(--t-3);
    margin-bottom: var(--s-6);
    flex-wrap: wrap;
}
.blog-hero__breadcrumb a { color: var(--t-3); text-decoration: none; transition: color var(--d-fast); }
.blog-hero__breadcrumb a:hover { color: var(--gold); }
.blog-hero__breadcrumb i { font-size: 0.625rem; opacity: 0.5; }
.blog-hero__tag {
    display: inline-flex; align-items: center; gap: var(--s-2);
    padding: var(--s-2) var(--s-4);
    background: rgba(224,183,86,0.08);
    border: 1px solid rgba(224,183,86,0.25);
    border-radius: var(--r-full);
    color: var(--gold); font-size: 0.8125rem; font-weight: 600;
    letter-spacing: 0.02em;
    margin-bottom: var(--s-5);
}
.blog-hero__title {
    font-size: clamp(1.85rem, 4.5vw, 3.25rem);
    font-weight: 800; line-height: 1.22;
    letter-spacing: -0.02em;
    margin-bottom: var(--s-5);
    max-width: 880px;
    background: var(--aurora-text);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.blog-hero__desc { font-size: 1.0625rem; color: var(--t-2); max-width: 720px; line-height: 1.75; }
.blog-hero__meta {
    display: flex; align-items: center; gap: var(--s-5);
    margin-top: var(--s-6); flex-wrap: wrap;
    font-size: 0.875rem; color: var(--t-3);
}
.blog-hero__meta span { display: inline-flex; align-items: center; gap: var(--s-2); }
.blog-hero__meta i { color: var(--gold); font-size: 0.8125rem; }
.blog-hero__author {
    display: inline-flex; align-items: center; gap: var(--s-3);
}
.blog-hero__author-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--aurora-gold);
    display: grid; place-items: center;
    color: #07070A; font-weight: 800; font-size: 0.875rem;
    flex-shrink: 0;
}

/* ============ BLOG LISTING ============ */
.blog-list-section { padding: var(--s-12) 0 var(--s-24); }
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-5);
    margin-top: var(--s-8);
}
.blog-card {
    position: relative;
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--b-1);
    border-radius: var(--r-4);
    padding: var(--s-6);
    text-decoration: none;
    transition: transform var(--d) var(--e-out), border-color var(--d), background var(--d), box-shadow var(--d);
    overflow: hidden;
    min-height: 100%;
}
.blog-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(400px circle at var(--halo-x, 50%) var(--halo-y, 0%), rgba(224,183,86,0.06), transparent 60%);
    opacity: 0; transition: opacity var(--d);
    pointer-events: none;
}
.blog-card:hover { transform: translateY(-4px); border-color: var(--b-3); background: var(--surface-2); box-shadow: var(--sh-3); }
.blog-card:hover::before { opacity: 1; }
.blog-card--featured {
    grid-column: span 3;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: var(--s-8);
    padding: var(--s-8);
    background: linear-gradient(135deg, rgba(224,183,86,0.06), rgba(139,92,246,0.04));
    border-color: rgba(224,183,86,0.22);
}
.blog-card__visual {
    border-radius: var(--r-3);
    overflow: hidden;
    background: var(--bg-3);
    display: grid; place-items: center;
    min-height: 220px;
    border: 1px solid var(--b-1);
}
.blog-card__visual svg { width: 100%; height: 100%; display: block; }
.blog-card__category {
    display: inline-flex; align-self: flex-start;
    padding: 0.2rem 0.7rem;
    background: rgba(224,183,86,0.10);
    border: 1px solid rgba(224,183,86,0.28);
    border-radius: var(--r-full);
    color: var(--gold); font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: var(--s-4);
}
.blog-card__title {
    font-size: 1.125rem; font-weight: 700; line-height: 1.45;
    color: var(--t-1);
    margin-bottom: var(--s-3);
    letter-spacing: -0.01em;
}
.blog-card--featured .blog-card__title { font-size: 1.5rem; }
.blog-card__excerpt {
    font-size: 0.9rem; color: var(--t-3); line-height: 1.7;
    flex-grow: 1;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card__meta {
    display: flex; align-items: center; gap: var(--s-4);
    margin-top: var(--s-5);
    font-size: 0.78rem; color: var(--t-4);
}
.blog-card__meta i { margin-right: 0.3em; color: rgba(224,183,86,0.6); }
.blog-card__arrow {
    position: absolute; top: var(--s-6); right: var(--s-6);
    color: var(--t-4); font-size: 0.875rem;
    transition: transform var(--d) var(--e-out), color var(--d);
}
.blog-card:hover .blog-card__arrow { transform: translate(3px, -3px); color: var(--gold); }

/* ============ ARTICLE LAYOUT ============ */
.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: var(--s-12);
    max-width: var(--w);
    margin: 0 auto;
    padding: 0 var(--s-6);
}
.article-body { min-width: 0; padding-bottom: var(--s-20); }

/* ---- TOC Sidebar ---- */
.article-toc {
    position: sticky; top: 104px;
    align-self: start;
    padding: var(--s-5);
    background: var(--surface);
    border: 1px solid var(--b-1);
    border-radius: var(--r-3);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}
.article-toc__title {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--gold);
    margin-bottom: var(--s-4);
    display: flex; align-items: center; gap: var(--s-2);
}
.article-toc ol { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.article-toc a {
    display: block;
    padding: var(--s-2) var(--s-3);
    font-size: 0.83rem; color: var(--t-3);
    text-decoration: none;
    border-radius: var(--r-1);
    border-left: 2px solid transparent;
    line-height: 1.45;
    transition: all var(--d-fast);
}
.article-toc a:hover { color: var(--t-1); background: var(--surface-2); }
.article-toc a.active { color: var(--gold); border-left-color: var(--gold); background: rgba(224,183,86,0.06); }
.article-toc__cta {
    margin-top: var(--s-5); padding-top: var(--s-5);
    border-top: 1px solid var(--b-1);
}
.article-toc__cta a.btn { width: 100%; justify-content: center; font-size: 0.83rem; padding: var(--s-3) var(--s-4); }

/* ---- Prose (article typography) ---- */
.prose { font-size: 1.03rem; line-height: 1.85; color: var(--t-2); }
.prose > * + * { margin-top: var(--s-5); }
.prose h2 {
    font-size: clamp(1.35rem, 2.6vw, 1.75rem);
    font-weight: 800; color: var(--t-1);
    letter-spacing: -0.015em; line-height: 1.35;
    margin-top: var(--s-14); margin-bottom: var(--s-4);
    padding-top: var(--s-4);
    scroll-margin-top: 104px;
    position: relative;
}
.prose h2::before {
    content: '';
    display: block;
    width: 44px; height: 3px;
    background: var(--aurora-gold);
    border-radius: 2px;
    margin-bottom: var(--s-4);
}
.prose h3 {
    font-size: 1.2rem; font-weight: 700; color: var(--t-1);
    margin-top: var(--s-10); margin-bottom: var(--s-3);
    scroll-margin-top: 104px;
}
.prose strong { color: var(--t-1); font-weight: 700; }
.prose em { color: var(--gold-light); font-style: normal; }
.prose a { color: var(--gold); text-decoration: underline; text-decoration-color: rgba(224,183,86,0.35); text-underline-offset: 3px; transition: text-decoration-color var(--d-fast); }
.prose a:hover { text-decoration-color: var(--gold); }
.prose ul, .prose ol { padding-left: 1.4em; display: flex; flex-direction: column; gap: var(--s-2); }
.prose li::marker { color: var(--gold); }
.prose blockquote {
    border-left: 3px solid var(--gold);
    padding: var(--s-4) var(--s-6);
    background: rgba(224,183,86,0.05);
    border-radius: 0 var(--r-2) var(--r-2) 0;
    color: var(--t-1); font-weight: 500;
}
.prose table {
    width: 100%; border-collapse: collapse;
    font-size: 0.9rem;
    border: 1px solid var(--b-2);
    border-radius: var(--r-2);
    overflow: hidden;
}
.prose th {
    background: var(--surface-3); color: var(--t-1);
    font-weight: 700; text-align: left;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--b-2);
}
.prose td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--b-1); color: var(--t-2); }
.prose tr:last-child td { border-bottom: none; }
.prose .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---- TL;DR box ---- */
.prose-tldr {
    background: linear-gradient(135deg, rgba(224,183,86,0.08), rgba(139,92,246,0.05));
    border: 1px solid rgba(224,183,86,0.25);
    border-radius: var(--r-4);
    padding: var(--s-6);
    margin: var(--s-8) 0 !important;
}
.prose-tldr__label {
    display: inline-flex; align-items: center; gap: var(--s-2);
    font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.12em; color: var(--gold);
    margin-bottom: var(--s-3);
}
.prose-tldr p { color: var(--t-1); font-size: 0.98rem; line-height: 1.75; }
.prose-tldr ul { margin-top: var(--s-3); padding-left: 1.3em; color: var(--t-2); font-size: 0.94rem; }

/* ---- Key stat callout ---- */
.prose-stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: var(--s-3);
    margin: var(--s-6) 0;
}
.prose-stat {
    background: var(--surface);
    border: 1px solid var(--b-1);
    border-radius: var(--r-3);
    padding: var(--s-5) var(--s-4);
    text-align: center;
}
.prose-stat__num {
    font-size: 1.6rem; font-weight: 800;
    background: var(--aurora-gold);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}
.prose-stat__label { font-size: 0.78rem; color: var(--t-3); margin-top: var(--s-1); }

/* ---- Checklist ---- */
.prose-checklist { list-style: none !important; padding-left: 0 !important; }
.prose-checklist li {
    position: relative;
    padding: var(--s-3) var(--s-4) var(--s-3) 2.6rem;
    background: var(--surface);
    border: 1px solid var(--b-1);
    border-radius: var(--r-2);
}
.prose-checklist li::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; left: var(--s-4); top: var(--s-3);
    color: var(--emerald);
}

/* ---- In-article CTA ---- */
.article-cta {
    margin: var(--s-12) 0 !important;
    padding: var(--s-8);
    background: linear-gradient(135deg, rgba(224,183,86,0.10), rgba(139,92,246,0.06));
    border: 1px solid rgba(224,183,86,0.3);
    border-radius: var(--r-5);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.article-cta::before {
    content: '';
    position: absolute; inset: -50%;
    background: var(--aurora-2);
    opacity: 0.35;
    filter: blur(40px);
    pointer-events: none;
}
.article-cta > * { position: relative; }
.article-cta h3 { font-size: 1.3rem; font-weight: 800; color: var(--t-1); margin-bottom: var(--s-2); margin-top: 0 !important; }
.article-cta p { color: var(--t-2); font-size: 0.94rem; margin-bottom: var(--s-5); }
.article-cta .btn { margin: 0 auto; }
.article-cta__note { font-size: 0.78rem !important; color: var(--t-4) !important; margin-top: var(--s-3) !important; margin-bottom: 0 !important; }

/* ---- FAQ in article ---- */
.article-faq { margin-top: var(--s-6); display: flex; flex-direction: column; gap: var(--s-3); }
.article-faq details {
    background: var(--surface);
    border: 1px solid var(--b-1);
    border-radius: var(--r-3);
    overflow: hidden;
    transition: border-color var(--d);
}
.article-faq details[open] { border-color: rgba(224,183,86,0.3); background: var(--surface-2); }
.article-faq summary {
    padding: var(--s-4) var(--s-5);
    font-weight: 600; color: var(--t-1);
    cursor: pointer;
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
    list-style: none;
    font-size: 0.98rem;
}
.article-faq summary::-webkit-details-marker { display: none; }
.article-faq summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free'; font-weight: 900;
    font-size: 0.75rem; color: var(--gold);
    transition: transform var(--d);
    flex-shrink: 0;
}
.article-faq details[open] summary::after { transform: rotate(180deg); }
.article-faq details > div { padding: 0 var(--s-5) var(--s-5); color: var(--t-2); font-size: 0.94rem; line-height: 1.75; }

/* ---- Author box ---- */
.article-author {
    display: flex; gap: var(--s-5); align-items: flex-start;
    margin-top: var(--s-14);
    padding: var(--s-6);
    background: var(--surface);
    border: 1px solid var(--b-2);
    border-radius: var(--r-4);
}
.article-author__avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: var(--aurora-gold);
    display: grid; place-items: center;
    color: #07070A; font-weight: 800; font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: var(--glow-gold);
}
.article-author__name { font-weight: 800; color: var(--t-1); font-size: 1.05rem; }
.article-author__role { font-size: 0.83rem; color: var(--gold); margin-bottom: var(--s-2); }
.article-author__bio { font-size: 0.88rem; color: var(--t-3); line-height: 1.7; }

/* ---- Related posts ---- */
.article-related { margin-top: var(--s-14); }
.article-related__title {
    font-size: 1.25rem; font-weight: 800; color: var(--t-1);
    margin-bottom: var(--s-6);
    display: flex; align-items: center; gap: var(--s-3);
}
.article-related__title i { color: var(--gold); }
.article-related .blog-grid { grid-template-columns: repeat(3, 1fr); margin-top: 0; }

/* ---- Reading progress ---- */
.reading-progress {
    position: fixed; top: 0; left: 0; right: 0;
    height: 3px; z-index: calc(var(--z-header) + 1);
    background: transparent;
    pointer-events: none;
}
.reading-progress__bar {
    height: 100%; width: 0%;
    background: var(--aurora-gold);
    box-shadow: 0 0 12px rgba(224,183,86,0.5);
    transition: width 80ms linear;
}

/* ---- Category filter on listing ---- */
.blog-filters {
    display: flex; gap: var(--s-2); flex-wrap: wrap;
    margin-top: var(--s-8);
}

/* ---- Post navigation ---- */
.post-nav {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4);
    margin-top: var(--s-10);
}
.post-nav a {
    padding: var(--s-5);
    background: var(--surface);
    border: 1px solid var(--b-1);
    border-radius: var(--r-3);
    text-decoration: none;
    transition: all var(--d-fast);
}
.post-nav a:hover { border-color: rgba(224,183,86,0.3); background: var(--surface-2); }
.post-nav__label { display: block; font-size: 0.72rem; color: var(--t-4); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--s-2); }
.post-nav__title { color: var(--t-1); font-weight: 600; font-size: 0.9rem; line-height: 1.5; }
.post-nav a.post-nav--next { text-align: right; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-card--featured { grid-column: span 2; grid-template-columns: 1fr; }
    .article-layout { grid-template-columns: 1fr; }
    .article-toc { position: relative; top: 0; max-height: none; order: -1; margin-bottom: var(--s-6); }
    .article-related .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .blog-grid, .article-related .blog-grid { grid-template-columns: 1fr; }
    .blog-card--featured { grid-column: span 1; }
    .prose-stats { grid-template-columns: 1fr; }
    .post-nav { grid-template-columns: 1fr; }
    .article-author { flex-direction: column; }
    .prose { font-size: 0.98rem; }
}
