/* News: home preview, News page, daily editions and monthly archive (Masonry Red, docs/design/README.md) */

/* section header shared by the home preview and the Daily page */
.macro-news { margin: var(--mr-space-section) 0; }
.news-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.news-heading h2 { margin: 0; padding: 0; border: 0; font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -1.2px; }
html[lang="zh-Hans"] .news-heading h2 { letter-spacing: 0; line-height: 1.35; }
.news-heading p { color: var(--ink-3); font-size: 14px; margin: 6px 0 0; }

/* a story is an editorial card: topic chip and time, headline, short excerpt, then sources and
   related series. Cards keep the ranked order left to right, top to bottom. */
.news-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--mr-space-lg); margin-top: var(--mr-space-xl); }
.news-story { display: flex; flex-direction: column; min-width: 0; padding: var(--mr-space-xl); border-radius: var(--mr-radius-md); background: var(--mr-surface-card); }
/* the lead story spans the row; an odd last card does too, so no row is left half-empty */
.news-list > .news-story:first-child, .news-list > .news-story:last-child:nth-child(even) { grid-column: 1 / -1; }
.news-list > .news-story:first-child h3 { font-size: 22px; line-height: 1.4; }
.news-story[hidden], .news-rows li[hidden] { display: none; }
.news-story h3 { margin: var(--mr-space-md) 0 var(--mr-space-sm); font-size: 18px; font-weight: 600; line-height: 1.45; text-wrap: pretty; }
.news-story h3 a { color: var(--ink); }
.news-meta { display: flex; gap: var(--mr-space-xs) var(--mr-space-md); flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.news-topic { font-weight: 700; color: var(--ink); }
.news-story .news-topic, .edition-body .news-topic { padding: var(--mr-space-xxs) var(--mr-space-md); border-radius: var(--mr-radius-full); background: var(--mr-canvas); font-size: 12px; line-height: 1.4; }
.edition-body .news-topic { background: var(--surface-2); }
.news-count { color: inherit; }
.news-badge { font-size: 11px; font-weight: 700; line-height: 1.4; padding: var(--mr-space-xxs) var(--mr-space-sm); border-radius: var(--mr-radius-full); background: var(--mr-secondary-bg); color: var(--ink-2); }
.news-hot { background: var(--ink); color: var(--page); }
.news-excerpt { max-width: 72ch; margin: 0; font-size: 14px; line-height: 1.65; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-links { display: flex; gap: var(--mr-space-xs) var(--mr-space-md); flex-wrap: wrap; align-items: center; margin-top: auto; padding-top: var(--mr-space-lg); font-size: 12px; color: var(--ink-3); }
.news-links a { color: var(--ink-2); }
/* a related public series is a data link: shown as a quiet chip */
.news-links a.news-data { padding: var(--mr-space-xxs) var(--mr-space-md); border-radius: var(--mr-radius-full); background: var(--mr-canvas); color: var(--ink); font-weight: 700; }
.news-links a.news-data:hover { text-decoration: none; }
.news-links a.news-data:active { background: var(--mr-secondary-bg); }
.news-story a, .news-rows a, .news-index a { text-decoration: none; }
.news-story h3 a:hover, .news-rows a:hover, .news-index a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* the Daily page shows twelve stories across the full width */
.page-daily .news-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.page-daily .news-list > .news-story:first-child, .page-daily .news-list > .news-story:last-child:nth-child(even) { grid-column: auto; }
.page-daily .news-list > .news-story:first-child h3 { font-size: 18px; }

/* News page */
.news-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin: 8px 0 0; }
.news-page-head h1 { margin: 0 0 8px; }
.news-page-head .news-tabs { margin: 0; }
.news-search { margin: 24px 0 0; }
.news-search:has(#news-search[hidden]), .news-search:has(#news-search:empty) { display: none; }
.news-columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.news-columns .macro-news { margin-top: var(--mr-space-xxl); }
.news-columns .macro-news > h2 { margin-top: 0; }
/* sidebar: a soft card instead of heavy rules */
.news-side { position: sticky; top: calc(var(--mr-nav-h) + var(--mr-space-xl)); margin-top: var(--mr-space-xxl); padding: var(--mr-space-sm) var(--mr-space-xl) var(--mr-space-lg); border-radius: var(--mr-radius-md); background: var(--surface-2); }
.news-side section + section { border-top: 1px solid var(--rule); }
.news-side h2 { margin: 16px 0 8px; padding: 0; border: 0; font-size: 18px; }
.news-index { list-style: none; padding: 0; margin: 0 0 8px; font-size: 14px; line-height: 1.5; }
.news-index li { padding: 8px 0; }
.news-index li + li { border-top: 1px solid var(--rule); }
.news-index a { color: var(--ink); font-weight: 600; }
.news-index small { color: var(--ink-3); }

/* all updates: a dense dated list with a pill topic filter */
.news-all { margin: var(--mr-space-section) 0; }
.news-all-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.news-all-head .mr-chips { margin: 0; max-width: 100%; }
.news-all-head h2 { margin: 0; padding: 0; border: 0; }
.news-rows { list-style: none; padding: 0; margin: 16px 0; }
.news-rows li { display: grid; grid-template-columns: 92px 136px minmax(0, 1fr) auto; gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 14px; line-height: 1.6; align-items: baseline; }
.news-rows a { color: var(--ink); }
.news-rows .news-topic { font-size: 12px; }
.news-rows time { white-space: nowrap; }
.news-rows time, .news-pub { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.news-pub { text-align: right; }
.news-row-title { font-size: 14px; font-weight: 400; margin: 0; line-height: 1.6; }
.news-row-summary { grid-column: 3 / 5; max-width: 80ch; margin: 0; font-size: 13px; color: var(--ink-3); }

/* daily edition and monthly archive */
.news-edition, .news-archive { max-width: 860px; margin: 8px 0 0; }
.news-back { margin: 0 0 16px; font-size: 14px; }
.news-back a { font-weight: 700; color: var(--ink); }
.news-back a::before { content: "‹ "; }
.news-edition h1 small { display: inline-block; vertical-align: middle; margin-left: 8px; padding: var(--mr-space-xxs) var(--mr-space-md); border-radius: var(--mr-radius-full); background: var(--surface-2); font: 700 13px/1.4 var(--mr-font); letter-spacing: 0; color: var(--ink-2); }
.edition-body { list-style: none; counter-reset: story; margin: 32px 0 0; padding: 0; }
.edition-body li { counter-increment: story; position: relative; padding: var(--mr-space-xl) 0 var(--mr-space-xl) calc(var(--mr-space-xxl) + var(--mr-space-lg)); border-top: 1px solid var(--rule); }
.edition-body li::before { content: counter(story); position: absolute; left: 0; top: var(--mr-space-xl); display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--mr-radius-full); background: var(--surface-2); font: 700 14px/1 var(--mr-font); color: var(--ink); font-variant-numeric: tabular-nums; }
.edition-body h2 { margin: 6px 0; padding: 0; border: 0; font-size: 19px; font-weight: 600; line-height: 1.45; }
.edition-body h2 a { color: var(--ink); }
.edition-body p { max-width: 72ch; margin: 4px 0; font-size: 14px; line-height: 1.7; color: var(--ink-3); }
.news-edition > h2 { margin-top: var(--mr-space-section); }

.news-empty { color: var(--ink-3); }

@media (max-width: 1100px) { .page-daily .news-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .news-columns { grid-template-columns: 1fr; gap: 0; }
  .news-side { position: static; }
}
@media (max-width: 640px) {
  .news-list, .page-daily .news-list { grid-template-columns: minmax(0, 1fr); gap: var(--mr-space-md); }
  .news-story { padding: var(--mr-space-lg); }
  .news-list > .news-story:first-child h3 { font-size: 19px; }
}
@media (max-width: 540px) {
  .news-heading { display: block; }
  .news-heading h2 { font-size: 24px; }
  .news-heading > .mr-btn { margin-top: 8px; }
  .news-story h3 { font-size: 17px; }
  .news-rows li { grid-template-columns: auto 1fr; gap: 2px 12px; }
  .news-rows .news-row-title, .news-rows li > a, .news-row-summary { grid-column: 1 / -1; }
  .news-pub { text-align: left; grid-column: 1 / -1; }
  .news-all-head { flex-wrap: wrap; }
  .edition-body li { padding-left: calc(var(--mr-space-xxl) + var(--mr-space-md)); }
  .edition-body li::before { width: 28px; height: 28px; font-size: 13px; }
}

/* Pagefind search box, themed with the site tokens */
#news-search { --pagefind-ui-scale: .85; --pagefind-ui-primary: var(--ink); --pagefind-ui-text: var(--ink); --pagefind-ui-background: var(--surface); --pagefind-ui-border: var(--rule); --pagefind-ui-tag: var(--surface-2); --pagefind-ui-border-width: 1px; --pagefind-ui-border-radius: 16px; --pagefind-ui-font: var(--mr-font); }
#news-search .pagefind-ui__result-excerpt, #news-search .pagefind-ui__message { color: var(--ink-2); }
#news-search mark { background: var(--mr-secondary-bg); color: var(--ink); }

/* Optional, clearly labelled model news explanation; light-first Masonry Red. */
.news-why{font-size:13px;line-height:1.7;margin:8px 0 0;color:var(--ink-2)}.news-why strong{font-weight:600}.news-row-why{grid-column:3/5;margin:0}
.ai-tag{display:inline-block;font-size:12px;font-weight:700;letter-spacing:.04em;line-height:1;padding:var(--mr-space-xxs) var(--mr-space-xs);margin:0 4px;border:1px solid var(--rule);border-radius:var(--mr-radius-full);color:var(--muted);vertical-align:1px;cursor:help}
@media(max-width:540px){.news-row-why{grid-column:auto}}
.news-facts { display: flex; flex-wrap: wrap; gap: var(--mr-space-xs) var(--mr-space-md); margin-top: var(--mr-space-sm); font-size: 12px; color: var(--ink-3); }
.news-fact strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.news-action { color: var(--ink); font-weight: 600; }
