/* News listing + individual article pages, plus the sidebar layout shared
   by News, Diseases, Husbandry and Knowledgebase. Sits alongside styles.css
   and reuses its tokens (colours, spacing, --ease, --content widths) rather
   than redefining them. */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Small breadcrumb trail above page/article titles. */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.1rem;
    font-size: 0.85rem;
}

    .breadcrumb a {
        color: var(--field);
        text-decoration: none;
        font-weight: 600;
    }

        .breadcrumb a:hover {
            text-decoration: underline;
        }

.breadcrumb__sep {
    opacity: 0.55;
}

.breadcrumb__current {
    color: var(--muted);
}
p a {
    overflow-wrap: anywhere;
    word-break: break-word;
} 
/* Cream band under the header: title + short intro for the whole section. */
.page-head {
    background: var(--feed);
    border-bottom: 1px solid var(--hairline);
    padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(2rem, 5vw, 3rem);
}

.page-head__inner {
    width: min(100% - 2rem, var(--content-wide));
    margin-inline: auto;
}

.page-head h1 {
    max-width: 26ch;
    margin-bottom: 0.75rem;
}

.page-head__lead {
    max-width: 46rem;
    margin: 0;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

/* Yolk pill used on cards and article heads to mark the story's category. */
.news-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--yolk) 16%, var(--paper));
    color: color-mix(in srgb, var(--yolk) 70%, var(--ink));
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}

.featured-card {
    display: grid;
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: 0.65rem;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: inherit;
}

.featured-card__media {
    margin: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--feed);
}

    .featured-card__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center 35%;
        transition: transform 420ms var(--ease);
    }

.featured-card:hover .featured-card__media img {
    transform: scale(1.03);
}

.featured-card__body {
    padding: clamp(1.5rem, 4vw, 2.5rem);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.featured-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.featured-card h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.featured-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.featured-card__more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
    color: var(--field);
    font-weight: 600;
    font-size: 0.95rem;
}

.featured-card:hover .featured-card__more {
    color: var(--field-deep);
}

/* Sized off the container's own width, not the viewport. .category-content
   sits beside a sidebar on wide screens, so it's often narrower than the
   viewport, and a @media query would get that wrong. */
@container (min-width: 700px) {
    .featured-card {
        grid-template-columns: 1.15fr 1fr;
        align-items: stretch;
    }

    .featured-card__media {
        aspect-ratio: auto;
    }

    .featured-card__body {
        justify-content: center;
    }
}

/* Grid of smaller story cards. auto-fill (not auto-fit) so empty columns
   are kept: a category with only one or two extra stories shows them at
   normal card width instead of stretching a lone card across the row.
   Still fluid: it fills whatever width the container actually has. */
.news-grid {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
    align-items: stretch;
}

    .news-grid > li {
        min-width: 0;
    }

.news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: 0.55rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}

    .news-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-soft);
        border-color: color-mix(in srgb, var(--yolk) 35%, var(--hairline));
    }

.news-card__media {
    margin: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--feed);
}

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

.news-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.25rem 1.35rem 1.5rem;
}

.news-card__meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--muted);
}

.news-card h3 {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.32;
    letter-spacing: -0.01em;
}

.news-card p {
    flex: 1;
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.news-card__more {
    margin-top: 0.15rem;
    color: var(--field);
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1.5px solid var(--yolk);
    align-self: flex-start;
}

.news-card:hover .news-card__more {
    color: var(--field-deep);
}

/* ---- Sidebar + content layout, shared by News, Diseases, Husbandry and
   Knowledgebase. <category-nav> supplies the sidebar; .category-content
   holds whatever the page needs (card grid, article body, empty state). ---- */

.category-head {
    background: var(--feed);
    border-bottom: 1px solid var(--hairline);
    padding: clamp(2rem, 5vw, 3rem) 0 clamp(1.5rem, 4vw, 2.25rem);
}

.category-head__inner {
    width: min(100% - 2rem, var(--content-wide));
    margin-inline: auto;
}

.category-head h1 {
    max-width: 28ch;
    margin-bottom: 0.6rem;
}

.category-head__lead {
    max-width: 44rem;
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.category-layout {
    width: min(100% - 2rem, var(--content-wide));
    margin-inline: auto;
    padding: var(--space-lg) 0 var(--space-2xl);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    align-items: start;
}

@media (min-width: 840px) {
    .category-layout {
        grid-template-columns: 15.5rem minmax(0, 1fr);
        gap: 2.75rem;
    }

        .category-layout category-nav {
            position: sticky;
            top: calc(var(--header-height, 7rem) + 1.5rem);
        }
}

/* container-type here is what lets .featured-card and .news-grid above
   respond to the space actually left beside the sidebar. */
.category-content {
    container-type: inline-size;
}

    .category-content h2 {
        margin-top: 2rem;
        font-size: 1.3rem;
    }

        .category-content h2:first-child {
            margin-top: 0;
        }

    .category-content > .news-tag {
        margin-bottom: 0.75rem;
    }

    .category-content > .featured-card {
        margin-bottom: 2rem;
    }

.category-empty {
    padding: 2rem;
    background: var(--paper);
    border: 1px dashed var(--hairline);
    border-radius: 0.55rem;
    color: var(--muted);
    text-align: center;
}

    .category-empty strong {
        display: block;
        margin-bottom: 0.35rem;
        color: var(--ink);
        font-size: 1.05rem;
    }

/* Reuses the site's .hang-card look for a lightweight "step" list, e.g.
   the secondary C&D options on the Avian Influenza page. */
.category-steps {
    display: grid;
    gap: 0.85rem;
    margin: 1.25rem 0 2rem;
    padding: 0;
    list-style: none;
}

.category-step {
    padding: 1.1rem 1.25rem;
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--yolk);
    border-radius: 0.45rem;
}

    .category-step h3 {
        margin: 0 0 0.4rem;
        font-size: 1rem;
    }

    .category-step p {
        margin: 0;
        color: var(--muted);
        font-size: 0.94rem;
        line-height: 1.6;
    }

.category-media {
    margin: 0 0 2rem;
    border-radius: 0.55rem;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

    .category-media img {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
    }

    .category-media figcaption {
        padding: 0.65rem 0.1rem 0;
        color: var(--muted);
        font-size: 0.82rem;
    }

/* ---- Article page ---- */

.article-head {
    background: var(--field-deep);
    color: var(--paper);
    padding: clamp(2.25rem, 6vw, 3.5rem) 0 calc(var(--space-xl) + 3rem);
}

    .article-head .breadcrumb {
        font-size: 0.82rem;
    }

        .article-head .breadcrumb a {
            color: var(--yolk-bright);
        }

    .article-head .breadcrumb__sep,
    .article-head .breadcrumb__current {
        color: rgba(245, 241, 228, 0.6);
    }

.article-head__inner {
    width: min(100% - 2rem, var(--content-narrow));
    margin-inline: auto;
}

.article-head .news-tag {
    background: rgba(245, 241, 228, 0.14);
    color: var(--yolk-bright);
}

.article-head h1 {
    margin: 0.85rem 0 1rem;
    color: var(--paper);
    font-size: clamp(2rem, 4.2vw, 2.85rem);
}

.article-head__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    margin: 0;
    color: rgba(245, 241, 228, 0.75);
    font-size: 0.9rem;
}

/* Photo hangs over the seam between the dark head and the cream body,
   same overlap trick as the homepage's hanging feature cards. */
.article-media {
    width: min(100% - 2rem, var(--content-wide));
    margin: calc((var(--space-xl) + 1.5rem) * -1) auto 0;
    position: relative;
    z-index: 2;
}

    .article-media img {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        border-radius: 0.55rem;
        box-shadow: 0 22px 48px rgba(20, 28, 17, 0.28);
    }

    .article-media figcaption {
        margin-top: 0.65rem;
        text-align: center;
        color: var(--muted);
        font-size: 0.82rem;
    }

/* Four headline numbers pulled out of the story. Fluid for the same
   reason as .news-grid above. */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.85rem;
    margin: 1.75rem 0 2.25rem;
    padding: 0;
    list-style: none;
}

.stat-card {
    background: var(--field);
    color: var(--paper);
    border-radius: 0.55rem;
    padding: 1.1rem 1rem;
    text-align: center;
}

.stat-card__value {
    display: block;
    font-size: clamp(1.4rem, 4vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--paper);
}

.stat-card__label {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.76rem;
    line-height: 1.35;
    color: rgba(245, 241, 228, 0.78);
}

.pull-quote {
    margin-top: 0.65rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
}

    .pull-quote cite {
        display: block;
        margin-top: 0.5rem;
        font-family: var(--font-body);
        font-size: 0.85rem;
        font-style: normal;
        font-weight: 400;
        color: var(--muted);
    }

.article-source {
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--hairline);
    color: var(--muted);
    font-size: 0.85rem;
}

    .article-source a {
        color: var(--field);
        font-weight: 600;
        text-decoration: none;
    }

        .article-source a:hover {
            color: var(--field-deep);
            text-decoration: underline;
        }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.75rem;
    color: var(--field);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

    .back-link:hover {
        color: var(--field-deep);
    }

    .back-link svg {
        width: 0.9rem;
        height: 0.9rem;
    }

.related {
    background: var(--feed);
    padding: var(--space-2xl) 0;
    border-top: 1px solid var(--hairline);
}

.related__inner {
    width: min(100% - 2rem, var(--content-wide));
    margin-inline: auto;
    container-type: inline-size;
}

.related h2 {
    margin-bottom: var(--space-lg);
}

/* ---- Load more ---- */

.news-grid > li[hidden] {
    display: none;
}

.news-load-more {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

    .news-load-more[hidden] {
        display: none;
    }

.news-load-more__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.news-load-more__spinner {
    display: none;
    width: 1.1em;
    height: 1.1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: news-spin 0.7s linear infinite;
}

.news-load-more__btn.is-loading .news-load-more__spinner {
    display: inline-block;
}

.news-load-more__btn:disabled {
    cursor: wait;
    opacity: 0.85;
}
/* ---- Members-only notice and downloads ---- */

.member-notice {
    margin: 1.75rem 0;
    padding: 1.1rem 1.25rem;
    background: var(--feed);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--yolk);
    border-radius: 0.45rem;
}

    .member-notice strong {
        display: block;
        margin-bottom: 0.25rem;
        color: var(--ink);
    }

    .member-notice p {
        margin: 0;
        color: var(--muted);
    }

.news-downloads {
    margin-top: 2.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--hairline);
}

    .news-downloads h2 {
        margin-top: 0;
    }

.news-downloads__list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.news-downloads__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: 0.45rem;
}

.news-downloads__name {
    min-width: 0;
    color: var(--field);
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

    .news-downloads__name:hover {
        color: var(--field-deep);
        text-decoration: underline;
    }
.news-downloads__icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    color: var(--field);
}

    .news-downloads__icon svg {
        width: 1.4rem;
        height: 1.4rem;
    }
.news-downloads__icon {
    flex: none;
    display: inline-flex;
    color: var(--field);
}

    .news-downloads__icon svg {
        width: 1.4rem;
        height: 1.4rem;
    }
@keyframes news-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-load-more__spinner {
        animation-duration: 1.6s;
    }
}
@media (max-width: 839px) {
    /* Long list: scroll inside the panel instead of pushing the page down */
    .category-nav__panel .category-nav__groups {
        max-height: 60vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        display: grid;
        grid-template-columns: 1fr 1fr; /* two columns, so 29 items are not one tall list */
        column-gap: 1rem;
    }

    .category-nav__link,
    .category-nav__sublist a {
        display: block;
        padding: 0.7rem 0.25rem; /* comfortable tap target */
        word-break: break-word;
    }
}