/* CarHub Editorial Hub */

.carhub-news-body {
    background: #f4f7fb;
}

.carhub-news-page {
    --ch-blue: #1769ff;
    --ch-ink: #101828;
    --ch-muted: #667085;
    --ch-line: #e3e9f2;
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 18px 56px;
    color: var(--ch-ink);
}


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

.carhub-news-eyebrow {
    display: inline-block;
    color: var(--ch-blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.carhub-news-hero h1 {
    margin: 14px 0;
    font-size: clamp(38px, 6vw, 66px);
    line-height: .98;
    letter-spacing: -.045em;
}

.carhub-news-hero h1 em {
    color: var(--ch-blue);
    font-style: normal;
}

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

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

.carhub-news-hero__stats strong,
.carhub-news-hero__stats span {
    display: block;
}

.carhub-news-hero__stats strong {
    color: var(--ch-blue);
    font-size: 42px;
    line-height: 1;
}

.carhub-news-hero__stats span {
    margin-top: 8px;
    color: var(--ch-muted);
}

.carhub-news-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-news-section__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.carhub-news-section__heading h2 {
    margin: 7px 0 0;
    font-size: 22px;
    letter-spacing: -.025em;
}

.carhub-news-section__heading > a {
    color: var(--ch-blue);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.carhub-news-featured-grid,
.carhub-news-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.carhub-news-featured-grid .carhub-news-card:first-child {
    grid-column: span 2;
}

.carhub-news-card {
    overflow: hidden;
    border: 1px solid var(--ch-line);
    border-radius: 22px;
    background: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
}

.carhub-news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(16,24,40,.10);
}

.carhub-news-card__media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #eef4fb;
}

.carhub-news-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carhub-news-card__fallback {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: var(--ch-blue);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: .15em;
    background: linear-gradient(135deg, #eef5ff, #dbeaff);
}

.carhub-news-card__body {
    padding: 18px;
}

.carhub-news-card__tag {
    color: var(--ch-blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .16em;
}

.carhub-news-card h3 {
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.42;
}

.carhub-news-card h3 a {
    color: var(--ch-ink);
    text-decoration: none;
}

.carhub-news-card p {
    margin: 8px 0 14px;
    color: var(--ch-muted);
    font-size: 13px;
    line-height: 1.6;
}

.carhub-news-card__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #8290a6;
    font-size: 11px;
}

.carhub-news-empty {
    padding: 42px 20px;
    color: var(--ch-muted);
    text-align: center;
}

.carhub-news-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 24px;
    padding: 18px 8px;
    color: var(--ch-muted);
    font-size: 13px;
}

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

    .carhub-news-featured-grid,
    .carhub-news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .carhub-news-featured-grid .carhub-news-card:first-child {
        grid-column: span 2;
    }
}

@media (max-width: 560px) {
    .carhub-news-page {
        padding: 12px 10px 36px;
    }

    .carhub-news-section {
        padding: 18px;
    }

    .carhub-news-featured-grid,
    .carhub-news-grid {
        grid-template-columns: 1fr;
    }

    .carhub-news-featured-grid .carhub-news-card:first-child {
        grid-column: auto;
    }

    .carhub-news-footer {
        flex-direction: column;
    }
}


/* Inline SEO price guide: keep content inside the existing news hero. */
.carhub-news-hero__copy {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.carhub-news-hero .carhub-seo-inline {
    width: 100%;
    max-width: 680px;
    min-width: 0;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

.carhub-news-hero .carhub-seo-inline__short,
.carhub-news-hero .carhub-seo-inline__full {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    color: var(--ch-muted);
    font-size: 17px;
    line-height: 1.75;
    overflow-wrap: break-word;
    word-wrap: break-word;
}



/*
 * The editorial hub uses the exact shared homepage header.
 * Keep its content clear of the fixed header without creating a second header.
 */
body.carhub-news-body .carhub-news-page {
    padding-top: 34px;
}

@media (max-width: 760px) {
    body.carhub-news-body .carhub-news-page {
        padding-top: 24px;
    }

    .carhub-news-section__heading h2 {
        font-size: 21px;
    }
}

@media (max-width: 560px) {
    body.carhub-news-body .carhub-news-page {
        padding-top: 18px;
    }

    .carhub-news-card h3 {
        font-size: 13px;
    }
}




/* NEWS PAGE — use the shared Homepage header without template-specific decoration. */
body.carhub-news-body.carhub-home-body .carhub-global-header a,
body.carhub-news-body.carhub-home-body .carhub-global-header a:hover,
body.carhub-news-body.carhub-home-body .carhub-global-header a:focus,
body.carhub-news-body.carhub-home-body .carhub-global-header a:visited,
body.carhub-news-body.carhub-home-body .carhub-global-header button {
    text-decoration: none !important;
}

.carhub-news-hero__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    padding: 0;
    overflow: hidden;
}
.carhub-news-hero__stats > div {
    padding: 22px 18px;
    border-right: 1px solid rgba(23,105,255,.12);
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(10px);
}
.carhub-news-hero__stats > div:last-child { border-right: 0; }
.carhub-news-hero__stats strong, .carhub-news-hero__stats span { display: block; }
.carhub-news-hero__stats strong { color: var(--ch-blue); font-size: 34px; line-height: 1; }
.carhub-news-hero__stats span { margin-top: 8px; color: var(--ch-muted); font-size: 12px; }

.carhub-news-hero h1 {
    font-size: clamp(32px, 5vw, 54px);
}

.carhub-news-featured-grid {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}
.carhub-news-featured-grid .carhub-news-card {
    flex: 0 0 min(330px, 78vw);
    scroll-snap-align: start;
}
.carhub-news-featured-grid .carhub-news-card:first-child { grid-column: auto; }

@media (max-width: 560px) {
    .carhub-news-hero__stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .carhub-news-hero__stats > div { padding: 16px 10px; }
    .carhub-news-hero__stats strong { font-size: 25px; }
    .carhub-news-hero__stats span { font-size: 10px; }
}


/* Latest posts: make each card about 15% narrower so the next card peeks in. */
.carhub-news-featured-grid .carhub-news-card {
    flex: 0 0 min(280px, 72vw);
}

/* Shared four-category discovery card. */
.carhub-news-category-card {
    margin-top: 22px;
}

.carhub-news-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.carhub-news-category-card__item {
    min-height: 88px;
    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 !important;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.carhub-news-category-card__item strong {
    font-size: 14px;
    line-height: 1.35;
}

.carhub-news-category-card__item span {
    flex: 0 0 auto;
    color: var(--ch-blue);
    font-size: 18px;
    font-weight: 800;
}

.carhub-news-category-card__item:hover {
    transform: translateY(-2px);
    border-color: #b9d0ff;
    box-shadow: 0 12px 26px rgba(16,24,40,.07);
}

@media (max-width: 760px) {
    .carhub-news-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .carhub-news-category-card__item {
        min-height: 70px;
    }
}


/* Shared Homepage header: only remove theme link decoration. Geometry stays
 * entirely owned by the Homepage stylesheet and Shared/Header.php. */
body.carhub-news-body.carhub-home-body .carhub-global-header a,
body.carhub-news-body.carhub-home-body .carhub-global-header a:hover,
body.carhub-news-body.carhub-home-body .carhub-global-header a:focus,
body.carhub-news-body.carhub-home-body .carhub-global-header a:visited {
    text-decoration: none !important;
}

/* Latest/editorial feeds are horizontal carousels. */
.carhub-news-horizontal-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 8px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.carhub-news-horizontal-row .carhub-news-card {
    flex: 0 0 min(252px, 65vw);
    scroll-snap-align: start;
}

/* The latest cards are 10% narrower than the previous version. */
.carhub-news-featured-grid .carhub-news-card {
    flex: 0 0 min(252px, 65vw);
}

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

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

/* Explore all categories horizontally so new main categories simply extend
 * the row without changing the template. */
.carhub-news-category-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 8px;
    scrollbar-width: thin;
}

.carhub-news-category-card__item {
    flex: 0 0 min(230px, 70vw);
    min-height: 88px;
}

.carhub-news-main-category-section .carhub-news-section__heading > a {
    white-space: nowrap;
}

.carhub-news-main-category-section .carhub-news-horizontal-row,
.carhub-news-popular-section .carhub-news-horizontal-row {
    margin-top: 2px;
}

/* Dynamic nested editorial category navigation in the shared Homepage drawer. */
.carhub-home-drawer__editorial-categories > details {
    border-bottom: 1px solid #f1f5f9;
}

.carhub-home-drawer__editorial-categories > details > summary {
    min-height: 52px;
}

.carhub-home-drawer__editorial-categories .carhub-home-drawer__submenu {
    padding-left: 14px;
}

.carhub-home-drawer__editorial-categories .carhub-home-drawer__category-level .carhub-home-drawer__submenu {
    padding-left: 12px;
}

@media (max-width: 560px) {
    .carhub-news-horizontal-row .carhub-news-card {
        flex-basis: min(252px, 65vw);
    }

    .carhub-news-category-card__item {
        flex-basis: min(230px, 70vw);
    }
}


/* ==========================================================================
   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;
    }
}


/* Final editorial discovery sizing: compact horizontal category tiles. */
.carhub-news-category-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 8px;
    scrollbar-width: thin;
}

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

.carhub-news-category-card__item strong {
    font-size: 13px;
    line-height: 1.25;
}


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

.carhub-news-category-card__item {
    min-width: 0 !important;
    min-height: 66px !important;
    height: 66px !important;
    padding: 12px 14px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
}

.carhub-news-category-card__item strong {
    min-width: 0;
    font-size: 13px !important;
    line-height: 1.25 !important;
}

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

    .carhub-news-category-card__item {
        min-height: 62px !important;
        height: 62px !important;
        padding: 10px !important;
        border-radius: 14px !important;
    }

    .carhub-news-category-card__item strong {
        font-size: 11px !important;
    }

    .carhub-news-category-card__item span {
        font-size: 14px !important;
    }
}

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