/* ==========================================================================
   Why Somerset County — News & Resources
   The blog index, the article template and the resources band.
   Loaded after css/styles.css and css/components/page-chrome.css.

   There is no comp for this section. Everything here is extrapolated from the
   three pillar sections: the card is the pillar card's keyline-and-shadow
   treatment at tile scale, the chips are the "Learn more" pill's shape, and the
   column widths are the ones media-figure.css already uses inside the 1040.

   News is not a pillar, so it takes no pillar colour: the accent is the brand
   teal. The nav item cannot be teal — it would vanish against the teal header —
   so --ws-section-nav is the bright green the underline cue already uses.
   ========================================================================== */

:root {
  --ws-section-accent: var(--ws-teal);
  --ws-section-nav: var(--ws-green);
  --ws-card-shadow:    0 6px 18px rgba(0, 79, 90, .14);
  --ws-card-shadow-hv: 0 12px 28px rgba(0, 79, 90, .22);
}

/* --------------------------------------------------------------------------
   1. Category filter
   Chips over the grid. They are a progressive enhancement: without JS every
   card is visible and the chips read as a list of the categories in use.
   In WordPress these become term archive links, so they keep <a> semantics
   where they can — but the filtering itself is client-side, so they are
   buttons with aria-pressed rather than links to nowhere.
   -------------------------------------------------------------------------- */
.news-filter {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(8px, .83vw, 12px);
  margin: 0;
  padding: 0;
}
.news-filter__btn {
  border: 2px solid #dfe4e6;
  border-radius: 999px;
  background: #fff;
  padding: .36em 1.25em;
  font-family: var(--ws-font-body);
  font-size: clamp(.8125rem, 1.042vw, .9375rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--ws-teal-ink);
  cursor: pointer;
  transition: background .25s var(--ws-ease), color .25s var(--ws-ease),
              border-color .25s var(--ws-ease);
}
.news-filter__btn:hover { border-color: var(--ws-green); }
.news-filter__btn[aria-pressed="true"] {
  background: var(--ws-btn-grad);
  border-color: transparent;
  color: #fff;
}

/* The count line under the chips; it is the only thing that reports a filter
   to a screen reader, so it is a live region rather than decoration. */
.news-filter__status {
  margin: clamp(10px, 1.11vw, 16px) 0 0;
  font-size: .9375rem;
  color: #6c7478;
  text-align: center;
}

/* --------------------------------------------------------------------------
   2. Shared card furniture — the meta line, the category chip and "Read more"
   -------------------------------------------------------------------------- */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5em .75em;
  margin: 0 0 clamp(8px, .97vw, 14px);
  font-size: clamp(.75rem, .9vw, .875rem);
  color: #6c7478;
}
.post-meta__cat {
  border-radius: 999px;
  background: var(--ws-band-green);
  padding: .2em .9em;
  font-weight: 700;
  color: #34561f;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.post-meta time { white-space: nowrap; }

.post-more {
  align-self: start;
  margin-top: auto;
  padding-top: clamp(12px, 1.39vw, 20px);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ws-teal-ink);
  text-decoration: none;
}
.post-more::after {
  content: "\203A";
  margin-left: .45em;
  font-size: 1.25em;
  line-height: 0;
  vertical-align: -.08em;
  transition: transform .25s var(--ws-ease);
  display: inline-block;
}
.post-more:hover { color: var(--ws-green-mid); }
.post-more:hover::after { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   3. Featured post — the newest item, across the full 1040
   Same 520 / 40 / 480 split as media-figure.css's .media--split, so the photo
   lines up with the split rows on every other page of the site.
   -------------------------------------------------------------------------- */
.post-featured {
  display: grid;
  grid-template-columns: 520fr 480fr;
  column-gap: clamp(20px, 2.78vw, 40px);
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.post-featured__frame {
  overflow: hidden;
  border-radius: 14px;
  aspect-ratio: 520 / 340;
  box-shadow: var(--ws-card-shadow);
}
.post-featured__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ws-ease);
}
.post-featured:hover .post-featured__frame img { transform: scale(1.06); }

.post-featured__body { display: flex; flex-direction: column; }
.post-featured__flag {
  margin: 0 0 clamp(8px, .97vw, 14px);
  font-family: var(--ws-font-display);
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ws-green-mid);
}
.post-featured__title {
  margin: 0 0 clamp(10px, 1.11vw, 16px);
  font-family: var(--ws-font-body);
  font-weight: 700;
  font-size: clamp(1.375rem, 2.222vw, 2rem);
  line-height: 1.2;
  color: var(--ws-teal-ink);
}
.post-featured:hover .post-featured__title { color: var(--ws-green-mid); }
.post-featured__summary { margin: 0; font-size: 1.125rem; line-height: 1.5; }

/* --------------------------------------------------------------------------
   4. Post grid
   Three across the 1040 on a 32 gutter — the same rhythm as the Life and Work
   tile grids, at card rather than tile scale.
   -------------------------------------------------------------------------- */
.post-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.22vw, 32px);
  margin: 0;
  padding: 0;
}
.post-grid > li { display: flex; }
.post-grid > li[hidden] { display: none; }

.post-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--ws-card-shadow);
  color: inherit;
  text-decoration: none;
  transition: transform .3s var(--ws-ease), box-shadow .3s var(--ws-ease);
}
.post-card:hover,
.post-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--ws-card-shadow-hv);
  color: inherit;
}
.post-card__frame { overflow: hidden; aspect-ratio: 16 / 10; }
.post-card__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ws-ease);
}
.post-card:hover .post-card__frame img { transform: scale(1.07); }

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(16px, 1.53vw, 22px) clamp(16px, 1.53vw, 22px) clamp(18px, 1.81vw, 26px);
}
.post-card__title {
  margin: 0 0 clamp(6px, .69vw, 10px);
  font-family: var(--ws-font-body);
  font-weight: 700;
  font-size: clamp(1.0625rem, 1.389vw, 1.25rem);
  line-height: 1.25;
  color: var(--ws-teal-ink);
}
.post-card:hover .post-card__title { color: var(--ws-green-mid); }
.post-card__summary { margin: 0; font-size: 1rem; line-height: 1.5; }
/* "Read more" is a span inside the card link, not a link of its own — one card,
   one tab stop. It keeps the affordance without adding a second target. */
.post-card .post-more { padding-top: clamp(10px, 1.11vw, 16px); }

/* --------------------------------------------------------------------------
   5. Pagination — WordPress's paginate_links() shape, styled as chips
   -------------------------------------------------------------------------- */
.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(6px, .69vw, 10px);
  margin: clamp(28px, 3.33vw, 48px) 0 0;
  padding: 0;
  list-style: none;
}
.pager a,
.pager span {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 .75em;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9375rem;
  color: var(--ws-teal-ink);
  text-decoration: none;
  transition: background .25s var(--ws-ease), color .25s var(--ws-ease);
}
.pager a:hover { background: var(--ws-band-green); }
.pager [aria-current="page"] { background: var(--ws-btn-grad); color: #fff; }
.pager .is-disabled { color: #b4bcc0; }

/* --------------------------------------------------------------------------
   6. Resources band — the downloads and links list, inside .band--green
   -------------------------------------------------------------------------- */
.resource-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.53vw, 22px);
  margin: clamp(24px, 2.92vw, 42px) 0 0;
  padding: 0;
}
.resource {
  display: flex;
  align-items: flex-start;
  gap: clamp(12px, 1.25vw, 18px);
  height: 100%;
  padding: clamp(16px, 1.53vw, 22px);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--ws-card-shadow);
  color: inherit;
  text-decoration: none;
  transition: transform .3s var(--ws-ease), box-shadow .3s var(--ws-ease);
}
.resource:hover,
.resource:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--ws-card-shadow-hv);
  color: inherit;
}
.resource__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: clamp(40px, 3.33vw, 48px);
  height: clamp(40px, 3.33vw, 48px);
  border-radius: 50%;
  background: var(--ws-band-green);
  color: var(--ws-teal-ink);
  font-size: 1.125rem;
}
.resource__title {
  /* Both of these are spans inside the card link — one link, one tab stop —
     so they have to be told to be blocks. */
  display: block;
  margin: 0 0 .2em;
  font-family: var(--ws-font-body);
  font-weight: 700;
  font-size: clamp(1rem, 1.25vw, 1.125rem);
  line-height: 1.25;
  color: var(--ws-teal-ink);
}
.resource:hover .resource__title { color: var(--ws-green-mid); }
.resource__note { display: block; margin: 0; font-size: .9375rem; line-height: 1.45; color: #4c5457; }

/* --------------------------------------------------------------------------
   7. Article template
   The hero is the shared sub-page hero with a headline in it, so the title has
   to come down from the section pages' 100px display size — a real headline is
   a sentence, not a word. Roboto Black rather than Lilita for the same reason:
   Lilita at two or three lines is a poster, not a story.
   -------------------------------------------------------------------------- */
.page-hero--article .page-hero__title {
  max-width: 17ch;
  font-family: var(--ws-font-body);
  font-weight: 900;
  font-size: clamp(1.625rem, 3.264vw, 2.9375rem);
  line-height: 1.12;
}
.page-hero--article .page-hero__eyebrow {
  font-size: clamp(.9375rem, 1.25vw, 1.125rem);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ws-green);
}
.page-hero--article .post-meta {
  margin: clamp(10px, 1.11vw, 16px) 0 0;
  font-size: clamp(.875rem, 1.042vw, .9375rem);
  color: #e6eced;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
.page-hero--article .post-meta__cat {
  background: rgba(255, 255, 255, .92);
  color: var(--ws-teal-ink);
}

/* The standfirst. One size up from body copy and in teal, the same relationship
   .prose__lead-in already has to the paragraph it opens. */
.article-lead {
  font-size: clamp(1.1875rem, 1.528vw, 1.375rem) !important;
  line-height: 1.45;
  font-weight: 500;
  color: var(--ws-teal-ink);
}

/* Articles run at reading measure, not the full 1040 column. */
.wrap--article { --ws-wrap: 760px; }

.article-share {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.11vw, 16px);
  margin: clamp(28px, 3.33vw, 48px) 0 0;
  padding-top: clamp(18px, 2.08vw, 30px);
  border-top: 1px solid #dfe4e6;
}
.article-share__label { margin: 0; font-weight: 700; color: var(--ws-teal-ink); }
.article-share ul {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.article-share a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ws-teal);
  color: #fff;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .25s var(--ws-ease), background .25s var(--ws-ease);
}
.article-share a:hover { background: var(--ws-green-mid); transform: translateY(-2px); }

/* Related posts close the article, so this block pays back the footer overlap
   the way .media-block--tail does. */
.related { padding-bottom: calc(var(--ws-footer-overlap) + clamp(44px, 5.5vw, 80px)); }


/* An in-article photo. Not media-figure.css's .media--band: that is measured
   for the 1040 column and this one sits in the 760 reading measure, so it
   would be cropped to a letterbox. Radius matches the cards, not the 21.5 the
   section pages use on their placed frames. */
.article-figure { margin: 0; }
.article-figure img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border-radius: 14px;
}
.article-figure figcaption {
  margin-top: clamp(8px, .83vw, 12px);
  font-size: .9375rem;
  line-height: 1.4;
  color: #6c7478;
}


/* The resources band is the last thing on the index, so the footer's wave
   pulls up over it by its own height. Same fix, and the same number, as
   .band--cream in fun.css: no bottom wave, extra bottom padding instead. */
.band--tail .band__inner { padding-bottom: clamp(120px, 15.38vw, 221px); }

/* --------------------------------------------------------------------------
   8. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .post-featured { grid-template-columns: minmax(0, 1fr); row-gap: clamp(16px, 4vw, 24px); }
  .post-grid,
  .resource-grid { grid-template-columns: minmax(0, 1fr); }
  .page-hero--article .page-hero__title { max-width: none; }
}
