/* ─────────────────────────────────────────────────────────────
 * Civi Blog — career-style article + archive stylesheet
 * Used by: single.php, archive.php, index.php and the templates
 * under templates/post/ and templates/archive/.
 *
 * All colours pull from CSS variables. --blog-accent inherits the
 * theme accent if defined (--civi-color-accent), else falls back.
 * ───────────────────────────────────────────────────────────── */

:root {
    --blog-accent: var(--civi-color-accent, #4d4ed4);
    --blog-accent-strong: var(--civi-color-accent-hover, #3a3bb0);
    --blog-text: #111111;
    --blog-text-soft: #374151;
    --blog-muted: #6b7280;
    --blog-muted-soft: #9ca3af;
    --blog-border: #e5e7eb;
    --blog-border-soft: #f3f4f6;
    --blog-bg: #ffffff;
    --blog-bg-soft: #f9fafb;
    --blog-radius: 12px;
    --blog-radius-sm: 6px;
    --blog-radius-md: 8px;
    --blog-radius-lg: 16px;
    --blog-shadow: 0 4px 14px rgba(0, 0, 0, .06);
    --blog-shadow-soft: 0 2px 8px rgba(0, 0, 0, .04);
    /* Offset the sticky sidebar lives below. Matches the fixed theme
     * header (~80px) so the sidebar doesn't hide behind it on scroll. */
    --blog-sticky-top: 96px;
}
body.admin-bar { --blog-sticky-top: 128px; } /* +32px for WP admin bar */

/* Wrappers — neutralise any theme card around the blog content area.
 * Slightly off-white page bg so the white cards visibly pop. The top
 * padding is zeroed (overriding the theme's default .main-content
 * padding-top: 50px) so the breadcrumb sits flush under the header,
 * matching the jobs page treatment. */
.content-blog { padding-top: 0 !important; padding-bottom: 64px; background: var(--blog-bg-soft); }
.content-blog .site-layout.no-sidebar #primary { width: 100%; max-width: 100%; }

/* Breadcrumb spacing — the theme already gives .civi_breadcrumb a
 * 24px top/bottom margin via .single-jobs / .single-company /
 * .single-candidate selectors, but those don't match blog pages
 * (body.single-post, body.home, body.archive). Mirror that here so
 * the blog breadcrumb has the same breathing room as on jobs. */
.content-blog .container-breadcrumb .civi_breadcrumb,
.content-blog .container-breadcrumb #page-breadcrumb {
    margin-top: 24px;
    margin-bottom: 24px;
}

/* ═════════════════════════════════════════════════════════════
 * ARCHIVE / LANDING
 * ═══════════════════════════════════════════════════════════ */

.civi-blog-hero {
    text-align: center;
    padding: 7px 24px 4px;
    margin-bottom: 56px;
}
.civi-blog-hero-eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--blog-accent);
    margin: 0 0 16px;
}
.civi-blog-hero-title {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--blog-text);
    margin: 0 0 16px;
    line-height: 1.08;
}
.civi-blog-hero-desc {
    font-size: 18px;
    color: var(--blog-muted);
    margin: 0 auto;
    max-width: 640px;
    line-height: 1.6;
}

/* Category pill filter row — horizontal scroll, no wrap.
 * Pills stay on a single row and the user can swipe / scroll sideways
 * on narrow screens. Soft fade on the right edge hints at more content. */
.civi-blog-cat-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    margin: 24px 0 0;
    padding: 0 24px;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 32px), transparent 100%);
}
.civi-blog-cat-row::-webkit-scrollbar { display: none; }
.civi-blog-cat-row li { margin: 0; flex: 0 0 auto; scroll-snap-align: start; }
.civi-blog-cat-row a {
    display: inline-block;
    padding: 7px 16px;
    background: var(--blog-bg-soft);
    border: 1px solid var(--blog-border);
    border-radius: 999px;
    color: var(--blog-text-soft);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .15s, color .15s, border-color .15s;
}
.civi-blog-cat-row a:hover,
.civi-blog-cat-row a.is-active {
    background: var(--blog-accent);
    color: #fff;
    border-color: var(--blog-accent);
}

/* Archive / home 2-column layout: feed + latest-jobs sidebar.
 * Hero + featured story stay full-width above this. The sticky behaviour
 * lives on .civi-article-sidebar-block (the inner box), not on the aside —
 * see the single-post layout above for why. */
.civi-blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    /* default align-items: stretch */
}
.civi-blog-layout-main { min-width: 0; }

/* Card grid */
.civi-blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px 28px;
}
.civi-blog-card {
    display: flex;
    flex-direction: column;
    background: var(--blog-bg);
    border-radius: var(--blog-radius);
    overflow: hidden;
    transition: transform .2s;
}
.civi-blog-card:hover { transform: translateY(-3px); }
.civi-blog-card-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--blog-radius);
    background: var(--blog-bg-soft);
}
.civi-blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    transition: transform .35s;
}
.civi-blog-card:hover .civi-blog-card-image img { transform: scale(1.04); }
.civi-blog-card-body { padding: 18px 0 0; display: flex; flex-direction: column; gap: 10px; }
.civi-blog-card-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--blog-accent);
    text-decoration: none;
    align-self: flex-start;
}
.civi-blog-card-category:hover { color: var(--blog-accent-strong); text-decoration: underline; }
.civi-blog-card-title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    letter-spacing: -.01em;
}
.civi-blog-card-title a {
    color: var(--blog-text);
    text-decoration: none;
    background-image: linear-gradient(var(--blog-accent), var(--blog-accent));
    background-size: 0 1.5px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size .25s, color .15s;
}
.civi-blog-card-title a:hover {
    background-size: 100% 1.5px;
    color: var(--blog-accent);
}
.civi-blog-card-excerpt {
    color: var(--blog-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.civi-blog-card-meta {
    margin-top: 4px;
    font-size: 12px;
    color: var(--blog-muted-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.civi-blog-card-meta-sep { color: var(--blog-muted-soft); }

/* Featured top story — large 2-column editorial card */
.civi-blog-featured {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 48px;
    margin-bottom: 72px;
    align-items: center;
}
.civi-blog-featured .civi-blog-card-image { aspect-ratio: 4 / 3; border-radius: var(--blog-radius-lg); }
.civi-blog-featured .civi-blog-card-body { padding: 0; gap: 14px; }
.civi-blog-featured-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--blog-muted);
    margin: 0;
}
.civi-blog-featured .civi-blog-card-title { font-size: 32px; line-height: 1.18; font-weight: 800; letter-spacing: -.02em; }
.civi-blog-featured .civi-blog-card-excerpt { display: none; }
.civi-blog-featured-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    align-self: flex-start;
    color: var(--blog-accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    transition: gap .15s, color .15s;
}
.civi-blog-featured-cta:hover { color: var(--blog-accent-strong); gap: 12px; }
.civi-blog-featured-cta-arrow { display: inline-block; transition: transform .15s; }
.civi-blog-featured-cta:hover .civi-blog-featured-cta-arrow { transform: translateX(2px); }

/* Section heading row (Latest articles / Most read / etc.) */
.civi-blog-section { margin-bottom: 24px; }
.civi-blog-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--blog-border);
}
.civi-blog-section-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--blog-text);
    margin: 0;
}
.civi-blog-section-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--blog-muted-soft);
    font-weight: 500;
}

/* Avatar in card meta (used by featured + future variants) */
.civi-blog-card-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}
.civi-blog-card-author { color: var(--blog-text-soft); font-weight: 600; }

/* Gradient placeholder for posts without a featured image. Shows the
 * title's first letter on an accent-tinted gradient — more pleasant
 * than the broken "no-image.jpg" file. */
.civi-blog-card-image--placeholder {
    background: linear-gradient(135deg, var(--blog-accent) 0%, var(--blog-accent-strong) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.civi-blog-card-image--placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .12) 0, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(0, 0, 0, .15) 0, transparent 40%);
}
.civi-blog-card-placeholder-letter {
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, .55);
    font-size: 96px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.04em;
}
.civi-blog-featured .civi-blog-card-placeholder-letter { font-size: 140px; }

/* Magazine feed: vertical stack with boxed list rows and an
 * occasional wider "feature" row every Nth item. */
.civi-blog-feed { display: flex; flex-direction: column; gap: 12px; }
.civi-blog-list { display: flex; flex-direction: column; gap: 12px; } /* legacy alias */

/* List row — image left, content right, subtle white box */
.civi-blog-list-item {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-md);
    overflow: hidden;
    box-shadow: var(--blog-shadow-soft);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.civi-blog-list-item:hover {
    border-color: var(--blog-accent);
    box-shadow: var(--blog-shadow);
    transform: translateY(-1px);
}
/* Image stretches to fill the full row height (matching the body's
 * content height) instead of being locked to a 4/3 box that leaves
 * grey space below when the excerpt makes the row taller. */
.civi-blog-list-item .civi-blog-card-image {
    border-radius: 0;
    aspect-ratio: auto;
    height: 100%;
    min-height: 210px;
}
.civi-blog-list-item .civi-blog-card-image img { height: 100%; object-fit: fill; }
.civi-blog-list-item .civi-blog-card-body { padding: 20px 24px; gap: 10px; align-self: center; }
.civi-blog-list-item .civi-blog-card-title { font-size: 20px; }

/* Feature break — every 6th item renders as a vertical "grid card"
 * (image on top, content below) so it visually reads as a tile rather
 * than a stretched horizontal list row. */
.civi-blog-feed-feature {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-md);
    overflow: hidden;
    box-shadow: var(--blog-shadow-soft);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.civi-blog-feed-feature:hover {
    border-color: var(--blog-accent);
    box-shadow: var(--blog-shadow);
    transform: translateY(-2px);
}
.civi-blog-feed-feature .civi-blog-card-image { aspect-ratio: 21 / 9; border-radius: 0; height: auto; min-height: 0; }
/* Use cover on the feature card — `fill` was squashing wide photos
 * into a 21:9 banner and the people looked stretched. Cover crops
 * cleanly to the banner shape without distortion. */
.civi-blog-feed-feature .civi-blog-card-image img { height: 100%; width: 100%; object-fit: cover; }
.civi-blog-feed-feature .civi-blog-card-body { padding: 14px 18px; gap: 8px; }
.civi-blog-feed-feature .civi-blog-card-title { font-size: 18px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.civi-blog-feed-feature .civi-blog-card-excerpt { display: none; }

/* AJAX Load-more button */
.civi-blog-load-more-wrap {
    display: flex;
    justify-content: center;
    margin: 40px 0 0;
}
.civi-blog-load-more {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding: 12px 28px;
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: 999px;
    color: var(--blog-text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .01em;
    box-shadow: var(--blog-shadow-soft);
    transition: background .15s, color .15s, border-color .15s, transform .15s;
    font-family: inherit;
}
.civi-blog-load-more:hover:not(:disabled) {
    background: var(--blog-accent);
    border-color: var(--blog-accent);
    color: #fff;
    transform: translateY(-1px);
}
.civi-blog-load-more:disabled { opacity: .65; cursor: wait; }

/* Pagination */
.civi-blog-pagination {
    display: flex;
    justify-content: center;
    margin-top: 48px;
}
.civi-blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    margin: 0 3px;
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-sm);
    color: var(--blog-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    background: var(--blog-bg);
    transition: border-color .15s, color .15s, background .15s;
}
.civi-blog-pagination .page-numbers:hover { border-color: var(--blog-accent); color: var(--blog-accent); }
.civi-blog-pagination .page-numbers.current,
.civi-blog-pagination .current {
    background: var(--blog-accent);
    border-color: var(--blog-accent);
    color: #fff;
}

/* Empty state */
.civi-blog-empty {
    text-align: center;
    padding: 64px 24px;
    color: var(--blog-muted);
}
.civi-blog-empty h2 { color: var(--blog-text); font-size: 22px; margin: 0 0 10px; }

/* ═════════════════════════════════════════════════════════════
 * SINGLE POST (article page)
 * ═══════════════════════════════════════════════════════════ */

.civi-article {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
}
.civi-article-header { padding: 18px 0 14px; text-align: left; }
.civi-article-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--blog-accent);
    text-decoration: none;
    margin-bottom: 10px;
}
.civi-article-category:hover { color: var(--blog-accent-strong); }
.civi-article-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.2;
    color: var(--blog-text);
    margin: 0 0 14px;
    overflow-wrap: anywhere;
}
.civi-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--blog-muted);
}
.civi-article-meta-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
}
.civi-article-meta-author {
    color: var(--blog-text-soft);
    font-weight: 600;
    text-decoration: none;
}
.civi-article-meta-author:hover { color: var(--blog-accent); }
.civi-article-meta-sep { color: var(--blog-muted-soft); }

.civi-article-feature {
    margin: 0 0 16px;
    width: 100%;
}

/* Subtle white card around the article body (long-form reading area).
 * Tight padding + small radius so it reads as a hairline frame, not a
 * heavy box — matches the job-page card treatment. */
.civi-article-content {
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-md);
    padding: 16px 18px;
    box-shadow: var(--blog-shadow-soft);
}

/* Two-column layout: article body + sidebar.
 * The sidebar starts at the very top of the layout (next to the feature
 * image), like a true editorial sidebar — not as a column inside the
 * article body card.
 *
 * Sticky behaviour:
 *   The aside (grid item) is allowed to stretch to the grid row's height
 *   (which equals the much-taller .civi-article-main column). The inner
 *   .civi-article-sidebar-block is the element with position:sticky so it
 *   has room to scroll-stick within the full row height. Putting sticky on
 *   the grid item itself is fragile because the item shrinks to content. */
.civi-article-layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    /* default align-items: stretch — keeps the aside as tall as the row */
}
.civi-article-main { min-width: 0; }
.civi-article-sidebar { min-width: 0; }

/* Sidebar pinning on desktop. The sidebar lives in the grid normally
 * (in-flow). JS toggles two classes based on scroll position:
 *
 *   .is-pinned  → position:fixed, viewport-anchored, visible while
 *                 scrolling through the article body.
 *   .is-bottom  → position:absolute at the bottom of the layout, so
 *                 the sidebar stops at the end of the article and
 *                 doesn't overhang into the related section.
 *
 * Math for the fixed `right` offset: the layout is centered with
 * max-width 1180px + 24px inner padding. The sidebar's right edge sits
 * at (viewport/2 + 590 - 24). Right offset from viewport-right is
 * (viewport/2 - 566), floored at 24px (matches the layout's right
 * padding) on narrower desktops. */
@media (min-width: 993px) {
    /* Pinned: viewport-fixed while scrolling through the article body.
     * `left` is set by JS to match the wrapper's right edge exactly so
     * there's no scrollbar / vw drift when transitioning to .is-bottom. */
    .civi-article-sidebar.is-pinned,
    .civi-blog-layout .civi-article-sidebar.is-pinned {
        position: fixed;
        top: var(--blog-sticky-top);
        width: 320px;
        max-height: calc(100vh - var(--blog-sticky-top) - 24px);
        overflow-y: auto;
        scrollbar-width: thin;
        z-index: 5;
    }
    /* Bottom: anchored at the bottom of the wrapper. JS sets `right` to
     * the wrapper's computed paddingRight so the sidebar's horizontal
     * position is identical to the pinned state — no shift. */
    .civi-article-sidebar.is-bottom,
    .civi-blog-layout .civi-article-sidebar.is-bottom {
        position: absolute;
        top: auto;
        bottom: 0;
        width: 320px;
    }
    .civi-article-sidebar.is-pinned::-webkit-scrollbar { width: 6px; }
    .civi-article-sidebar.is-pinned::-webkit-scrollbar-thumb {
        background: var(--blog-border); border-radius: 6px;
    }
}

.civi-article-sidebar-block {
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 18px 18px 14px;
    box-shadow: var(--blog-shadow-soft);
}
.civi-article-sidebar-block + .civi-article-sidebar-block { margin-top: 18px; }
.civi-article-sidebar-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--blog-muted);
    margin: 0 0 12px;
}
.civi-article-sidebar-jobs { list-style: none; margin: 0; padding: 0; }
.civi-article-sidebar-jobs li {
    padding: 10px 0;
    border-top: 1px solid var(--blog-border-soft);
}
.civi-article-sidebar-jobs li:first-child { border-top: 0; padding-top: 2px; }
.civi-article-sidebar-jobs a {
    display: block;
    color: var(--blog-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}
.civi-article-sidebar-jobs a:hover { color: var(--blog-accent); }
.civi-article-sidebar-jobs .civi-article-sidebar-jobs-meta {
    font-size: 12px;
    color: var(--blog-muted);
    margin-top: 4px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.civi-article-sidebar-jobs .civi-article-sidebar-jobs-meta .sep { color: var(--blog-muted-soft); }
.civi-article-sidebar-cta {
    display: block;
    text-align: center;
    margin-top: 12px;
    padding: 9px 14px;
    background: var(--blog-bg-soft);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--blog-text-soft);
    text-decoration: none;
}
.civi-article-sidebar-cta:hover { background: var(--blog-accent); color: #fff; border-color: var(--blog-accent); }

/* Prev / Next post navigation under the article body */
.civi-post-nav {
    max-width: 1180px;
    margin: 32px auto 0;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.civi-post-nav-item {
    display: block;
    padding: 16px 18px;
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    text-decoration: none;
    color: var(--blog-text);
    box-shadow: var(--blog-shadow-soft);
    transition: border-color .15s, box-shadow .15s, transform .15s;
    min-width: 0;
}
.civi-post-nav-item:hover { border-color: var(--blog-accent); box-shadow: var(--blog-shadow); transform: translateY(-1px); }
.civi-post-nav-item--next { text-align: right; }
.civi-post-nav-item--prev-empty,
.civi-post-nav-item--next-empty { visibility: hidden; }
.civi-post-nav-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--blog-muted);
    margin-bottom: 4px;
}
.civi-post-nav-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}
.civi-article-feature img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--blog-radius-lg);
}

/* Article body — long-form typography */
.civi-article-body { font-size: 17px; line-height: 1.78; color: var(--blog-text-soft); }
.civi-article-body > * { margin-top: 0; }
.civi-article-body > * + * { margin-top: 1.2em; }
.civi-article-body h2,
.civi-article-body h3,
.civi-article-body h4 {
    color: var(--blog-text);
    font-weight: 700;
    letter-spacing: -.015em;
    margin-top: 2em;
    margin-bottom: .6em;
    line-height: 1.3;
}
.civi-article-body h2 { font-size: 28px; }
.civi-article-body h3 { font-size: 22px; }
.civi-article-body h4 { font-size: 18px; }
.civi-article-body p  { margin: 0 0 1.2em; }
.civi-article-body a  { color: var(--blog-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.civi-article-body a:hover { color: var(--blog-accent-strong); }
.civi-article-body strong { color: var(--blog-text); font-weight: 700; }
.civi-article-body ul,
.civi-article-body ol { padding-left: 26px; margin: 0 0 1.2em; }
.civi-article-body li { margin-bottom: .5em; }
.civi-article-body blockquote {
    border-left: 3px solid var(--blog-accent);
    padding: 4px 0 4px 22px;
    margin: 1.6em 0;
    font-style: italic;
    color: var(--blog-text-soft);
    font-size: 18px;
}
.civi-article-body code {
    background: var(--blog-bg-soft);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .88em;
    color: var(--blog-text);
}
.civi-article-body pre {
    background: var(--blog-bg-soft);
    border: 1px solid var(--blog-border);
    padding: 16px;
    border-radius: var(--blog-radius-md);
    overflow-x: auto;
    margin: 1.6em 0;
}
.civi-article-body pre code { background: transparent; padding: 0; }
.civi-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--blog-radius-md);
    margin: 1.6em 0;
    display: block;
}
.civi-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6em 0;
    font-size: 15px;
}
.civi-article-body th,
.civi-article-body td {
    border: 1px solid var(--blog-border);
    padding: 10px 14px;
    text-align: left;
}
.civi-article-body th { background: var(--blog-bg-soft); font-weight: 600; color: var(--blog-text); }
.civi-article-body iframe { max-width: 100%; }

/* Tags pills */
.civi-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--blog-border);
}
.civi-article-tags-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--blog-muted);
    margin-right: 6px;
    align-self: center;
}
.civi-article-tags a {
    display: inline-block;
    padding: 6px 14px;
    background: var(--blog-bg-soft);
    border: 1px solid var(--blog-border);
    border-radius: 999px;
    color: var(--blog-text-soft);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s, border-color .15s;
}
.civi-article-tags a:hover {
    background: var(--blog-accent);
    color: #fff;
    border-color: var(--blog-accent);
}

/* Author bio block */
.civi-author-bio {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    margin: 22px 0 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--blog-border);
}
.civi-author-bio-avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.civi-author-bio-body { flex: 1; min-width: 0; }
.civi-author-bio-eyebrow {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--blog-muted);
    margin: 0 0 4px;
}
.civi-author-bio-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--blog-text);
    margin: 0 0 6px;
}
.civi-author-bio-name a { color: inherit; text-decoration: none; }
.civi-author-bio-name a:hover { color: var(--blog-accent); }
.civi-author-bio-desc { font-size: 14px; color: var(--blog-muted); line-height: 1.6; margin: 0; }
.civi-author-bio-socials { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 10px; }
.civi-author-bio-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--blog-bg-soft);
    color: var(--blog-text-soft);
    text-decoration: none;
    transition: background .15s, color .15s;
    font-size: 13px;
}
.civi-author-bio-socials a:hover { background: var(--blog-accent); color: #fff; }

/* Related — clean 3-col grid (no carousel) */
.civi-related {
    max-width: 1180px;
    margin: 40px auto 0;
    padding: 28px 24px 0;
    border-top: 1px solid var(--blog-border);
}
.civi-related-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
}
.civi-related-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--blog-text);
    margin: 0;
    letter-spacing: -.01em;
}
.civi-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px 24px;
}
/* Subtle white box around related cards on the single-post page */
.civi-related-grid .civi-blog-card {
    background: var(--blog-bg);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow-soft);
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.civi-related-grid .civi-blog-card:hover {
    border-color: var(--blog-accent);
    box-shadow: var(--blog-shadow);
    transform: translateY(-2px);
}
.civi-related-grid .civi-blog-card .civi-blog-card-image { border-radius: 0; }
.civi-related-grid .civi-blog-card .civi-blog-card-body { padding: 16px 18px 18px; }

/* ═════════════════════════════════════════════════════════════
 * RESPONSIVE
 * ═══════════════════════════════════════════════════════════ */

@media (max-width: 992px) {
    .civi-blog-hero-title { font-size: 44px; }
    .civi-blog-featured { grid-template-columns: 1fr; gap: 28px; margin-bottom: 56px; }
    .civi-blog-featured .civi-blog-card-title { font-size: 26px; }
    .civi-blog-list-item { grid-template-columns: 200px 1fr; }
    .civi-blog-list-item .civi-blog-card-body { padding: 16px 20px; }
    .civi-blog-feed-feature { grid-template-columns: 1fr; }
    .civi-blog-feed-feature .civi-blog-card-image { aspect-ratio: 21 / 9; }
    .civi-blog-feed-feature .civi-blog-card-body { padding: 24px 26px; }
    .civi-blog-feed-feature .civi-blog-card-title { font-size: 24px; }
    .civi-article-title { font-size: 34px; }
    .civi-article-layout { grid-template-columns: 1fr; }
    .civi-blog-layout { grid-template-columns: 1fr; }
    /* Sidebar drops back into normal flow below the content on mobile —
     * the fixed-positioning rules above are gated to >=993px so nothing
     * extra is needed here. */
}

@media (max-width: 768px) {
    .civi-blog-hero { padding: 4px 1px 3px; margin-bottom: 40px; }
    .civi-blog-hero-title { font-size: 34px; }
    .civi-blog-hero-desc { font-size: 16px; }
    .civi-blog-section-head { flex-direction: column; align-items: flex-start; gap: 4px; }
    .civi-blog-section-title { font-size: 20px; }
    .civi-blog-grid { gap: 32px 20px; grid-template-columns: 1fr; }
    /* Mobile list rows: small square thumbnail on the left, title + date
     * on the right. Excerpt is hidden — feed should feel compact and
     * scannable. The feed-feature (every 6th) keeps its big featured
     * treatment as a visual break. */
    .civi-blog-list-item { grid-template-columns: 110px 1fr; gap: 0; }
    .civi-blog-list-item .civi-blog-card-image {
        aspect-ratio: 1 / 1;
        min-height: 0;
        height: 100%;
    }
    .civi-blog-list-item .civi-blog-card-body {
        padding: 12px 14px;
        gap: 6px;
        align-self: center;
    }
    .civi-blog-list-item .civi-blog-card-title { font-size: 15px; line-height: 1.35; }
    .civi-blog-list-item .civi-blog-card-excerpt { display: none; }
    .civi-blog-list-item .civi-blog-card-category { font-size: 10px; margin-bottom: 2px; }
    .civi-blog-list-item .civi-blog-card-meta { font-size: 11px; gap: 6px; }
    .civi-blog-feed-feature .civi-blog-card-body { padding: 20px 18px; }
    .civi-blog-feed-feature .civi-blog-card-title { font-size: 20px; }
    .civi-blog-card-placeholder-letter { font-size: 72px; }
    .civi-blog-featured .civi-blog-card-placeholder-letter { font-size: 100px; }
    .civi-article { padding: 0 18px; }
    .civi-article-layout { padding: 0 10px 0; gap: 24px; }
    .civi-article-feature { margin-bottom: 14px; }
    .civi-article-content { padding: 14px 14px; }
    .civi-post-nav { grid-template-columns: 1fr; padding: 0 18px; }
    .civi-post-nav-item--next { text-align: left; }
    .civi-article-header { padding: 32px 0 20px; }
    .civi-article-title { font-size: 26px; }
    .civi-article-body { font-size: 16px; }
    .civi-article-body h2 { font-size: 24px; }
    .civi-article-body h3 { font-size: 19px; }
    .civi-author-bio { flex-direction: column; gap: 14px; }
    .civi-related { padding: 32px 18px 0; }
    .civi-related-grid { grid-template-columns: 1fr; gap: 24px; }
}
