:root {
    --blog-bg: #f3f4f6;
    --blog-shell-bg: #f9fafb;
    --blog-card-bg: #ffffff;
    --blog-border: #e5e7eb;
    --blog-border-subtle: #e5e7eb;
    --blog-text: #020617;
    --blog-text-muted: #6b7280;
    --blog-accent: #16a34a;
    --blog-accent-soft: rgba(22, 163, 74, 0.08);
    --blog-accent-border: rgba(22, 163, 74, 0.35);
    --blog-link: #0f766e;
    --blog-radius-lg: 22px;
    --blog-radius-md: 14px;
    --blog-radius-pill: 999px;
    --blog-shadow-soft: 0 26px 60px rgba(15, 23, 42, 0.18);
    --blog-shadow-small: 0 16px 38px rgba(15, 23, 42, 0.12);
    --blog-max-width: 1120px;
}

/* ===== Base ===== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 52%),
        radial-gradient(circle at top right, rgba(22, 163, 74, 0.12), transparent 55%),
        var(--blog-bg);
    color: var(--blog-text);
    -webkit-font-smoothing: antialiased;
}

/* Wrapper */

.blog-shell {
    max-width: var(--blog-max-width);
    margin: 0 auto;
    padding: 3.2rem 1.5rem 3.4rem;
    position: relative;
}

.blog-hero-bg,
.post-hero-bg {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 75vw;
    max-width: var(--blog-max-width);
    height: 260px;
    border-radius: 32px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
    /* behind all content */
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
    opacity: 0.9;
    filter: saturate(1.05);
}

@media (min-height: 900px) {

    .blog-hero-bg,
    .post-hero-bg {
        height: 300px;
    }
}

@media (max-width: 768px) {

    .blog-hero-bg,
    .post-hero-bg {
        width: 100vw;
        border-radius: 0 0 24px 24px;
        height: 220px;
    }
}

/* Make header & top strip sit nicely in front of hero */
.blog-hero-wrapper {
    position: relative;
    margin-bottom: 2.4rem;
}

/* Slight extra top padding so content doesn't feel cramped against hero */
.blog-header {
    margin-bottom: 2rem;
}

/* Post hero wrapper (around header on post page) */
.post-hero-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.full-width-hero {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 80vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    /* stays behind entire site */
    filter: brightness(0.95) saturate(1.05);
}

/* Optional gradient overlay (for readability) */
.full-width-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to bottom,
            rgba(0, 0, 0, 0.55),
            rgba(0, 0, 0, 0.35),
            rgba(0, 0, 0, 0.28),
            rgba(0, 0, 0, 0.15)),
        rgba(0, 0, 0, 0.25);
    z-index: -1;
    mix-blend-mode: multiply;
}

.blog-hero-overlay {
    position: relative;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1.5rem;
}

/* Overlay area that sits ON the hero (post page) */
.post-hero-overlay {
    margin-top: 2rem;
    position: relative;
    /* min-height: 80vh; */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1.5rem;
}

/* Make header + top strip readable over hero */
.blog-header,
.blog-category-strip,
.post-main-header {
    position: relative;
    z-index: 1;
}

/* Add a subtle shadow to overlay text for readability */
.blog-header-title,
.blog-header-subtitle,
.blog-header-kicker,
.blog-category-chip,
.post-main-title,
.post-main-meta {
    text-shadow: 0 10px 25px rgba(15, 23, 42, 0.6);
}

/* After overlay, the main layout starts with some spacing */
.blog-main-layout {
    margin-top: 2.5rem;
}

/* Mobile tweaks */
@media (max-width: 768px) {
    /* .full-width-hero {
        height: 50vh;
    }

    .blog-hero-overlay,
    .post-hero-overlay {
        min-height: 50vh;
    } */

    .post-hero-overlay {
        margin-top: 4rem;
    }

    .blog-shell {
        padding: 2rem 1.25rem 3rem;
    }
}

/* Blog content container now needs spacing below hero
/* .blog-shell {
    padding-top: calc(60vh + 2rem);
} */

/* Mobile adjustments */
@media (max-width: 768px) {
    /* .full-width-hero {
        height: 50vh;
    }

    .blog-shell {
        padding-top: calc(50vh + 1.5rem);
    } */
}

/* ===== Breadcrumb ===== */

.blog-breadcrumb {
    font-size: 0.8rem;
    color: var(--blog-text-muted);
    margin-bottom: 1.2rem;
}

.blog-breadcrumb a {
    color: var(--blog-text-muted);
    text-decoration: none;
}

.blog-breadcrumb a:hover {
    text-decoration: underline;
}

.blog-breadcrumb span.sep {
    margin: 0 0.35rem;
    color: #d1d5db;
}

/* ===== Header / Title ===== */

.blog-header {
    margin-bottom: 2.4rem;
}

.blog-header-kicker {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--blog-text-muted);
    margin-bottom: 0.35rem;
}

.blog-header-title {
    font-size: clamp(2rem, 3.2vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 0.55rem;
}

.blog-header-title span.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--blog-accent);
    box-shadow: 0 0 18px rgba(22, 163, 74, 0.9);
}

.blog-header-subtitle {
    font-size: 0.96rem;
    /* color: var(--blog-text-muted); */
    color: #fff;
    max-width: 42rem;
    line-height: 1.65;
}

/* ===== Top category strip ===== */

.blog-category-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.blog-category-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blog-text-muted);
    margin-bottom: 0.3rem;
    width: 100%;
}

.blog-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.32rem 0.75rem;
    border-radius: var(--blog-radius-pill);
    background: #ffffff;
    border: 1px solid var(--blog-border);
    font-size: 0.78rem;
    color: var(--blog-text);
    text-decoration: none;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, border-color 0.12s ease-out;
}

.blog-category-chip span.dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--blog-accent);
}

.blog-category-chip small {
    font-size: 0.72rem;
    color: var(--blog-text-muted);
}

.blog-category-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(22, 163, 74, 0.6);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.13);
}

/* ===== Section labels ===== */

.section-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blog-text-muted);
    margin-bottom: 0.7rem;
}

/* ===== Featured post hero ===== */

.featured-post {
    margin-bottom: 2.4rem;
}

.featured-post-card {
    position: relative;
    background: radial-gradient(circle at top left, rgba(22, 163, 74, 0.08), #ffffff 55%);
    border-radius: var(--blog-radius-lg);
    padding: 1.8rem 1.8rem;
    border: 1px solid var(--blog-border);
    box-shadow: var(--blog-shadow-soft);
    overflow: hidden;
}

.featured-post-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr);
    gap: 1.5rem;
}

@media (min-width: 900px) {
    .featured-post-grid {
        grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.1fr);
    }
}

.featured-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.16rem 0.7rem;
    border-radius: var(--blog-radius-pill);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    background: var(--blog-accent-soft);
    color: var(--blog-accent);
    border: 1px solid var(--blog-accent-border);
    margin-bottom: 0.45rem;
}

.featured-pill span.dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--blog-accent);
}

.featured-post-title {
    margin: 0 0 0.4rem;
    font-size: 1.35rem;
}

.featured-post-title a {
    color: var(--blog-text);
    text-decoration: none;
}

.featured-post-title a:hover {
    text-decoration: underline;
}

.featured-post-excerpt {
    font-size: 0.95rem;
    color: var(--blog-text-muted);
    margin: 0 0 0.85rem;
}

.featured-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--blog-text-muted);
}

.featured-meta .category-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.6rem;
    border-radius: var(--blog-radius-pill);
    border: 1px solid var(--blog-border);
    background: #f9fafb;
}

/* Featured media (image / graphic) */

.featured-media {
    position: relative;
    border-radius: 20px;
    background: linear-gradient(135deg, #ecfdf3, #e0f2fe);
    border: 1px solid rgba(148, 163, 184, 0.5);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-media-placeholder {
    padding: 1.2rem 1.3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.featured-media-badge {
    display: inline-flex;
    padding: 0.18rem 0.6rem;
    border-radius: var(--blog-radius-pill);
    background: rgba(15, 23, 42, 0.08);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #0f172a;
}

.featured-media-highlight {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.6rem;
    color: #022c22;
}

/* ===== Post list ===== */

.post-list {
    margin-bottom: 2rem;
}

.post-list-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
}

@media (min-width: 768px) {
    .post-list-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.post-card {
    background: var(--blog-card-bg);
    border-radius: var(--blog-radius-lg);
    border: 1px solid var(--blog-border-subtle);
    box-shadow: var(--blog-shadow-small);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.16s ease-out, box-shadow 0.16s ease-out, border-color 0.16s ease-out;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 42px rgba(15, 23, 42, 0.18);
    border-color: rgba(148, 163, 184, 0.7);
}

/* Thumbnail */

.post-card-thumb {
    position: relative;
    height: 170px;
    background: linear-gradient(135deg, #ecfeff, #ecfdf3);
    border-bottom: 1px solid var(--blog-border);
    overflow: hidden;
}

.post-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-card-thumb-tag {
    display: inline-flex;
    padding: 0.1rem 0.55rem;
    border-radius: var(--blog-radius-pill);
    background: rgba(15, 23, 42, 0.06);
    font-size: 0.75rem;
    color: var(--blog-text);
}

/* Content */

.post-card-body {
    padding: 1rem 1.05rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.post-card-category {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blog-text-muted);
}

.post-card-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
}

.post-card-title a {
    color: var(--blog-text);
    text-decoration: none;
}

.post-card-title a:hover {
    text-decoration: underline;
}

.post-card-excerpt {
    font-size: 0.9rem;
    color: var(--blog-text-muted);
}

/* Footer */

.post-card-footer {
    margin-top: 0.35rem;
    padding: 0 1.05rem 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--blog-text-muted);
}

.post-card-footer .badge-status {
    padding: 0.1rem 0.6rem;
    border-radius: var(--blog-radius-pill);
    border: 1px solid #e5e7eb;
    background: #f9fafb;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.post-card-footer .read-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--blog-link);
    text-decoration: none;
}

.post-card-footer .read-link span.arrow {
    transition: transform 0.12s ease-out;
}

.post-card:hover .post-card-footer .read-link span.arrow {
    transform: translateX(2px);
}

/* ===== Single Post Layout ===== */

.post-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr);
    gap: 1.8rem;
}

@media (min-width: 940px) {
    .post-layout {
        grid-template-columns: minmax(0, 1.9fr) minmax(0, 1.1fr);
    }
}

.post-main {
    background: var(--blog-card-bg);
    border-radius: var(--blog-radius-lg);
    padding: 1.7rem 1.7rem 1.6rem;
    border: 1px solid var(--blog-border);
    box-shadow: var(--blog-shadow-soft);
}

.post-main-header {
    margin-bottom: 1.4rem;
}

.post-main-kicker {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blog-text-muted);
    margin-bottom: 0.4rem;
}

.post-main-title {
    font-size: clamp(1.7rem, 2.6vw, 2.1rem);
    letter-spacing: -0.03em;
    margin: 0 0 0.6rem;
}

.post-main-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--blog-text-muted);
}

.post-main-meta a {
    color: var(--blog-link);
    text-decoration: none;
}

.post-main-meta a:hover {
    text-decoration: underline;
}

/* Post hero image */

.post-hero-image {
    margin: 0 0 1.2rem;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--blog-border);
    background: linear-gradient(135deg, #e0f2fe, #ecfdf3);
}

.post-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Content styling (contentHtml) */

.post-body {
    font-size: 0.97rem;
    line-height: 1.7;
    color: var(--blog-text);
}

.post-body p {
    margin: 0 0 0.9rem;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
    margin-top: 1.4rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #111827;
}

.post-body h1 {
    font-size: 1.6rem;
}

.post-body h2 {
    font-size: 1.25rem;
}

.post-body h3 {
    font-size: 1.05rem;
}

.post-body ul,
.post-body ol {
    margin: 0.2rem 0 1rem;
    padding-left: 1.2rem;
}

.post-body li {
    margin-bottom: 0.25rem;
}

.post-body a {
    color: var(--blog-link);
    text-decoration: underline;
}

.post-body .note {
    padding: 0.8rem 0.9rem;
    border-radius: var(--blog-radius-md);
    background: #ecfdf3;
    border: 1px solid var(--blog-accent-border);
    font-size: 0.9rem;
}

/* Sidebar */

.post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.sidebar-block {
    background: var(--blog-card-bg);
    border-radius: var(--blog-radius-md);
    border: 1px solid var(--blog-border);
    padding: 1rem 1rem;
    box-shadow: var(--blog-shadow-small);
}

.sidebar-block h2 {
    margin: 0 0 0.65rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blog-text-muted);
}

.similar-posts ul,
.top-posts ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.similar-posts li,
.top-posts li {
    font-size: 0.9rem;
    margin-bottom: 0.55rem;
}

.similar-posts a,
.top-posts a {
    color: var(--blog-text);
    text-decoration: none;
}

.similar-posts a:hover,
.top-posts a:hover {
    text-decoration: underline;
}

.top-posts li {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
}

.top-posts span.views {
    font-size: 0.76rem;
    color: var(--blog-text-muted);
}

/* ===== Category Page ===== */

.category-header {
    margin-bottom: 1.8rem;
}

.category-header h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.6rem, 2.4vw, 2rem);
    letter-spacing: -0.03em;
}

.category-header p {
    margin: 0;
    font-size: 0.9rem;
    /* color: var(--blog-text-muted); */
}

/* ===== Pagination ===== */

.blog-pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.blog-pagination ul {
    list-style: none;
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.16rem;
    margin: 0;
    border-radius: var(--blog-radius-pill);
    background: #ffffff;
    border: 1px solid var(--blog-border);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.blog-pagination li a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--blog-radius-pill);
    font-size: 0.8rem;
    color: var(--blog-text-muted);
    text-decoration: none;
}

.blog-pagination li.active a {
    background: var(--blog-accent);
    color: #ffffff;
    font-weight: 600;
}

.blog-pagination li a:hover {
    background: var(--blog-accent-soft);
    color: var(--blog-text);
}

/* ===== Tiny utilities ===== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    border-radius: var(--blog-radius-pill);
    background: #eef2ff;
    color: #4338ca;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.post-card-footer-left {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.78rem;
    color: var(--blog-text-muted);
}

.post-card-footer-left span {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    opacity: 0.9;
}

.post-card-footer-left span::first-letter {
    text-transform: capitalize;
}

.blog-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(0, 0.9fr);
    gap: 2rem;
    align-items: flex-start;
}

@media (max-width: 960px) {
    .blog-main-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

.blog-main-column {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.blog-main-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(240px, auto);
    grid-auto-flow: dense;
    gap: 1.1rem;
}

@media (max-width: 768px) {
    .blog-main-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-auto-rows: auto;
    }
}

/* Card size variations */
.post-card--wide {
    grid-column: span 2;
}

.post-card--tall {
    grid-row: span 2;
}

/* Make sure tall cards are visually balanced */
.post-card--tall .post-card-thumb {
    height: 190px;
}

.post-card--wide .post-card-thumb {
    height: 180px;
}

@media (max-width: 768px) {

    .post-card--wide,
    .post-card--tall {
        grid-column: span 1;
        grid-row: span 1;
    }
}

.sidebar-trending-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-trending-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.7rem;
    font-size: 0.9rem;
    margin-bottom: 0.55rem;
}

.sidebar-trending-list a {
    color: var(--blog-text);
    text-decoration: none;
}

.sidebar-trending-list a:hover {
    text-decoration: underline;
}

.sidebar-trending-list .views {
    font-size: 0.76rem;
    color: var(--blog-text-muted);
}

/* CTA block */
.sidebar-cta p {
    font-size: 0.9rem;
    color: var(--blog-text-muted);
    margin: 0 0 0.7rem;
}

.sidebar-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.1rem;
    border-radius: var(--blog-radius-pill);
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(22, 163, 74, 0.3);
    margin-bottom: 0.4rem;
    transition: transform 0.14s ease-out, box-shadow 0.14s ease-out;
}

.sidebar-cta-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(22, 163, 74, 0.4);
}

.sidebar-cta-footnote {
    font-size: 0.76rem;
    color: var(--blog-text-muted);
    margin: 0;
}

/* ============================
   POST BODY — IMAGE HANDLING
   ============================ */

.post-body img {
    max-width: 100%;
    /* never overflow container */
    width: 100%;
    /* scale fluidly */
    height: auto;
    /* keep aspect ratio */
    border-radius: 14px;
    /* default modern style */
    margin: 1.5rem 0;
    /* breathing room */
    display: block;
    /* avoids inline gaps */
    object-fit: cover;
    /* trims weird aspect ratios */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* If someone pastes an image with inline size attributes */
.post-body img[width],
.post-body img[height] {
    height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Responsive cleanup */
@media (max-width: 600px) {
    .post-body img {
        border-radius: 10px;
        margin: 1.2rem 0;
    }
}

.post-body figure {
    margin: 2rem 0;
    text-align: center;
}

.post-body figcaption {
    margin-top: 0.6rem;
    font-size: 0.85rem;
    color: var(--blog-text-muted);
}

/* ============================
   POST BODY — TYPOGRAPHY
   ============================ */

.post-body {
    font-size: 0.97rem;
    line-height: 1.7;
    color: var(--blog-text);
}

/* Headings inside content */
.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4 {
    margin-top: 1.6rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: #111827;
}

.post-body h1 {
    font-size: 1.5rem;
}

.post-body h2 {
    font-size: 1.28rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.55);
    padding-bottom: 0.25rem;
}

.post-body h3 {
    font-size: 1.08rem;
}

.post-body h4 {
    font-size: 0.98rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

/* Paragraphs & spacing */
.post-body p {
    margin: 0 0 0.9rem;
}

/* Lists */
.post-body ul,
.post-body ol {
    margin: 0.3rem 0 1rem;
    padding-left: 1.25rem;
}

.post-body li {
    margin-bottom: 0.25rem;
}

/* Blockquotes */
.post-body blockquote {
    margin: 1.3rem 0;
    padding: 0.95rem 1.1rem;
    border-left: 3px solid var(--blog-accent);
    background: #f9fafb;
    border-radius: 10px;
    color: #374151;
    font-size: 0.95rem;
    font-style: italic;
}

/* Inline code */
.post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.86rem;
    background: #0f172a0d;
    padding: 0.12rem 0.32rem;
    border-radius: 6px;
}

/* Code blocks */
.post-body pre {
    margin: 1.2rem 0;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    background: #020617;
    color: #e5e7eb;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
}

.post-body pre code {
    background: transparent;
    padding: 0;
}

/* ============================
   POST TOC (TABLE OF CONTENTS)
   ============================ */

.post-toc-block {
    /* position: sticky; */
    top: 1.2rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

#postToc {
    font-size: 0.86rem;
    color: var(--blog-text-muted);
}

#postTocList {
    list-style: none;
    margin: 0;
    padding: 0;
}

#postTocList li {
    margin-bottom: 0.32rem;
}

#postTocList li a {
    color: var(--blog-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

#postTocList li a:hover {
    color: var(--blog-link);
    text-decoration: underline;
}

/* Indent h3 under h2 */
#postTocList li.toc-level-2 {
    padding-left: 0;
}

#postTocList li.toc-level-3 {
    padding-left: 0.9rem;
    font-size: 0.82rem;
}

/* Dot before each item */
#postTocList li a::before {
    content: "•";
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ============================
   SCROLL PROGRESS BAR
   ============================ */

.blog-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, #22c55e, #16a34a, #0ea5e9);
    z-index: 9999;
    transform-origin: left center;
}

/* ======================================
   HERO OVERLAY TEXT COLORS (INDEX + POST)
   ====================================== */

/* Breadcrumb over hero */
.blog-breadcrumb,
.blog-breadcrumb a,
.blog-breadcrumb span {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.blog-breadcrumb a:hover {
    color: rgba(255, 255, 255, 1);
    text-decoration: underline;
}

/* Index hero – kicker */
.blog-header-kicker, .category-header {
    color: rgba(255, 255, 255, 0.85);
}

/* Index hero – title */
.blog-header-title {
    color: #ffffff;
}

/* Index hero – subtitle */
.blog-header-subtitle,
.blog-category-label {
    color: rgba(255, 255, 255, 0.90);
    font-weight: 400;
}

/* Top categories ON hero */
/* .blog-category-chip {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
}

.blog-category-chip small {
    color: rgba(255, 255, 255, 0.85);
} */

/* Dot color on hero */
/* .blog-category-chip .dot,
.blog-header-title .dot {
    background: #ffffff;
} */

/* POST PAGE hero – kicker */
.post-main-header .post-main-kicker {
    color: rgba(255, 255, 255, 0.85);
}

/* POST PAGE hero – title */
.post-main-header .post-main-title {
    color: #ffffff;
}

/* POST PAGE hero – meta (date, category, reads) */
.post-main-header .post-main-meta,
.post-main-header .post-main-meta a {
    color: rgba(255, 255, 255, 0.88);
}

.post-main-header .post-main-meta a:hover {
    color: rgba(255, 255, 255, 1);
    text-decoration: underline;
}

/* Subtle text shadow for readability */
.blog-header *,
.post-main-header * {
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}

.blog-shell--on-hero .blog-site-header {
    color: rgba(255, 255, 255, 0.9);
}

.blog-site-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.4rem;
}

/* Logo */
.blog-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
}

.blog-logo img {
    height: 26px;
    width: auto;
    display: block;
}

.blog-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.blog-logo-text .name {
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.blog-logo-text .tagline {
    font-size: 0.78rem;
    opacity: 0.8;
}

/* Default colors (non-hero pages) */
.blog-site-header,
.blog-site-header a {
    color: var(--blog-text);
}

/* On hero pages, override to white-ish */
.blog-shell--on-hero .blog-site-header,
.blog-shell--on-hero .blog-site-header a {
    color: rgba(255, 255, 255, 0.92);
}

.blog-shell--on-hero .blog-logo-text .tagline {
    opacity: 0.85;
}

/* Simple nav links */
.blog-site-nav {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.86rem;
}

.blog-site-nav a {
    text-decoration: none;
    opacity: 0.9;
}

.blog-site-nav a:hover {
    text-decoration: underline;
    opacity: 1;
}

/* Demo CTA chip */
.blog-site-nav .nav-cta {
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    font-size: 0.82rem;
}

.blog-shell--on-hero .blog-site-nav .nav-cta {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(6px);
}

/* ============================
   SITE FOOTER (BLOG)
   ============================ */

.blog-footer {
    margin-top: 3rem;
    padding-top: 1.8rem;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    font-size: 0.85rem;
    color: var(--blog-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    align-items: flex-start;
    justify-content: space-between;
}

.blog-footer-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.blog-footer-logo img {
    height: 22px;
    width: auto;
    display: block;
}

.blog-footer-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.blog-footer-text strong {
    font-size: 0.88rem;
    color: var(--blog-text);
}

.blog-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.blog-footer-links a {
    color: var(--blog-text-muted);
    text-decoration: none;
}

.blog-footer-links a:hover {
    color: var(--blog-link);
    text-decoration: underline;
}

.blog-footer-meta {
    width: 100%;
    margin-top: 0.6rem;
    font-size: 0.78rem;
    opacity: 0.85;
}

@media (max-width: 640px) {
    .blog-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   FULL-WIDTH GLOBAL HEADER (ALWAYS AT TOP)
   ============================================ */

.blog-site-header-global {
    position: absolute;
    /* over hero on index/post */
    top: 0;
    left: 0;
    width: 100vw;
    padding: 0.8rem 0;
    z-index: 10;
    /* always above hero and content */
    pointer-events: none;
    /* allows hero scroll events to pass through */
    background: #fff;
}

.blog-site-header-inner {
    width: 100%;
    max-width: var(--blog-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;

    display: flex;
    align-items: center;
    justify-content: space-between;

    pointer-events: auto;
    /* clickable components */
}

/* Logo + brand */
.blog-logo {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
}

.blog-logo img {
    height: 28px;
    width: auto;
}

.blog-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.blog-logo-text .name {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.blog-logo-text .tagline {
    font-size: 0.68rem;
    opacity: 0.85;
}

/* Nav */
.blog-site-nav {
    display: flex;
    gap: 1rem;
    font-size: 0.86rem;
}

.blog-site-nav a {
    text-decoration: none;
    font-weight: 400;
}

/* CTA */
.nav-cta {
    padding: 0.32rem 0.85rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 0.8rem;
}

/* ============================================
   COLOR MODES — LIGHT VS HERO OVERLAY
   ============================================ */

/* Default mode (category pages, no hero underneath) */
.blog-site-header-global,
.blog-site-header-global a {
    color: var(--blog-text);
}

/* When on hero-based pages, add this class to blog-shell */
.blog-shell--on-hero~.blog-site-header-global,
.blog-site-header-global.on-hero,
.blog-shell--on-hero+.blog-site-header-global a {
    color: rgba(255, 255, 255, 0.92);
}

.blog-shell--on-hero+.blog-site-header-global .nav-cta {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
}