/* ==========================================================================
   CARHUB POST CATEGORY SINGLE
   Premium dynamic template for every native WordPress category.
   ========================================================================== */

body.carhub-post-category-body {
    --ch-blue: #1769ff;
    --ch-ink: #101828;
    --ch-muted: #667085;
    --ch-line: #e3e9f2;
    background: #f4f7fb;
}

.carhub-post-category-page {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 34px 0 64px;
    color: var(--ch-ink);
}

.carhub-post-category-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 28px;
    align-items: end;
    padding: clamp(32px, 6vw, 68px);
    border: 1px solid #dbe7f7;
    border-radius: 32px;
    background:
        radial-gradient(circle at 86% 18%, rgba(23,105,255,.18), transparent 32%),
        linear-gradient(135deg, #fff 0%, #f0f6ff 62%, #dfeaff 100%);
    box-shadow: 0 24px 60px rgba(16,24,40,.08);
}

.carhub-post-category-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: #7a8799;
    font-size: 11px;
}

.carhub-post-category-breadcrumb a {
    color: var(--ch-blue);
    text-decoration: none;
}

.carhub-post-category-eyebrow,
.carhub-post-category-heading > span {
    color: var(--ch-blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.carhub-post-category-hero h1 {
    margin: 12px 0 14px;
    max-width: 780px;
    font-size: clamp(38px, 6vw, 64px);
    line-height: 1;
    letter-spacing: -.05em;
    font-weight: 500;
}

.carhub-post-category-hero p {
    max-width: 700px;
    margin: 0;
    color: var(--ch-muted);
    font-size: 17px;
    line-height: 1.75;
}

.carhub-post-category-hero__actions {
    margin-top: 24px;
    color: var(--ch-blue);
    font-size: 12px;
    font-weight: 800;
}

.carhub-post-category-hero__stat {
    padding: 24px;
    border: 1px solid rgba(23,105,255,.14);
    border-radius: 22px;
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(10px);
}

.carhub-post-category-hero__stat strong,
.carhub-post-category-hero__stat span {
    display: block;
}

.carhub-post-category-hero__stat strong {
    color: var(--ch-blue);
    font-size: 48px;
    line-height: 1;
}

.carhub-post-category-hero__stat span {
    margin-top: 9px;
    color: var(--ch-muted);
}

.carhub-post-category-section {
    margin-top: 22px;
    padding: 28px;
    border: 1px solid var(--ch-line);
    border-radius: 28px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(16,24,40,.05);
}

.carhub-post-category-heading {
    margin-bottom: 20px;
}

.carhub-post-category-heading h2 {
    margin: 7px 0 0;
    font-size: clamp(23px, 4vw, 32px);
    line-height: 1.1;
    letter-spacing: -.035em;
    font-weight: 500;
}

.carhub-post-category-subcategories,
.carhub-post-category-main-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 8px;
    scrollbar-width: thin;
}

.carhub-post-category-subcategories a,
.carhub-post-category-main-grid a {
    flex: 0 0 min(240px, 70vw);
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--ch-line);
    border-radius: 18px;
    background: #f8fbff;
    color: var(--ch-ink);
    text-decoration: none;
}

.carhub-post-category-subcategories a:hover,
.carhub-post-category-main-grid a:hover {
    border-color: #b9d0ff;
    color: var(--ch-blue);
}

.carhub-post-category-subcategories span,
.carhub-post-category-main-grid span {
    color: var(--ch-blue);
    font-size: 18px;
    font-weight: 800;
}

.carhub-post-category-page .carhub-news-horizontal-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 8px;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.carhub-post-category-page .carhub-news-card {
    flex: 0 0 min(280px, 72vw);
    scroll-snap-align: start;
}

.carhub-post-category-page .carhub-news-card h3 {
    font-size: 16px;
    line-height: 1.45;
}

.carhub-post-category-page .carhub-news-card p {
    font-size: 14px;
    line-height: 1.7;
}

@media (max-width: 800px) {
    .carhub-post-category-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .carhub-post-category-page {
        width: min(100% - 20px, 1180px);
        padding: 12px 0 36px;
    }

    .carhub-post-category-hero {
        padding: 28px 22px;
        border-radius: 26px;
    }

    .carhub-post-category-section {
        padding: 20px 18px;
        border-radius: 24px;
    }

    .carhub-post-category-hero h1 {
        font-size: 38px;
    }

    .carhub-post-category-page .carhub-news-card {
        flex-basis: min(280px, 76vw);
    }
}


/* ==========================================================================
   SHARED HOMEPAGE HEADER — FINAL ROUTE OVERRIDE
   News routes must use the exact Homepage header geometry.
   ========================================================================== */
body.carhub-home-body .carhub-global-header {
    height: calc(
        var(--carhub-home-adminbar-height, 0px)
        + var(--carhub-home-header-height, 64px)
    ) !important;
    min-height: calc(
        var(--carhub-home-adminbar-height, 0px)
        + var(--carhub-home-header-height, 64px)
    ) !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
}

body.carhub-home-body .carhub-home-header {
    position: fixed !important;
    top: var(--carhub-home-adminbar-height, 0px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: var(--carhub-home-header-height, 64px) !important;
    min-height: var(--carhub-home-header-height, 64px) !important;
    max-height: var(--carhub-home-header-height, 64px) !important;
    margin: 0 !important;
    padding: 0 24px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

body.carhub-home-body .carhub-home-drawer__nav {
    margin: 0 !important;
    padding: 10px 16px 30px !important;
    box-sizing: border-box !important;
}

body.carhub-home-body .carhub-home-drawer__nav > a,
body.carhub-home-body .carhub-home-drawer__nav > details > summary {
    margin: 0 !important;
    padding: 14px 4px !important;
    min-height: 52px !important;
    box-sizing: border-box !important;
    line-height: 1.25 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
}

body.carhub-home-body .carhub-home-drawer__nav > details {
    margin: 0 !important;
    padding: 0 !important;
}

body.carhub-home-body .carhub-home-drawer__nav > details + details {
    margin-top: 0 !important;
}

body.carhub-home-body .carhub-home-drawer__nav > details > summary {
    margin: 0 !important;
}

@media (max-width: 640px) {
    :root {
        --carhub-home-header-height: 62px;
    }

    body.carhub-home-body .carhub-global-header {
        height: calc(
            var(--carhub-home-adminbar-height, 0px)
            + 62px
        ) !important;
        min-height: calc(
            var(--carhub-home-adminbar-height, 0px)
            + 62px
        ) !important;
    }

    body.carhub-home-body .carhub-home-header {
        height: 62px !important;
        min-height: 62px !important;
        max-height: 62px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}


/* Compact Explore All Categories tiles and the shared SEO guide in the hero. */
.carhub-post-category-main-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 8px;
    scrollbar-width: thin;
}

.carhub-post-category-main-grid a {
    flex: 0 0 min(150px, 52vw);
    min-height: 66px;
    height: 66px;
    padding: 12px 14px;
    border-radius: 16px;
}

.carhub-post-category-main-grid a strong {
    font-size: 13px;
    line-height: 1.25;
}

.carhub-post-category-hero .carhub-seo-inline {
    max-width: 700px;
    margin-top: 12px;
}

.carhub-post-category-hero .carhub-seo-inline__short,
.carhub-post-category-hero .carhub-seo-inline__full {
    color: var(--ch-muted);
    font-size: 16px;
    line-height: 1.7;
}

.carhub-post-category-hero .carhub-seo-inline__details > summary {
    color: #1769ff;
}

@media (max-width: 560px) {
    .carhub-post-category-main-grid a {
        flex-basis: min(150px, 52vw);
    }

    .carhub-post-category-hero .carhub-seo-inline {
        max-width: 100%;
    }
}


/* FINAL: keep the category SEO content inside the existing hero card. */
.carhub-post-category-hero__copy {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.carhub-post-category-hero .carhub-seo-inline {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere !important;
}

.carhub-post-category-hero .carhub-seo-inline__short,
.carhub-post-category-hero .carhub-seo-inline__full,
.carhub-post-category-hero .carhub-seo-inline__table-title {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

/* FINAL: Explore All Categories uses a compact 3-column grid. */
.carhub-post-category-main-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    overflow: visible !important;
    padding: 0 !important;
}

.carhub-post-category-main-grid a {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 66px !important;
    height: 66px !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
}

@media (max-width: 560px) {
    .carhub-post-category-main-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .carhub-post-category-main-grid a {
        min-height: 62px !important;
        height: 62px !important;
        padding: 10px !important;
        border-radius: 14px !important;
    }

    .carhub-post-category-main-grid a strong {
        font-size: 11px !important;
    }

    .carhub-post-category-main-grid a span {
        font-size: 14px !important;
    }
}

/* Explore All Categories: improve category label readability. */
.carhub-post-category-main-grid a strong {
    font-size: 20px;
    line-height: 1.35;
    font-weight: 700;
}

/* ========================================================================== 
   DYNAMIC CAR EXPERT REVIEWS CATEGORY
   ========================================================================== */
.carhub-post-category-heading--with-action {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.carhub-post-category-heading__action {
    flex: 0 0 auto;
    color: var(--ch-blue, #1769ff);
    font-size: 12px;
    line-height: 1.35;
    font-weight: 800;
    text-decoration: none;
}

.carhub-post-category-heading__action:hover,
.carhub-post-category-heading__action:focus {
    text-decoration: underline;
}

.carhub-post-category-expert-brand-section .carhub-news-card {
    flex-basis: min(280px, 72vw);
}

@media (max-width: 560px) {
    .carhub-post-category-heading--with-action {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}
