/* Blog post styles */
.post-hero { text-align: center; padding: 10rem 2rem 2rem; position: relative; z-index: 1; max-width: 850px; margin: 0 auto; }
.post-breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.post-breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color 0.3s ease; }
.post-breadcrumb a:hover { color: var(--accent-gold); }
.post-breadcrumb svg { width: 14px; height: 14px; vertical-align: -2px; stroke: var(--text-muted); fill: none; stroke-width: 2; margin: 0 0.35rem; }
.post-hero h1 { font-size: 2.75rem; font-weight: 800; line-height: 1.2; margin-bottom: 1.25rem; color: var(--text-primary); overflow-wrap: break-word; }
.post-meta { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.post-date { font-family: 'Space Mono', monospace; font-size: 0.85rem; color: var(--text-muted); }
.post-category { font-size: 0.75rem; font-weight: 600; color: var(--accent-gold); background: var(--accent-gold-dim); padding: 0.2rem 0.6rem; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.5px; }
.post-content { max-width: 800px; margin: 0 auto; padding: 2rem 2rem 4rem; position: relative; z-index: 1;
    /* long unbreakable words in body text, bold spans and link labels
       would otherwise push the page sideways on a narrow phone */
    overflow-wrap: break-word;
}
.post-content h2 { font-size: 1.6rem; font-weight: 700; margin: 2.5rem 0 1rem; color: var(--text-primary); }
.post-content h3 { font-size: 1.3rem; font-weight: 600; margin: 2rem 0 0.75rem; color: var(--text-primary); }
.post-content h4 { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; color: var(--text-primary); }
.post-content p { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.8; margin-bottom: 1.25rem; }
.post-content a { color: var(--accent-gold); text-decoration: none; transition: color 0.3s ease; }
.post-content a:hover { color: var(--accent-gold-light); text-decoration: underline; }
.post-content ul, .post-content ol { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.8; margin-bottom: 1.25rem; padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content strong { color: var(--text-primary); font-weight: 600; }
.post-content blockquote { border-left: 3px solid var(--accent-gold); padding: 1rem 1.5rem; margin: 1.5rem 0; background: var(--bg-card); border-radius: 0 8px 8px 0; }
.post-content blockquote p { margin-bottom: 0; }
.post-content pre { background: var(--bg-tertiary); border: 1px solid var(--border-subtle); border-radius: 8px; padding: 1.25rem; overflow-x: auto; margin: 1.5rem 0; }
/* Inline code holds long unbreakable tokens (commands, paths, URLs) that
   otherwise push the whole page sideways on a phone, so let them break
   mid-token. Code inside <pre> is excluded: the <pre> scrolls instead, and
   breaking its lines would corrupt copied commands. */
.post-content code { font-family: 'Space Mono', monospace; font-size: 0.9rem; overflow-wrap: anywhere; }
.post-content pre code { overflow-wrap: normal; }
.post-content p code { background: var(--bg-tertiary); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85rem; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
.post-content th, .post-content td { padding: 0.75rem 1rem; border: 1px solid var(--border-subtle); text-align: left; color: var(--text-secondary); }
/* Wide comparison tables: scroll inside their own container instead of overflowing the page */
.post-content .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5rem 0; }
.post-content .table-scroll table { margin: 0; min-width: 32rem; }
.post-content th { background: var(--bg-tertiary); color: var(--text-primary); font-weight: 600; }
.post-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1rem 0; }
.post-content figure { margin: 1.5rem 0; }
.post-content figcaption { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }
.post-bottom-nav { max-width: 800px; margin: 0 auto; padding: 0 2rem 4rem; position: relative; z-index: 1; border-top: 1px solid var(--border-subtle); padding-top: 2rem; text-align: center; }
.back-to-blog { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--accent-gold); font-weight: 600; font-size: 0.95rem; text-decoration: none; transition: gap 0.3s ease; }
.back-to-blog:hover { gap: 0.75rem; }
.back-to-blog svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.cta-box { background: linear-gradient(135deg, rgba(245, 166, 35, 0.1) 0%, rgba(168, 85, 247, 0.08) 100%); border: 1px solid rgba(245, 166, 35, 0.25); border-radius: 12px; padding: 2rem; margin: 2rem 0; text-align: center; }
.cta-box h3 { color: var(--accent-gold); margin-bottom: 0.75rem; }
.cta-box p { margin-bottom: 1rem; }
.cta-box .btn { margin-top: 0.5rem; }
/* .post-content a (0,1,1) outranks .btn-primary (0,1,0) from styles.css, which turned the CTA
   button text gold on a gold gradient. Restore the button's own colours inside post content. */
.post-content .cta-box .btn-primary, .post-content .cta-box .btn-primary:hover { color: var(--bg-primary); text-decoration: none; }
.post-content .cta-box .btn-ghost, .post-content .cta-box .btn-ghost:hover { color: var(--text-primary); text-decoration: none; }

/* Related articles (topic-cluster interlinking) */
.related-posts { max-width: 800px; margin: 0 auto; padding: 2.5rem 2rem 1rem; position: relative; z-index: 1; border-top: 1px solid var(--border-subtle); }
.related-posts h2, .related-posts h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-primary); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.related-card { display: block; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; padding: 1.25rem; text-decoration: none; transition: border-color 0.3s ease, transform 0.3s ease; }
.related-card:hover { border-color: var(--accent-gold); transform: translateY(-3px); }
.rc-cat { font-size: 0.7rem; font-weight: 600; color: var(--accent-gold); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.5rem; }
.rc-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); line-height: 1.35; margin-bottom: 0.4rem; }
.rc-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }

@media (max-width: 768px) {
    /* Wide tables scroll inside their own box instead of overflowing the page.
       Most existing posts write <table> directly in .post-content with no
       wrapper, so scroll the table element itself; tables already inside a
       .table-scroll container are left alone, since the wrapper handles it. */
    .post-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .post-content .table-scroll table { display: table; }

    .post-hero { padding: 8rem 1.5rem 1.5rem; }
    .post-hero h1 { font-size: 2rem; }
    .post-content { padding: 1.5rem 1.5rem 3rem; }
    .post-content h2 { font-size: 1.35rem; }
    .post-content h3 { font-size: 1.15rem; }
    .post-content p, .post-content ul, .post-content ol { font-size: 1rem; }
    .related-posts { padding: 2rem 1.5rem 1rem; }
    .related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .post-hero { padding: 7rem 1rem 1rem; }
    .post-hero h1 { font-size: 1.65rem; }
    .post-content { padding: 1rem 1rem 2.5rem; }
    .post-bottom-nav { padding: 0 1rem 3rem; }
}

/* Byline. The team is the substantive attribution, so it stays visible next
   to the name rather than being folded into a tooltip. */
.post-author { font-size: 0.85rem; color: var(--text-muted); display: inline-flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.post-author .pa-name { color: var(--text-secondary); font-weight: 600; }
.post-author .pa-team { color: var(--text-muted); }
.post-author .pa-team::before { content: "\00b7"; margin-right: 0.4rem; }

/* Table of contents. Gives long posts jump targets for sitelinks and makes
   individual sections addressable for AI extraction. */
.post-toc { max-width: 100%; margin: 2rem 0; padding: 1.25rem 1.5rem; background: var(--bg-card); border: 1px solid var(--border-subtle); border-left: 3px solid var(--accent-gold); border-radius: 10px; }
.post-toc h2 { font-size: 0.75rem !important; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--accent-gold); margin: 0 0 0.85rem; }
.post-toc ol { margin: 0; padding-left: 1.25rem; }
.post-toc li { margin: 0.35rem 0; font-size: 0.95rem; }
.post-toc a { color: var(--text-secondary); text-decoration: none; overflow-wrap: anywhere; }
.post-toc a:hover { color: var(--accent-gold); text-decoration: underline; }

/* External references. */
.post-refs { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-subtle); }
.post-refs h2 { font-size: 1.15rem !important; margin-bottom: 0.75rem; }
.post-refs ul { margin: 0; padding-left: 1.25rem; }
.post-refs li { margin: 0.4rem 0; font-size: 0.95rem; color: var(--text-secondary); }
.post-refs a, .post-refs a:visited { color: var(--accent-gold); overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 2px; }
.post-refs a:hover { color: var(--accent-gold-light); }

/* Heading anchors must clear the fixed nav when jumped to. */
.post-content h2[id], .post-content h3[id] { scroll-margin-top: 6rem; }

@media (max-width: 768px) {
    .post-toc { padding: 1rem 1.15rem; }
    .post-toc li { font-size: 0.9rem; }
    .post-author { font-size: 0.8rem; }
}

/* Mobile/tablet performance (<=1024px), matching the other category sheets. */
@media (max-width: 1024px) {
    .post-toc, .post-refs, .post-author, .related-card, .related-card:hover {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        will-change: auto !important;
    }
}
