/* F4e (04 §3.1): /news (mockup docs/design/f1/a/news.html) and the post page (/news/n/{id}). Cards: site.css «Post card».
   Headings, paragraphs and figures get explicit margins here (site.css's reset gives them reboot margins). */

/* ---------- Topic chips: links, so the blue pill moves between pages with the view transition ---------- */
.news .chips { margin-bottom: var(--s2); }
.news .chips .chip { overflow-wrap: anywhere; }
/* the indicator paints the current chip (motion.css hands it over) */
.news .chip-ind { view-transition-name: news-chip; }
::view-transition-group(news-chip) { animation-duration: 420ms; animation-timing-function: var(--ease-out); }

/* ---------- Lead story ---------- */
.feature { position: relative; display: grid; grid-template-columns: 7fr 5fr; gap: var(--s7); align-items: center; margin-top: var(--s6); color: var(--ink); }
.feature > * { min-width: 0; }
.feature .ph { overflow: hidden; border-radius: var(--r-xl); background: var(--surface); }
.feature .ph img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; transition: transform var(--t-med) var(--ease); }
.feature:hover .ph img { transform: scale(1.02); }
.feature .noimg { border-radius: var(--r-xl); }
.feature .meta { margin: 0; }
.feature h2 { margin: var(--s3) 0 0; font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.625rem); font-weight: 650; line-height: 1.15; overflow-wrap: anywhere; }
.feature h2 a { color: var(--ink); text-decoration: none; }
.feature h2 a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--r-xl); }
.feature h2 a:focus-visible { outline: 0; }
.feature h2 a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 6px; }
.feature:hover h2 a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }
.feature .sum { margin: var(--s4) 0 0; color: var(--ink-2); max-width: var(--measure); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Card grid and pager ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s7) var(--s6); margin-top: var(--s8); }
.pager .gap { background: none; min-width: 0; padding: 0 4px; }
.news .empty-note { margin: var(--s5) 0 0; }

/* ---------- Post page ---------- */
/* reading progress: a hairline of logo blue along the top edge; js/pages/news.js sets --p (0..1). Shown only with JS. */
.read-progress { display: none; }
html.js .read-progress { display: block; position: fixed; top: 0; left: 0; right: 0; z-index: 11; height: 3px; background: var(--blue); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); pointer-events: none; }

.article { --col: 46rem; }
.article-head { max-width: var(--col); margin-inline: auto; padding-block: var(--s7) var(--s6); }
.article-head .crumbs { margin-bottom: var(--s5); }
.article-head .meta { margin: 0; }
.article-head .meta a { color: var(--ink-2); }
.article-head .meta a:hover { color: var(--blue); }
.article-head h1 { margin: var(--s3) 0 0; max-width: 28ch; font-size: clamp(2rem, 1.3rem + 2.4vw, 3.25rem); font-weight: 700; line-height: 1.1; letter-spacing: var(--track-head); overflow-wrap: anywhere; }
.article-head .lead { margin: var(--s4) 0 0; }
.byline { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--line); }
.byline .meta { margin: 0; }
.draft-note { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--blue-tint); color: var(--ink); font-size: var(--fs-meta); font-weight: 500; }

/* the cover is wider than the text column; the whole picture shows (posters carry text), on a surface */
.article-cover { max-width: 64rem; margin: 0 auto var(--s7); overflow: hidden; border-radius: var(--r-xl); background: var(--surface); }
.article-cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; }

/* the post body is admin HTML (CKEditor, cleaned by RichText) */
.prose { max-width: var(--col); margin-inline: auto; font-size: var(--fs-body); line-height: var(--lh-body); overflow-wrap: anywhere; }
.prose > * { margin: 0 0 1.1em; }
.prose > :last-child { margin-bottom: 0; }
.prose h2, .prose h3, .prose h4 { margin: 1.8em 0 .5em; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; }
.prose h2 { font-size: 1.75rem; }
.prose h3 { font-size: 1.375rem; }
.prose h4 { font-size: 1.1875rem; }
.prose p, .prose li { text-wrap: pretty; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--blue); text-decoration: underline; }
.prose img { display: block; max-width: 100%; height: auto; margin-block: var(--s5); border-radius: var(--r-md); }
.prose figure { margin: var(--s5) 0; }
.prose figcaption { margin-top: var(--s2); color: var(--ink-2); font-size: var(--fs-meta); }
.prose blockquote { margin-inline: 0; padding: var(--s1) 0 var(--s1) var(--s5); border-left: 4px solid var(--gold); color: var(--ink); font-size: var(--fs-lead); }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: var(--fs-meta); }
.prose th, .prose td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose iframe, .prose video { max-width: 100%; }
.prose hr { border: 0; border-top: 1px solid var(--line); opacity: 1; }

.article-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); max-width: var(--col); margin: var(--s7) auto 0; padding-top: var(--s5); border-top: 1px solid var(--line); }
.link-arrow.back:hover .ic { transform: translateX(-3px); }

.more { margin-top: var(--s9); }
.more .grid3 { margin-top: 0; }

/* ---------- Phones ---------- */
@media (max-width: 1080px) {
  .feature { grid-template-columns: 1fr; gap: var(--s5); }
  .feature .ph, .feature .noimg, .article-cover { border-radius: var(--r-lg); }
  .grid3 { grid-template-columns: 1fr; gap: var(--s6); margin-top: var(--s7); }
  .article-head { padding-block: var(--s5); }
  .article-cover { margin-bottom: var(--s6); }
  .more { margin-top: var(--s8); }
}
@media (min-width: 700px) and (max-width: 1080px) {
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .byline .btn, .article-foot .btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .feature:hover .ph img { transform: none; }
  .link-arrow.back:hover .ic { transform: none; }
}
