/* «Лента»: карточки новостей на главной (.nw-*, .nc*) и на странице /news (.nws-*). Только токены темы — светлая и тёмная работают без правок.
   Карточка — вырезка из сводки: картинка (если сервер дал адрес нашего origin) или цветная плитка с монограммой источника; цвет плитки один на источник. */

.hm-card[data-block="news"] { gap: 0; }
.nw-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; }
.nw-head__t { font-size: 15px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.nw-head__n { font-size: 12px; font-weight: 600; color: var(--accent-primary); }
.nw-head__nav { display: flex; align-items: center; gap: 6px; }
.nw-head__all { font-size: 12.5px; color: var(--accent-primary); text-decoration: none; margin-left: 6px; }
.nw-head__all:hover { text-decoration: underline; }
.nw-arrow { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 8px;
  border: 1px solid var(--border-default); background: transparent; color: var(--text-secondary); cursor: pointer; }
.nw-arrow:hover:not(:disabled) { background: var(--row-hi, var(--accent-surface)); color: var(--text-primary); }
.nw-arrow:disabled { opacity: .35; cursor: default; }
.nw-arrow:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.nw-arrow[hidden] { display: none; }

/* Лента на главной: карточки в ряд, прокрутка вбок; первая крупнее; у правого края — затухание, пока есть что листать */
.nw-strip { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 12px; scrollbar-width: thin; overscroll-behavior-x: contain; outline: none; }
.nw-strip:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; border-radius: 12px; }
.nw-strip--more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.nw-strip .nc { flex: 0 0 236px; scroll-snap-align: start; }
.nw-strip .nc--lead { flex-basis: 372px; }

/* Карточка */
.nc { position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--surface-primary); border: 1px solid var(--border-default); border-radius: 12px; transition: border-color .15s, transform .15s; }
.nc:hover { border-color: var(--accent-primary); transform: translateY(-2px); }
.nc:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.nc__media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; container-type: inline-size; background: hsl(var(--h) 30% 16%); }
.nc--lead .nc__media { aspect-ratio: 16 / 9; }
.nc__tile { position: absolute; inset: 0; display: block; background: linear-gradient(145deg, hsl(var(--h) 46% 27%), hsl(calc(var(--h) + 28) 42% 14%)); }
.nc__mono { position: absolute; left: 7%; bottom: 3%; font-family: var(--font-display); font-weight: 700; font-size: 34cqw; line-height: .8; letter-spacing: -.06em;
  color: hsl(var(--h) 62% 64% / .30); user-select: none; white-space: nowrap; }
.nc__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .25s; }
.nc__img--ok { opacity: 1; }
.nc__flag { position: absolute; top: 8px; left: 8px; width: 21px; height: 14px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); display: block; line-height: 0; }
.nc__flag svg { width: 100%; height: 100%; display: block; }
.nc__dot { position: absolute; top: 8px; right: 8px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent-primary); box-shadow: 0 0 0 3px rgba(0, 0, 0, .35); }
.nc__body { display: flex; flex-direction: column; gap: 5px; padding: 11px 13px 13px; min-width: 0; }
.nc__meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; font-size: 11.5px; color: var(--text-muted); min-width: 0; }
.nc__src { font-weight: 600; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.nc__ago::before { content: '·'; margin-right: 8px; }
.nc__new { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }      /* для экранных дикторов: точка — только картинка */
.nc__t { font-size: 14px; line-height: 1.36; font-weight: 600; color: var(--text-primary); text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.nc--lead .nc__t { font-size: 17px; line-height: 1.3; -webkit-line-clamp: 3; }
.nc--new .nc__t { font-weight: 700; }
.nc:hover .nc__t { color: var(--accent-primary); }

/* Светлая тема: плитка светлая, монограмма темнее */
[data-theme="light"] .nc__media { background: hsl(var(--h) 40% 86%); }
[data-theme="light"] .nc__tile { background: linear-gradient(145deg, hsl(var(--h) 52% 84%), hsl(calc(var(--h) + 28) 46% 72%)); }
[data-theme="light"] .nc__mono { color: hsl(var(--h) 50% 30% / .26); }
@media (prefers-color-scheme: light) {
  [data-theme="system"] .nc__media { background: hsl(var(--h) 40% 86%); }
  [data-theme="system"] .nc__tile { background: linear-gradient(145deg, hsl(var(--h) 52% 84%), hsl(calc(var(--h) + 28) 46% 72%)); }
  [data-theme="system"] .nc__mono { color: hsl(var(--h) 50% 30% / .26); }
}

/* Страница /news: сетка карточек, панель с поиском и фильтрами */
.nws-lead { margin: 0 0 14px; max-width: 64ch; color: var(--text-muted); font-size: 13.5px; }
.nws-bar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.nws-bar__row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.nws-search { flex: 1 1 280px; max-width: 420px; }
.nws-search .form-input { width: 100%; }
.nws-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nws-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.nws-chip { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-default);
  background: transparent; color: var(--text-secondary); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.nws-chip:hover:not(:disabled) { background: var(--row-hi, var(--accent-surface)); color: var(--text-primary); }
.nws-chip--on { border-color: var(--accent-primary); color: var(--accent-primary); background: var(--accent-surface); }
.nws-chip:disabled { opacity: .45; cursor: default; }
.nws-chip:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.nws-chip__sw { width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; letter-spacing: -.02em;
  background: hsl(var(--h) 46% 27%); color: hsl(var(--h) 70% 78%); }
[data-theme="light"] .nws-chip__sw { background: hsl(var(--h) 52% 84%); color: hsl(var(--h) 50% 28%); }
.nws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); grid-auto-flow: dense; gap: 16px; }
/* Первая карточка — «передовица»: две колонки и две строки, картинка тянется на всю высоту; остальные обтекают её справа */
.nws-grid .nc--lead { grid-column: span 2; grid-row: span 2; }
.nws-grid .nc--lead .nc__media { aspect-ratio: auto; flex: 1 1 auto; min-height: 260px; }
.nws-grid .nc__t { font-size: 15px; -webkit-line-clamp: 3; }
.nws-grid .nc--lead .nc__t { font-size: 19px; }
.nws-empty { padding: 8px 0; }
.nws-more { margin-top: 18px; }
.nws-more[hidden] { display: none; }
.nws-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.nws-presets .form-label { margin: 0; }
.nws-presets .form-input { width: auto; min-width: 200px; }

@media (max-width: 640px) {
  .nw-strip .nc { flex-basis: 72vw; }
  .nw-strip .nc--lead { flex-basis: 84vw; }
  .nw-arrow { display: none; }
  .nws-grid { grid-template-columns: minmax(0, 1fr); }
  .nws-grid .nc--lead { grid-column: auto; grid-row: auto; }
  .nws-grid .nc--lead .nc__media { aspect-ratio: 16 / 9; flex: none; min-height: 0; }
  .nws-search { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .nc, .nc__img { transition: none; } .nc:hover { transform: none; } }
