/* News listing + article. Loaded after main.css, projects.css (hero, news card,
   lightbox, links), services.css (reveal) and, on the article, project-detail.css (hero, facts,
   mosaic, next band). Every class here is prefixed nw-. */

/* ---------- Listing ---------- */
.nw-hero { min-height: min(62vh, 560px); }

/* Category links: real links (work without JS), styled as a sticky underline tab row */
.nw-filter {
  position: sticky; top: var(--header-h); z-index: 40;
  background: rgba(255,255,255,.98); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.nw-filter ul { display: flex; gap: 4px; list-style: none; padding: 0; margin: 0; overflow-x: auto; scrollbar-width: none; }
.nw-filter ul::-webkit-scrollbar { display: none; }
.nw-filter a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 60px; padding: 0 18px;
  font-size: .875rem; font-weight: 700; color: var(--steel); text-decoration: none; white-space: nowrap; transition: color .2s;
}
.nw-filter li:first-child a { padding-left: 0; }
.nw-filter a span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--mist); font-size: .6875rem; color: var(--charcoal); }
.nw-filter a::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; background: var(--oxblood); transform: scaleX(0); transform-origin: left; transition: transform .4s var(--px-ease); }
.nw-filter li:first-child a::after { left: 0; }
.nw-filter a:hover, .nw-filter a[aria-current="page"] { color: var(--black); }
.nw-filter a[aria-current="page"]::after { transform: scaleX(1); }
.nw-filter a[aria-current="page"] span { background: var(--oxblood); color: #fff; }
.nw-filter a.is-empty { color: var(--rule); }
.nw-filter a.is-empty span { background: var(--px-soft); color: var(--steel); }

.nw-section { padding-block: clamp(40px, 6vw, 80px) var(--section-y); background: #fff; }

/* Feature: the newest post in the current filter */
.nw-feature { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; margin-bottom: clamp(48px, 6vw, 88px); }
.nw-feature__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--px-radius); background: var(--mist); }
.nw-feature__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--px-ease); }
.nw-feature .nw-card__meta { margin-top: 0; }
.nw-feature__title { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.6rem); font-weight: 800; line-height: 1.12; letter-spacing: -.01em; }
.nw-feature__title a { color: var(--black); text-decoration: none; }
.nw-feature__title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nw-feature__excerpt { margin: 18px 0 0; max-width: 52ch; font-size: 1.0625rem; color: var(--charcoal); }
.nw-feature__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--rule); font-size: .875rem; color: var(--steel); }
@media (hover: hover) { .nw-feature:hover .nw-feature__media img { transform: scale(1.04); } }

/* Equal three-up list (no lead card) for the rest of the posts and "More news" */
.nw-list--even { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Article ---------- */
.nw-title { max-width: 24ch; font-size: clamp(1.9rem, 1rem + 3.4vw, 3.8rem); }
.nw-facts__link { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.4); }
.nw-facts__link:hover { text-decoration-color: #fff; }
.nw-article { padding-block: var(--section-y) clamp(32px, 4vw, 56px); background: #fff; }
.nw-article__col { max-width: calc(68ch + var(--gutter) * 2); }
.nw-article__col p { font-size: 1.0625rem; line-height: 1.75; }
.nw-article__lead { margin-bottom: 28px; max-width: none; }
.nw-article__col .nw-article__lead { font-size: clamp(1.35rem, 1rem + 1.3vw, 2rem); line-height: 1.3; }
.nw-article__cta { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--rule); font-weight: 600; }
.nw-article__cta a { color: var(--oxblood); }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .nw-feature { grid-template-columns: 1fr; }
  .nw-list--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .nw-filter a { min-height: 52px; padding: 0 12px; }
  .nw-filter a::after { left: 12px; right: 12px; }
  .nw-list--even { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .nw-feature__media img, .nw-filter a::after { transition: none; }
}
