/* Shared blog-post components: cover image and FAQ section */
.post-hero {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 0 0 3rem;
}

.post-faq {
    margin: 3rem 0 2rem;
}

.post-faq .faq-item {
    border-bottom: 1px solid var(--border);
    padding: 0.25rem 0 1rem;
}

.post-faq .faq-item:last-child {
    border-bottom: none;
}

.post-faq .faq-item h3 {
    font-size: 1.15rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.post-faq .faq-item p {
    margin-bottom: 0.5rem;
}

/* Some posts place the FAQ after .blog-content, so style it independently */
.post-faq h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.post-faq .faq-item h3 {
    font-weight: 600;
    color: var(--text-primary);
}

.post-faq .faq-item p {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .post-faq h2 { font-size: 1.6rem; }
}

/* Reading layout: comfortable line length and wrapping for articles */
.container > article {
    max-width: 46rem;
    margin-left: auto;
    margin-right: auto;
}

.blog-content p,
.blog-content li {
    text-wrap: pretty;
}

.blog-title,
.blog-content h2,
.blog-content h3 {
    text-wrap: balance;
}

.blog-content img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 640px) {
    .container {
        padding: 2rem 1.1rem;
    }

    .blog-content {
        font-size: 1.05rem;
        line-height: 1.75;
    }

    .blog-content h2 {
        font-size: 1.6rem;
    }
}

/* Tables without a .table-wrap scroll inside their own box instead of widening the page */
.blog-content > table,
.blog-content :not(.table-wrap) > table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640px) {
    /* Older posts use inline flex rows with fixed minimum widths: let them shrink and wrap */
    .blog-content [style*="min-width"] {
        min-width: 0 !important;
    }

    .blog-content [style*="display: flex"],
    .blog-content [style*="display:flex"] {
        flex-wrap: wrap;
    }

    .blog-content > * {
        max-width: 100%;
    }

    /* Cards laid out as "flex: 1; min-width: Npx" would shrink into slivers once the min-width is released above: give each its own row instead */
    .blog-content [style*="min-width"][style*="flex: 1"],
    .blog-content [style*="min-width"][style*="flex:1"] {
        flex: 1 1 100% !important;
    }

    /* Older posts' inline multi-column grids stack into one column on phones */
    .blog-content [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Flex children may shrink below their content width instead of overflowing */
    .blog-content [style*="display: flex"] > *,
    .blog-content .path-step > * {
        min-width: 0;
        overflow-wrap: anywhere;
    }
}

/* Stat cards: never wider than their grid column */
.stat-grid > * {
    min-width: 0;
}

.stat-grid .stat-number {
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .stat-grid .stat-number {
        font-size: 1.8rem;
    }
}

/* Metrics disclaimer: short note at the top, full box at the end (posts with unsourced metrics) */
.post-note {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-secondary);
    background: var(--bg-gray);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    margin-bottom: 1.75rem;
}

.blog-content .post-note a,
.post-note a { font-weight: 600; }

.post-disclaimer {
    margin: 2.5rem 0 1.5rem;
    padding: 1.25rem 1.4rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--text-light);
    border-radius: 12px;
    background: var(--bg-gray);
    scroll-margin-top: 90px;
}

.blog-content .post-disclaimer h3,
.post-disclaimer h3 {
    font-size: 0.85rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 0 0.6rem;
}

.blog-content .post-disclaimer p,
.post-disclaimer p {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-secondary);
    margin-bottom: 0.7rem;
}

.blog-content .post-disclaimer p:last-child,
.post-disclaimer p:last-child { margin-bottom: 0; }

.blog-content .post-disclaimer strong,
.post-disclaimer strong { color: var(--text-primary); }

/* Sources list (shared; some posts also define it inline) */
.sources { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); font-size: 0.9rem; }
.sources h3 { font-size: 1.1rem; margin-top: 0; margin-bottom: 0.75rem; }
.sources ul { padding-left: 1.25rem; }
.sources li { margin-bottom: 0.5rem; line-height: 1.6; }

/* Author byline links to LinkedIn */
.blog-meta .byline-link { color: inherit; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; text-decoration-thickness: 1.5px; transition: color .15s ease, text-decoration-color .15s ease; }
.blog-meta .byline-link:hover { color: var(--primary); text-decoration-color: currentColor; }
.blog-meta .byline-link:focus-visible { outline: none; border-radius: 3px; box-shadow: 0 0 0 3px var(--focus-ring); }

/* Shared comparison tables (posts that don't define their own) */
.table-wrap { overflow-x: auto; margin: 2rem 0 2.5rem; border: 1px solid var(--border); border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.5; min-width: 640px; }
.data-table th { background: var(--bg-gray); color: var(--text-primary); font-weight: 700; text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-secondary); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td:first-child { color: var(--text-primary); }
/* Unwrapped tables scroll inside their own box, so they must not force a minimum width on the page */
.blog-content > table.data-table, .blog-content :not(.table-wrap) > table.data-table { min-width: 0; }

/* ===== Design refresh (2026-11-29): minimal, colourful reading experience for every post =====
   Higher selector weight than the per-post inline styles, so one place restyles all posts. Colours come from theme tokens. */
@supports (animation-timeline: scroll()) {
    body::before { content: ""; position: fixed; z-index: 1300; top: 0; left: 0; width: 100%; height: 3px; background: linear-gradient(90deg, #6366f1, #d946ef 60%, #fb923c); transform: scaleX(0); transform-origin: 0 50%; animation: post-progress linear both; animation-timeline: scroll(root); pointer-events: none; }
    @keyframes post-progress { to { transform: scaleX(1); } }
}
main article .blog-header { margin-bottom: 2.4rem; }
main article .blog-category { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 1.1rem; padding: 6px 14px; border: 1px solid color-mix(in srgb, #6366f1 30%, transparent); border-radius: 999px; background: color-mix(in srgb, #6366f1 11%, transparent); color: var(--text-primary); font-size: .74rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
main article .blog-category::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #d946ef); }
main article .blog-title { font-size: clamp(2rem, 5.2vw, 3.3rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; margin-bottom: 1.1rem; }
main article .blog-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.3rem; }
main article .blog-meta-item { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .82rem; color: var(--text-secondary); }
main article .blog-meta-item:nth-child(2)::before { content: "AM"; flex: none; width: 22px; height: 22px; margin-left: -6px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #d946ef); color: #fff; font-size: .58rem; font-weight: 800; letter-spacing: .02em; display: inline-flex; align-items: center; justify-content: center; }
main article .blog-meta-item .byline-link { color: inherit; text-decoration: none; font-weight: 600; }
main article .blog-meta-item .reading-time { margin: 0; padding: 0; border-radius: 0; background: none; font-size: inherit; color: inherit; }
main article .blog-meta-item:last-child::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }
main article .blog-description { max-width: 44rem; margin-bottom: 1.5rem; font-size: clamp(1.05rem, 2.2vw, 1.22rem); line-height: 1.6; color: var(--text-secondary); }
main article .blog-header .share-title, main article .blog-header .share-label { display: none; }
main article .blog-header .share-bar { gap: 8px; margin: 0; }
main article .blog-header .share-btn { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }
.post-hero { border: 0; border-radius: 24px; box-shadow: 0 26px 50px -32px rgba(15, 23, 42, .5); }

main article .blog-content { font-size: 1.07rem; line-height: 1.8; }
main article .blog-content h2 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 3.2rem 0 1rem; }
main article .blog-content h2::before { content: ""; display: block; width: 34px; height: 4px; margin-bottom: .75rem; border-radius: 4px; background: linear-gradient(110deg, #6366f1, #d946ef 60%, #fb923c); }
main article .blog-content h3 { font-weight: 750; letter-spacing: -.015em; }
main article .blog-content p a, main article .blog-content li a { color: #4f46e5; text-decoration: underline; text-decoration-color: color-mix(in srgb, #4f46e5 35%, transparent); text-underline-offset: 3px; transition: text-decoration-color .2s; }
main article .blog-content p a:hover, main article .blog-content li a:hover { text-decoration-color: currentColor; }
html[data-theme="dark"] main article .blog-content p a, html[data-theme="dark"] main article .blog-content li a { color: #a5b4fc; }
main article .blog-content blockquote { margin: 2rem 0; padding: 1.2rem 1.5rem; border: 0; border-radius: 20px; background: color-mix(in srgb, #6366f1 8%, var(--surface)); box-shadow: inset 4px 0 0 #6366f1; }
main article .blog-content .insight-box { border-radius: 20px; border: 1px solid color-mix(in srgb, #10b981 35%, var(--border)); background: color-mix(in srgb, #10b981 8%, var(--surface)); }
main article .blog-content .warning-box { border-radius: 20px; border: 1px solid color-mix(in srgb, #f59e0b 40%, var(--border)); background: color-mix(in srgb, #f59e0b 9%, var(--surface)); }
main article .blog-content .stat-card, main article .blog-content .criteria-card { border-radius: 20px; }
main article .blog-content table { border-collapse: separate; border-spacing: 0; border: 1px solid var(--border); border-radius: 16px; }
main article .blog-content table th { background: var(--bg-gray); }
main article .blog-content table > :first-child > tr:first-child > :first-child { border-top-left-radius: 15px; }
main article .blog-content table > :first-child > tr:first-child > :last-child { border-top-right-radius: 15px; }
main article .blog-content table > :last-child > tr:last-child > :first-child { border-bottom-left-radius: 15px; }
main article .blog-content table > :last-child > tr:last-child > :last-child { border-bottom-right-radius: 15px; }
main article .author-box { border-radius: 24px; border: 1px solid var(--border); background: linear-gradient(135deg, color-mix(in srgb, #6366f1 8%, var(--surface)), var(--surface) 65%); }
.post-faq .faq-item { margin: 0 0 .7rem; padding: .2rem 1.3rem .6rem; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.post-faq .faq-item:last-child { border-bottom: 1px solid var(--border); }
main .more-articles h2 { font-weight: 800; letter-spacing: -.025em; }
main .more-articles .article-card { border-radius: 22px; transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s, border-color .25s; }
main .more-articles .article-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, #6366f1 50%, var(--border)); box-shadow: 0 22px 38px -24px rgba(99, 102, 241, .55); }
main .more-articles .article-card .ac-tag { border-radius: 999px; }
main .share-bar.share-bar-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 3rem 0 2rem; padding: 0; border: 0; }
main .share-bar-bottom .share-label { display: none; }
main .share-bar-bottom .share-btn { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }
main .share-bar-bottom .share-title { margin-right: 4px; }
main .author-box .author-avatar { background: linear-gradient(135deg, #6366f1, #d946ef); }

/* ---- Listen to this blog (audio player, assets/js/listen.js) ---- */
.listen { --lc: #6366f1; display: flex; align-items: center; gap: 14px; max-width: 760px; margin: 18px auto 4px; padding: 12px 16px 12px 12px; border-radius: 26px; border: 1px solid var(--border); background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, #6366f1 14%, transparent), transparent 60%), radial-gradient(100% 120% at 100% 100%, color-mix(in srgb, #fb923c 13%, transparent), transparent 60%), var(--surface); }
.listen .ls-play { flex: none; width: 52px; height: 52px; border: 0; border-radius: 50%; cursor: pointer; color: #fff; background: linear-gradient(135deg, #6366f1, #d946ef 60%, #fb923c); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px -10px #d946ef; transition: transform .15s; }
.listen .ls-play:hover { transform: scale(1.06); }
.listen .ls-play svg { width: 20px; height: 20px; fill: currentColor; }
.listen .ls-play .i-pause { display: none; } .listen.on .ls-play .i-play { display: none; } .listen.on .ls-play .i-pause { display: block; }
.listen .ls-main { flex: 1; min-width: 0; }
.listen .ls-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.listen .ls-title { margin: 0; font-size: .95rem; font-weight: 750; letter-spacing: -.01em; color: var(--text-primary); }
.listen .ls-note { font-size: .72rem; color: var(--text-light); white-space: nowrap; }
.listen .ls-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.listen .ls-time { flex: none; min-width: 2.3em; font-size: .72rem; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.listen .ls-bar { position: relative; flex: 1; height: 22px; display: flex; align-items: center; cursor: pointer; border-radius: 999px; }
.listen .ls-bar::before { content: ""; position: absolute; left: 0; right: 0; height: 5px; border-radius: 999px; background: var(--bg-gray); border: 1px solid var(--border); box-sizing: border-box; }
.listen .ls-fill { position: relative; height: 5px; width: 0; border-radius: 999px; background: linear-gradient(90deg, #6366f1, #d946ef, #fb923c); }
.listen .ls-btn { flex: none; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); border-radius: 999px; height: 28px; min-width: 28px; padding: 0 9px; font: inherit; font-size: .72rem; font-weight: 650; cursor: pointer; }
.listen .ls-btn:hover { color: var(--text-primary); border-color: var(--lc); }
.listen .ls-msg { margin: 6px 0 0; font-size: .74rem; color: #dc2626; } .listen .ls-msg:empty { display: none; }
.listen .ls-play:focus-visible, .listen .ls-btn:focus-visible, .listen .ls-bar:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
@media (max-width: 560px) { .listen { gap: 10px; padding: 10px 12px 10px 10px; } .listen .ls-play { width: 46px; height: 46px; } .listen .ls-note { display: none; } .listen .ls-back, .listen .ls-fwd { display: none; } }
@media print { .listen { display: none; } }
