/* Template page (page.html). The header, breadcrumb, title and footer are
   fixed by the template; only .cms-content is editor-controlled. Width is
   chosen per page with data-width on <main> (narrow | standard | wide | full).
   Styles target what CKEditor 5 outputs, so the editing view (.ck-content)
   and the live page look the same. */

.cms-page {
  --cms-width: 52rem;
}

.cms-page[data-width="narrow"] { --cms-width: var(--content-narrow); }
.cms-page[data-width="standard"] { --cms-width: 52rem; }
.cms-page[data-width="wide"] { --cms-width: var(--content-wide); }
.cms-page[data-width="full"] { --cms-width: 100%; }

.cms-page .page-head h1 {
  max-width: none;
}

.cms-content {
  width: min(100% - 2rem, var(--cms-width));
  margin-inline: auto;
  padding-block: var(--space-xl) var(--space-2xl);
}

.cms-page[data-width="full"] .cms-content {
  width: 100%;
  padding-inline: 0;
}

/* Shared by the live page and the CKEditor editing area. */
.cms-content,
.ck-content {
  color: var(--ink);
  line-height: 1.7;
}

.cms-content > * + * {
  margin-top: 1.15rem;
}

.cms-content h2,
.cms-content h3,
.cms-content h4 {
  margin-bottom: 0;
}

.cms-content h2 { margin-top: var(--space-xl); }
.cms-content h3 { margin-top: var(--space-lg); }
.cms-content h4 { margin-top: var(--space-md); font-size: 1.05rem; }

.cms-content a:not(.btn) {
  color: var(--field);
  text-decoration-color: var(--yolk);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1.5px;
}

.cms-content a:not(.btn):hover {
  color: var(--field-deep);
}

.cms-content ul,
.cms-content ol {
  padding-left: 1.4rem;
}

.cms-content ul { list-style: disc; }
.cms-content li + li { margin-top: 0.35rem; }
.cms-content li::marker { color: var(--yolk); }

.cms-content blockquote {
  margin-inline: 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--yolk);
  color: var(--muted);
  font-size: 1.1rem;
}

/* CKEditor image output: <figure class="image image-style-*"> */
.cms-content figure.image {
  margin-inline: 0;
}

.cms-content figure.image img {
  width: 100%;
  height: auto;
  border-radius: 0.55rem;
}

.cms-content figure.image figcaption {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.cms-content .image-style-side {
  float: right;
  max-width: 50%;
  margin: 0.25rem 0 1rem 1.5rem;
}

.cms-content .image-style-align-left {
  float: left;
  max-width: 50%;
  margin: 0.25rem 1.5rem 1rem 0;
}

.cms-content .image-style-align-right {
  float: right;
  max-width: 50%;
  margin: 0.25rem 0 1rem 1.5rem;
}

.cms-content .image-style-align-center,
.cms-content .image-style-block-align-center {
  margin-inline: auto;
}

/* Embedded video: <figure class="media"> */
.cms-content figure.media {
  margin-inline: 0;
}

.cms-content figure.media iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 0.55rem;
}

/* Tables wrapped in <figure class="table"> */
.cms-content figure.table {
  margin-inline: 0;
  overflow-x: auto;
}

/* Green header row, white body with hairline rules, soft cream stripes.
   The figure clips the corners so the table gets the site's rounded card look. */
.cms-content figure.table {
  border: 1px solid var(--hairline);
  border-radius: 0.55rem;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.cms-content table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cms-content th,
.cms-content td {
  padding: 0.85rem 1.05rem;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}

.cms-content tbody tr:last-child td {
  border-bottom: 0;
}

.cms-content th {
  background: var(--field);
  color: var(--paper);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.cms-content tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--feed) 55%, var(--paper));
}

.cms-content tbody td:first-child {
  color: var(--field);
  white-space: nowrap;
}

.cms-content td p {
  margin: 0;
}

.cms-content td p + p {
  margin-top: 0.75rem;
}

.cms-content hr {
  margin-block: var(--space-lg);
  border: 0;
  border-top: 1px solid var(--hairline);
}

/* Editors tick "Button" on a link to get class="btn btn--secondary"
   (see the link decorators in the CKEditor config). The orange button
   style from the live site is --secondary. */
.cms-content a.btn {
  margin: 0.25rem 0.5rem 0.25rem 0;
}

.cms-content a.btn--secondary {
  background: var(--yolk);
  color: var(--paper);
}

.cms-content a.btn--primary {
  background: var(--field);
  color: var(--paper);
}

.cms-content::after {
  content: "";
  display: table;
  clear: both;
}
/* 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);
}

/* 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-fit instead of fixed 1/2/3-column
   steps, so it fills whatever width it actually has rather than snapping
   to one column when the sidebar leaves less room than the viewport width
   suggests. */
.news-grid {
    display: grid;
    gap: 1.75rem;
    grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
}

.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: 1.85rem 0;
    padding: 0.2rem 0 0.2rem 1.35rem;
    border-left: 3px solid var(--yolk);
    font-family: var(--font-display);
    font-size: 1.18rem;
    font-weight: 500;
    line-height: 1.55;
    color: var(--ink);
}

    .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);
}
/* CMS template pages: banner image between the .page-head band and .cms-content.
   Uses the width tokens from styles.css. Same width as .page-head__inner so it lines up
   with the title above; if .cms-content turns out narrower, change this to var(--content). */
.cms-banner {
    width: min(100% - 2rem, var(--content-wide));
    margin: var(--space-lg) auto 0;
}

.cms-banner__img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.55rem;
}
/* CKEditor: default (unaligned) images are centred */
.cms-content figure.image {
    margin-inline: auto;
}

    .cms-content figure.image img {
        margin-inline: auto;
    }

/* Let images inside centred paragraphs/headings follow text-align */
.cms-content img:not(figure img) {
    display: inline-block;
    vertical-align: middle;
}
@media (max-width: 639px) {
  .cms-content .image-style-side,
  .cms-content .image-style-align-left,
  .cms-content .image-style-align-right {
    float: none;
    max-width: 100%;
    margin: 0;
  }
}

/* "Members only" message on a locked page (same look as the one on a news story) */
.cms-content .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;
}

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

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

/* PDF downloads under the page body (same look as .news-downloads on a news story) */
.cms-downloads {
  width: min(100% - 2rem, var(--cms-width));
  margin-inline: auto;
  margin-bottom: var(--space-2xl);
  padding-top: 1.5rem;
  border-top: 1px solid var(--hairline);
}

.cms-page[data-width="full"] .cms-downloads {
  width: 100%;
  padding-inline: 1rem;
}

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

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

.cms-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;
}

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

.cms-downloads__name:hover {
  color: var(--field-deep);
  text-decoration: underline;
}

.cms-downloads__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--field);
}

.cms-downloads__icon svg {
  width: 1.4rem;
  height: 1.4rem;
}
