/**
 * Headline News — the home page news section
 *
 * Lead stories across the top in the same auto-fitting card grid the RSS
 * block used, so the top of the section looks as it always has. The list
 * underneath follows the story rows on the High School Sports page:
 * picture left, headline, date and snippet right, separated by hairlines
 * rather than boxed, so eight rows read as one list.
 *
 * Everything is in the theme's design tokens, so a change in the
 * Customizer's Design System carries through here.
 *
 * @package WEEU830
 * @version 2.64.0
 */

.weeu-news-hub {
    width: 100%;
}

/* ------------------------------------------------------------- leads */

.news-hub-top {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.news-hub-card {
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.news-hub-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.news-hub-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.news-hub-card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-background-alt, #f4f4f6);
}

.news-hub-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.news-hub-card-link:hover .news-hub-card-thumb img {
    transform: scale(1.04);
}

.news-hub-card-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 18px 20px;
}

.news-hub-card-title {
    font-family: var(--font-heading, inherit);
    font-size: var(--font-size-lg, 18px);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-heading, #1a1a1a);
    overflow-wrap: anywhere;
}

.news-hub-card-link:hover .news-hub-card-title {
    color: var(--color-primary, #F80000);
}

.news-hub-card-excerpt {
    font-size: var(--font-size-sm, 14px);
    line-height: 1.55;
    color: var(--color-text, #444);
}

/* -------------------------------------------------------------- list */

.news-hub-list {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    border-top: 1px solid var(--color-border, #e5e5e5);
}

.news-hub-row + .news-hub-row {
    border-top: 1px solid var(--color-border, #e5e5e5);
}

.news-hub-row-link {
    display: flex;
    gap: 16px;
    padding: 16px 8px;
    text-decoration: none;
    color: inherit;
}

.news-hub-row-link:hover,
.news-hub-row-link:focus {
    background: var(--color-background-alt, #f7f7f9);
}

.news-hub-row-thumb {
    flex: 0 0 auto;
    width: 120px;
    height: 80px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--color-background-alt, #f4f4f6);
}

.news-hub-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-hub-row-link:hover .news-hub-row-thumb img {
    transform: scale(1.05);
}

.news-hub-row-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.news-hub-row-title {
    font-family: var(--font-heading, inherit);
    font-size: var(--font-size-base, 16px);
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-heading, #1a1a1a);
    overflow-wrap: anywhere;
}

.news-hub-row-link:hover .news-hub-row-title {
    color: var(--color-primary, #F80000);
}

.news-hub-row-excerpt {
    font-size: var(--font-size-sm, 14px);
    line-height: 1.5;
    color: var(--color-text-muted, #666);
}

/* ------------------------------------------------------------ shared */

.news-hub-kicker {
    font-size: var(--font-size-xs, 12px);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-primary, #F80000);
}

.news-hub-date {
    font-size: var(--font-size-xs, 12px);
    color: var(--color-text-muted, #777);
}

.news-hub-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--color-border, #d4d4d4);
    font-size: var(--font-size-xl, 24px);
}

.weeu-news-hub-empty {
    padding: 14px 16px;
    background: var(--color-background-alt, #f7f7f9);
    border-left: 4px solid var(--color-primary, #F80000);
    border-radius: 6px;
    font-size: var(--font-size-sm, 14px);
}

/* ------------------------------------------------------------ mobile */

@media (max-width: 600px) {
    .news-hub-row-link {
        gap: 12px;
        padding: 14px 4px;
    }

    .news-hub-row-thumb {
        width: 92px;
        height: 69px;
    }

    .news-hub-row-excerpt {
        display: none; /* headline and date carry the row on a phone */
    }

    .news-hub-list {
        margin-top: 22px;
    }
}

/* =====================================================================
   THE FLAG: local / sports / national
   ===================================================================== */

.news-hub-flags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.news-hub-flag {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: var(--font-size-xs, 11px);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.5;
    color: #fff;
    background: var(--color-primary, #F80000);
    white-space: nowrap;
}

/* Three colours a reader can learn: the brand red for the station's own
   reporting, and two quieter tones so the flags group rather than shout. */
.news-hub-flag.news-kind-local    { background: var(--color-primary, #F80000); }
.news-hub-flag.news-kind-sports   { background: #1b6b3a; }
.news-hub-flag.news-kind-national { background: #2b4a7d; }

/* =====================================================================
   THE NEWS PAGE
   ===================================================================== */

.weeu-news-page {
    padding-top: 10px;
    padding-bottom: 50px;
}

.news-page-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--color-border, #e5e5e5);
}

.news-page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.news-page-tab {
    display: inline-block;
    padding: 7px 15px;
    border-radius: 999px;
    border: 1px solid var(--color-border, #ddd);
    background: transparent;
    font-size: var(--font-size-sm, 14px);
    font-weight: 600;
    text-decoration: none;
    color: var(--color-text, #444);
    line-height: 1.3;
}

.news-page-tab:hover,
.news-page-tab:focus {
    border-color: var(--color-primary, #F80000);
    color: var(--color-primary, #F80000);
}

.news-page-tab.is-active {
    background: var(--color-primary, #F80000);
    border-color: var(--color-primary, #F80000);
    color: #fff;
}

.news-page-tab.is-active.news-kind-sports   { background: #1b6b3a; border-color: #1b6b3a; }
.news-page-tab.is-active.news-kind-national { background: #2b4a7d; border-color: #2b4a7d; }

.news-page-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-page-search input[type="search"] {
    min-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--color-border, #ccc);
    border-radius: 6px;
    font-family: inherit;
    font-size: var(--font-size-sm, 14px);
}

.news-page-search button {
    padding: 8px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--color-primary, #F80000);
    color: #fff;
    font-family: inherit;
    font-size: var(--font-size-sm, 14px);
    font-weight: 600;
    cursor: pointer;
}

.news-page-clear {
    font-size: var(--font-size-sm, 13px);
    color: var(--color-text-muted, #666);
}

.news-page-featured {
    margin-bottom: 10px;
}

.news-page-resultcount {
    margin: 0 0 10px;
    font-size: var(--font-size-sm, 14px);
    color: var(--color-text-muted, #666);
}

.news-page-empty {
    padding: 30px 0;
    font-size: var(--font-size-lg, 18px);
    color: var(--color-text-muted, #666);
    text-align: center;
}

.news-page-ad-row {
    display: flex;
    justify-content: center;
    padding: 18px 0;
    border-top: 1px solid var(--color-border, #e5e5e5);
}

.news-page-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--color-border, #e5e5e5);
}

.news-page-pagination-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.news-page-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 13px;
    border: 1px solid var(--color-border, #ddd);
    border-radius: 6px;
    font-size: var(--font-size-sm, 14px);
    font-weight: 600;
    text-decoration: none;
    color: var(--color-text, #444);
    line-height: 1;
}

.news-page-pagination a.page-numbers:hover,
.news-page-pagination a.page-numbers:focus {
    border-color: var(--color-primary, #F80000);
    color: var(--color-primary, #F80000);
}

.news-page-pagination .page-numbers.current {
    background: var(--color-primary, #F80000);
    border-color: var(--color-primary, #F80000);
    color: #fff;
}

.news-page-pagination .page-numbers.dots {
    border-color: transparent;
    min-width: 24px;
    padding: 0 4px;
}

.news-page-pagination-count {
    font-size: var(--font-size-sm, 13px);
    color: var(--color-text-muted, #777);
}

@media (max-width: 600px) {
    /* Numbers in the middle are the first thing to go on a narrow screen;
       Newer / Older and the page count carry the navigation. */
    .news-page-pagination .page-numbers:not(.prev):not(.next):not(.current) {
        display: none;
    }
}


@media (max-width: 700px) {
    .news-page-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .news-page-search input[type="search"] {
        flex: 1;
        min-width: 0;
    }
}

/* The fixed header's offset, restated for the news page.
   The theme offsets the header with `body { padding-top: … }`, but on a
   page routed by a rewrite rule WordPress prints its own global styles
   last, and their `body { padding: 0 }` wins on equal specificity and
   later position — pulling the first screenful up underneath the header.
   Carrying the body class makes this more specific than both, so it holds
   whatever order the stylesheets end up in. */
body.weeu-news-page-body {
    padding-top: var(--weeu-header-height, 212px);
}

@media (max-width: 768px) {
    body.weeu-news-page-body {
        padding-top: var(--weeu-header-height, 150px);
    }
}
