.ec-blog-page,
.ec-blog-article {
    --ec-green: #0d3028;
    --ec-green-soft: #2f6f5f;
    --ec-lime: #e7ec3b;
    --ec-cream: #fbfcf6;
    --ec-line: #dfe8dc;
    --ec-muted: #5f6c67;
    --ec-white: #ffffff;
    color: var(--ec-green);
    font-family: inherit;
    margin: 0 auto;
    max-width: 1240px;
    padding: clamp(28px, 5vw, 72px) 20px;
}

.ec-blog-page *,
.ec-blog-article * {
    box-sizing: border-box;
}

/* ============ HERO (listing + archive) ============ */

.ec-blog-hero {
    background: var(--ec-cream);
    border: 1px solid rgba(13, 48, 40, 0.08);
    border-radius: 0 0 56px 56px;
    margin: 0 0 clamp(28px, 5vw, 48px);
    padding: clamp(40px, 8vw, 92px) clamp(20px, 6vw, 72px);
    text-align: center;
}

.ec-blog-kicker {
    color: var(--ec-green-soft);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 14px;
    text-transform: uppercase;
}

.ec-blog-hero h1 {
    color: var(--ec-green);
    font-size: clamp(2.35rem, 5.6vw, 5.6rem);
    font-weight: 800;
    line-height: 1;
    margin: 0 auto;
    max-width: 980px;
}

.ec-blog-sub {
    color: var(--ec-muted);
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.75;
    margin: 26px auto 0;
    max-width: 1020px;
}

/* ============ CATEGORY FILTER BAR ============ */

.ec-blog-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 28px;
}

.ec-blog-cat {
    background: var(--ec-white);
    border: 1px solid rgba(13, 48, 40, 0.22);
    border-radius: 999px;
    color: var(--ec-green);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.1;
    min-height: 42px;
    padding: 11px 16px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.ec-blog-cat:hover,
.ec-blog-cat:focus-visible {
    border-color: var(--ec-green-soft);
    outline: none;
}

.ec-blog-cat.is-active {
    background: var(--ec-lime);
    border-color: var(--ec-lime);
    color: var(--ec-green);
}

/* ============ FEATURED POST ============ */

.ec-blog-featured {
    background: var(--ec-white);
    border: 1px solid var(--ec-line);
    border-radius: 8px;
    box-shadow: 0 16px 38px rgba(13, 48, 40, 0.08);
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 0;
    margin: 0 0 32px;
    overflow: hidden;
}

.ec-blog-featured-media {
    aspect-ratio: 16 / 10;
    background: #eef3ed;
    display: block;
    overflow: hidden;
}

.ec-blog-featured-media img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.ec-blog-featured-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: center;
    padding: clamp(24px, 3vw, 40px);
}

.ec-blog-featured-title {
    color: var(--ec-green);
    font-size: clamp(1.5rem, 2.4vw, 2.2rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.ec-blog-featured-title a {
    color: inherit;
    text-decoration: none;
}

.ec-blog-featured-title a:hover {
    color: var(--ec-green-soft);
}

.ec-blog-featured-excerpt {
    color: var(--ec-muted);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

.ec-blog-read {
    color: var(--ec-green);
    font-weight: 800;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ec-blog-read:hover {
    color: var(--ec-green-soft);
}

.ec-blog-read span {
    transition: transform 160ms ease;
}

.ec-blog-read:hover span {
    transform: translateX(2px);
}

/* ============ POST GRID ============ */

.ec-blog-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ec-blog-grid--related {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ec-blog-card {
    background: var(--ec-white);
    border: 1px solid var(--ec-line);
    border-radius: 8px;
    box-shadow: 0 16px 38px rgba(13, 48, 40, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ec-blog-card-media {
    aspect-ratio: 16 / 10;
    background: #eef3ed;
    display: block;
    overflow: hidden;
}

.ec-blog-card-media img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
    transition: transform 240ms ease;
}

.ec-blog-card:hover .ec-blog-card-media img {
    transform: scale(1.02);
}

.ec-blog-image-placeholder {
    align-items: center;
    color: rgba(13, 48, 40, 0.62);
    display: flex;
    font-size: 0.92rem;
    font-weight: 800;
    height: 100%;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.ec-blog-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px;
}

.ec-blog-card-title {
    color: var(--ec-green);
    font-size: clamp(1.08rem, 1.45vw, 1.3rem);
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
}

.ec-blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.ec-blog-card-title a:hover {
    color: var(--ec-green-soft);
}

.ec-blog-card-excerpt {
    color: var(--ec-muted);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* ============ TAGS & META ============ */

.ec-blog-tag {
    background: rgba(231, 236, 59, 0.38);
    border-radius: 999px;
    color: var(--ec-green);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.1;
    padding: 7px 12px;
    text-decoration: none;
    align-self: flex-start;
}

.ec-blog-tag:hover {
    background: var(--ec-lime);
}

.ec-blog-meta {
    color: var(--ec-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============ PAGINATION ============ */

.ec-blog-pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: clamp(36px, 5vw, 56px) 0 0;
}

.ec-blog-pagination-item a,
.ec-blog-pagination-item span {
    align-items: center;
    background: var(--ec-white);
    border: 1px solid var(--ec-line);
    border-radius: 999px;
    color: var(--ec-green);
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 700;
    justify-content: center;
    min-height: 42px;
    min-width: 42px;
    padding: 0 14px;
    text-decoration: none;
    transition: background 160ms ease, border-color 160ms ease;
}

.ec-blog-pagination-item a:hover {
    border-color: var(--ec-green-soft);
}

.ec-blog-pagination-item .current {
    background: var(--ec-lime);
    border-color: var(--ec-lime);
}

/* ============ EMPTY STATE ============ */

.ec-blog-empty {
    background: var(--ec-cream);
    border: 1px dashed rgba(13, 48, 40, 0.24);
    border-radius: 8px;
    margin: 26px 0 0;
    padding: clamp(24px, 4vw, 40px);
    text-align: center;
}

.ec-blog-empty h2 {
    color: var(--ec-green);
    font-size: clamp(1.35rem, 2vw, 2rem);
    margin: 0 0 10px;
}

.ec-blog-empty p {
    color: var(--ec-muted);
    margin: 0 auto;
    max-width: 680px;
}

/* ============ CTA STRIP ============ */

.ec-blog-cta {
    align-items: center;
    background: var(--ec-green);
    border-radius: 8px;
    color: var(--ec-white);
    display: grid;
    gap: 24px;
    grid-template-columns: 1fr auto;
    margin-top: clamp(42px, 7vw, 82px);
    padding: clamp(26px, 5vw, 46px);
}

.ec-blog-cta h2 {
    color: var(--ec-white);
    font-size: clamp(1.45rem, 2.6vw, 2.4rem);
    line-height: 1.15;
    margin: 0;
    max-width: 780px;
}

.ec-blog-cta-kicker {
    color: var(--ec-lime);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 12px;
    text-transform: uppercase;
}

.ec-blog-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.ec-blog-button {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.94rem;
    font-weight: 800;
    justify-content: center;
    line-height: 1.1;
    min-height: 48px;
    padding: 14px 22px;
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.ec-blog-button:hover,
.ec-blog-button:focus-visible {
    outline: none;
    transform: translateY(-1px);
}

.ec-blog-button-primary {
    background: var(--ec-lime);
    color: var(--ec-green);
}

.ec-blog-button-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.72);
    color: var(--ec-white);
}

/* ============ SINGLE POST ============ */

.ec-blog-article {
    max-width: 820px;
    padding-bottom: 0;
    padding-top: clamp(120px, 14vw, 160px);
}

@media (max-width: 767px) {
    .ec-blog-article {
        padding-top: clamp(96px, 22vw, 130px);
    }
}

.ec-blog-breadcrumb {
    align-items: center;
    color: var(--ec-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.85rem;
    font-weight: 600;
    gap: 6px;
    margin: 0 0 28px;
}

.ec-blog-breadcrumb a {
    color: var(--ec-green-soft);
    text-decoration: none;
}

.ec-blog-breadcrumb a:hover {
    color: var(--ec-green);
}

.ec-blog-breadcrumb-current {
    color: var(--ec-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ec-blog-article-header {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 28px;
}

.ec-blog-article-title {
    color: var(--ec-green);
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
}

.ec-blog-byline {
    align-items: center;
    color: var(--ec-muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 0.92rem;
    gap: 10px;
}

.ec-blog-avatar {
    border-radius: 50%;
}

.ec-blog-byline-name {
    color: var(--ec-green);
    font-weight: 700;
}

.ec-blog-article-hero {
    aspect-ratio: 16 / 9;
    background: #eef3ed;
    border-radius: 8px;
    margin: 0 0 36px;
    overflow: hidden;
    position: relative;
}

.ec-blog-article-hero img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.ec-blog-article-hero figcaption {
    background: rgba(13, 48, 40, 0.78);
    bottom: 0;
    color: var(--ec-white);
    font-size: 0.82rem;
    left: 0;
    padding: 10px 16px;
    position: absolute;
    right: 0;
}

/* Article body typography — applied to the post content rendered after our header. */
.ec-blog-article + *,
.single-post .entry-content {
    font-size: 17px;
    line-height: 1.7;
}

.single-post .entry-content h2,
.single-post .entry-content h3 {
    color: var(--ec-green);
    font-weight: 800;
    line-height: 1.25;
    margin-top: 2em;
    margin-bottom: 0.6em;
    scroll-margin-top: 100px;
}

.single-post .entry-content h2 {
    font-size: clamp(1.45rem, 2.4vw, 1.9rem);
}

.single-post .entry-content h3 {
    font-size: clamp(1.2rem, 1.8vw, 1.45rem);
}

.single-post .entry-content p,
.single-post .entry-content ul,
.single-post .entry-content ol,
.single-post .entry-content blockquote {
    margin: 0 0 1.2em;
}

.single-post .entry-content img {
    border-radius: 8px;
    height: auto;
    max-width: 100%;
}

.single-post .entry-content blockquote {
    border-left: 4px solid var(--ec-lime);
    color: var(--ec-green);
    font-size: 1.05em;
    font-style: italic;
    margin: 28px 0;
    padding: 4px 0 4px 22px;
}

.single-post .entry-content a {
    color: var(--ec-green-soft);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.single-post .entry-content a:hover {
    color: var(--ec-green);
}

/* ============ TABLE OF CONTENTS ============ */

.ec-blog-toc {
    background: var(--ec-cream);
    border: 1px solid var(--ec-line);
    border-radius: 8px;
    margin: 0 0 32px;
    padding: 20px 24px;
}

.ec-blog-toc-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--ec-green);
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    justify-content: space-between;
    padding: 0;
    text-transform: uppercase;
    width: 100%;
}

.ec-blog-toc-chevron {
    transition: transform 160ms ease;
}

.ec-blog-toc[data-collapsed="true"] .ec-blog-toc-chevron {
    transform: rotate(-90deg);
}

.ec-blog-toc-list {
    color: var(--ec-green);
    display: grid;
    gap: 8px;
    list-style: decimal;
    margin: 16px 0 0;
    padding-left: 22px;
}

.ec-blog-toc-list a {
    color: var(--ec-green);
    font-weight: 600;
    text-decoration: none;
}

.ec-blog-toc-list a:hover {
    color: var(--ec-green-soft);
}

.ec-blog-toc[data-collapsed="true"] .ec-blog-toc-list {
    display: none;
}

/* ============ AUTHOR BIO ============ */

.ec-blog-author {
    align-items: flex-start;
    background: var(--ec-cream);
    border: 1px solid var(--ec-line);
    border-radius: 8px;
    display: grid;
    gap: 20px;
    grid-template-columns: 80px 1fr;
    margin: 48px 0 0;
    padding: 24px;
}

.ec-blog-author-avatar {
    border-radius: 50%;
    height: 80px;
    width: 80px;
}

.ec-blog-author-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ec-blog-author-name {
    color: var(--ec-green);
    font-size: 1.05rem;
    font-weight: 800;
    margin: 0;
}

.ec-blog-author-bio {
    color: var(--ec-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.ec-blog-author-link {
    color: var(--ec-green-soft);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.ec-blog-author-link:hover {
    color: var(--ec-green);
}

/* ============ RELATED POSTS ============ */

.ec-blog-related {
    margin: 56px 0 0;
}

.ec-blog-related-title {
    color: var(--ec-green);
    font-size: clamp(1.4rem, 2.2vw, 1.85rem);
    font-weight: 800;
    margin: 0 0 24px;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1199px) {
    .ec-blog-featured {
        grid-template-columns: 1fr;
    }
    .ec-blog-grid--related {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .ec-blog-cta {
        grid-template-columns: 1fr;
    }
    .ec-blog-cta-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .ec-blog-grid {
        grid-template-columns: 1fr;
    }
    .ec-blog-grid--related {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .ec-blog-page,
    .ec-blog-article {
        padding: 24px 14px 48px;
    }
    .ec-blog-hero {
        border-radius: 0 0 34px 34px;
        padding: 38px 18px;
    }
    .ec-blog-author {
        grid-template-columns: 1fr;
        text-align: left;
    }
    .ec-blog-cta-actions,
    .ec-blog-button {
        width: 100%;
    }
}
