/* Новости, Новость, Статьи, Проекты — фреймы «5 Новости» 2004-1844 / 2004-2126 (1440), «5 Новости м» 2004-3582 / 2004-3369 (375),
   «5.1 Новость» 2004-2438 / 2004-4526, «6 Статьи» 2004-2570 (+ варианты 2004-2702, 2004-2854). Числа из макета. */

/* ---------- Кадрирование фото: в макете вертикальные кадры увеличены и сдвинуты внутри рамки 3:2 (одинаково во всех фреймах) ---------- */
.ph { position: relative; overflow: hidden; aspect-ratio: 400 / 267; background: var(--c-line); }
.ph img { position: absolute; max-width: none; height: auto; width: var(--w); left: var(--x); top: var(--y); }
.ph--1ae560 { --w: 177.53%; --x: -25.69%; --y: -209.46%; }
.ph--1c1e05 { --w: 109.56%; --x: -0.5%; --y: -81.82%; }
.ph--57c4fe { --w: 104.78%; --x: -3.7%; --y: -83.93%; }
.ph--7a96ca { --w: 110.21%; --x: -4.41%; --y: -87.71%; }
.ph--cb2f43 { --w: 101.81%; --x: -0.91%; --y: -112.33%; }
.ph--61ddfe { --w: 107.41%; --x: -1.16%; --y: -2.05%; }

/* ---------- Заголовок страницы: H 72/88 + подпись капсом 11/19 +6% ---------- */
.phead { display: flex; justify-content: space-between; align-items: flex-start; padding-top: 78px; padding-bottom: 84px; }
.phead__lead { font: 500 11px/19px var(--f-text); letter-spacing: .06em; text-transform: uppercase; width: 551px; padding-right: 132px; margin-top: 24px; }
.wrap > .line { border-top: 1px solid var(--c-line); }

/* ---------- Плашки тем (фильтр и метки карточек) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 16px;
  border: 1px solid var(--c-line); border-radius: 4px; background: #fff; color: var(--c-accent);
  font: 500 11px/1 var(--f-text); letter-spacing: .01em; text-transform: uppercase; white-space: nowrap;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip[aria-pressed="true"] { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
@media (hover: hover) { .chip:hover { border-color: var(--c-accent); } }

/* ---------- Фильтр + поиск ---------- */
.nfilter { display: grid; grid-template-columns: minmax(0, 639fr) minmax(0, 681fr); gap: 0 40px; align-items: start; padding-top: 40px; padding-bottom: 96px; }
.nfilter .chips { max-width: 560px; }
.nsearch { position: relative; display: flex; align-items: center; height: 72px; border: 1px solid var(--c-line); }
.nsearch input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; border-radius: 0; -webkit-appearance: none; appearance: none;
  padding: 0 72px 0 31px; font: 500 11px/19px var(--f-text); letter-spacing: .06em; text-transform: uppercase; color: var(--c-text);
}
.nsearch input::placeholder { color: var(--c-text); opacity: 1; }
.nsearch input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.nsearch:focus-within { border-color: var(--c-accent); }
.nsearch .ibtn { position: absolute; right: 15px; top: 15px; width: 40px; height: 40px; }
.nsearch .ibtn .i { width: 20px; height: 20px; }

/* ---------- Сетка карточек новостей: колонки 440 / 480 / 440, поля 0-40 / 40-40 / 40-0 ---------- */
.ngrid { display: grid; grid-template-columns: 440fr 480fr 440fr; border-bottom: 1px solid var(--c-line); }
.nc { position: relative; display: flex; flex-direction: column; padding: 48px 40px 48px 40px; border-top: 1px solid var(--c-line); min-width: 0; }
.ngrid > .nc:nth-child(3n + 1 of .nc:not([hidden])) { padding-left: 0; }
.ngrid > .nc:nth-child(3n + 2 of .nc:not([hidden])), .ngrid > .nc:nth-child(3n of .nc:not([hidden])) { border-left: 1px solid var(--c-line); }
.ngrid > .nc:nth-child(3n of .nc:not([hidden])) { padding-right: 0; }
.ndate { display: flex; align-items: flex-start; gap: 8px; height: 32px; color: var(--c-accent); }
.ndate__d { font: 300 40px/28px var(--f-head); letter-spacing: .02em; }
.ndate__m { font: 500 11px/12px var(--f-text); letter-spacing: .01em; }
.nc .ph { margin-top: 40px; }
.nc__title { margin-top: 31px; max-width: 389px; font: 300 24px/34px var(--f-head); letter-spacing: .02em; text-transform: uppercase; }
.nc--text .nc__title { margin-top: 39px; }
.nc__title a::after { content: ''; position: absolute; inset: 0; z-index: 0; }
.nc__tags { position: relative; z-index: 1; margin-top: auto; padding-top: 42px; }
.nc--text .nc__tags { padding-top: 58px; }
.nc__title a { transition: color .2s; }
@media (hover: hover) { .nc:hover .nc__title a { color: var(--c-accent); } }

/* ---------- Постраничная навигация ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 24px; padding: 64px var(--gutter) 140px; }
.pager__nums { display: flex; gap: 6px; }
.pager a, .pager button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: var(--c-accent); font: 500 11px/1 var(--f-text); letter-spacing: .01em; transition: background-color .2s, color .2s; }
.pager .i { width: 16px; height: 16px; }
.pager [aria-current="page"] { background: var(--c-accent); color: #fff; }
.pager [aria-disabled="true"] { opacity: .3; pointer-events: none; }
@media (hover: hover) { .pager a:not([aria-current]):hover, .pager button:not([aria-current]):hover { background: var(--c-soft); } }
.nempty { padding: 64px 0 140px; text-align: center; }
.ngrid:not(:has(> .nc:not([hidden]))), .alist:not(:has(> .ac:not([hidden]))) { border-bottom: 0; }
.nempty[hidden] { display: none; }

/* ---------- Статьи: вариант A (макет 2004-2570) — фото 664 слева, текст справа ---------- */
.alist { border-bottom: 1px solid var(--c-line); }
.ac { position: relative; display: grid; grid-template-columns: 664fr 64fr 632fr; padding: 48px 0; border-top: 1px solid var(--c-line); }
.alist > .ac:first-child { border-top: 0; }
.ac .ph { grid-column: 1; aspect-ratio: 664 / 442; }
.ac__body { grid-column: 3; display: flex; flex-direction: column; align-items: flex-start; padding-top: 21px; max-width: 516px; }
.ac .ndate { height: auto; gap: 0; }
.ac .ndate__d { font: 500 11px/13px var(--f-text); letter-spacing: .01em; }
.ac .ndate__d::after { content: '.'; }
.ac .ndate__m { line-height: 13px; }
.ac__title { margin-top: 13px; max-width: 389px; font: 300 24px/34px var(--f-head); letter-spacing: .02em; text-transform: uppercase; }
.ac__title a::after { content: ''; position: absolute; inset: 0; }
.ac__text { margin-top: 28px; color: #262626; }
.ac__btn { position: relative; z-index: 1; margin-top: 58px; display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border-radius: 4px; background: var(--c-accent); color: #fff; border: 1px solid var(--c-accent); font: 500 11px/1 var(--f-text); letter-spacing: .01em; text-transform: uppercase; transition: background-color .2s, color .2s; }
.ac .nc__tags { display: none; }
.ac__title a { transition: color .2s; }
@media (hover: hover) {
  .ac:hover .ac__title a { color: var(--c-accent); }

}
.afilter { display: none; }

/* Вариант B (2004-2702): дата слева, фото 432, текст 516; кнопка по низу фото */
.alist--b .ac { grid-template-columns: 232fr 432fr 148fr 548fr; }
.alist--b .ac .ndate { grid-column: 1; grid-row: 1; height: 32px; gap: 8px; }
.alist--b .ac .ndate__d { font: 300 40px/28px var(--f-head); letter-spacing: .02em; }
.alist--b .ac .ndate__d::after { content: none; }
.alist--b .ac .ndate__m { line-height: 12px; }
.alist--b .ac .ph { grid-column: 2; grid-row: 1; aspect-ratio: 432 / 288; }
.alist--b .ac__body { grid-column: 4; grid-row: 1; display: contents; }
.alist--b .ac__title, .alist--b .ac__text, .alist--b .ac__btn { grid-column: 4; }
.alist--b .ac__body .ndate { grid-column: 1; }
.alist--b .ac { grid-template-rows: auto auto 1fr; }
.alist--b .ac .ph { grid-row: 1 / 4; }
.alist--b .ac__title { grid-row: 1; margin-top: -9px; }
.alist--b .ac__text { grid-row: 2; margin-top: 30px; max-width: 516px; }
.alist--b .ac__btn { grid-row: 3; align-self: end; justify-self: start; }

/* Вариант C (2004-2854): фильтр, две колонки текстовых карточек с метками */
.afilter--on { display: grid; padding-bottom: 106px; }
.alist--c { display: grid; grid-template-columns: 679fr 681fr; }
.alist--c .ac { display: grid; grid-template-columns: 189px 1fr; grid-template-rows: auto 1fr; padding: 48px 0; border-top: 1px solid var(--c-line); }
.alist--c > .ac:first-child { border-top: 1px solid var(--c-line); }
.alist--c > .ac:nth-child(even) { border-left: 1px solid var(--c-line); padding-left: 37px; }
.alist--c .ac .ph, .alist--c .ac__btn { display: none; }
.alist--c .ac__body { display: contents; }
.alist--c .ac .ndate { grid-column: 1; grid-row: 1; height: 32px; gap: 8px; }
.alist--c .ac .ndate__d { font: 300 40px/28px var(--f-head); letter-spacing: .02em; }
.alist--c .ac .ndate__d::after { content: none; }
.alist--c .ac .ndate__m { line-height: 12px; }
.alist--c .ac__title, .alist--c .ac__text { grid-column: 2; }
.alist--c .ac__title { grid-row: 1; margin-top: -9px; }
.alist--c .ac__text { grid-row: 2; align-self: start; margin-top: 30px; max-width: 437px; }
.alist--c .ac .nc__tags { display: flex; grid-column: 1 / -1; grid-row: 3; padding-top: 56px; }

/* ---------- Новость ---------- */
.crumbs { display: flex; align-items: center; gap: 16px; padding-top: 31px; font: 500 11px/13px var(--f-text); letter-spacing: .01em; text-transform: uppercase; }
.crumbs .i { width: 10px; height: 10px; color: var(--c-accent); }
.crumbs a { transition: color .2s; }
@media (hover: hover) { .crumbs a:hover { color: var(--c-accent); } }
.ahead { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 896px) minmax(0, 1fr); padding-top: 38px; padding-bottom: 54px; border-bottom: 1px solid var(--c-line); }
.ahead .ndate { margin-top: 14px; }
.ahead__title { grid-column: 2; max-width: 780px; font: 300 40px/56px var(--f-head); text-transform: uppercase; }
.ahead .nc__tags { display: none; }
.article { padding-top: 58px; }
.article > * { width: 580px; max-width: 100%; margin-inline: auto; }
.article p, .article ul { color: #262626; }
.article p + p { margin-top: 22px; }
.article h2 { margin-top: 57px; font: 300 24px/34px var(--f-head); letter-spacing: .02em; text-transform: uppercase; }
.article h2 + * { margin-top: 28px; }
.article .article__fig { width: 896px; margin-top: 66px; margin-bottom: 0; }
.article .article__fig + h2 { margin-top: 63px; }
.article .article__fig .ph { aspect-ratio: 896 / 597; }
.article ul { margin-top: 22px; }
.article ul li { position: relative; padding-left: 0; }
.article ul li::before { content: '•'; position: absolute; left: 0; }
.article ul li { padding-left: 16px; }
.article ul + p { margin-top: 36px; }
.related__head { padding: 132px var(--gutter) 42px; }
.backlink { display: flex; justify-content: center; padding: 64px var(--gutter) 140px; }
.backlink a { display: inline-flex; align-items: center; gap: 16px; color: var(--c-accent); font: 500 11px/13px var(--f-text); letter-spacing: .03em; text-transform: uppercase; }
.backlink .ibtn .i { width: 16px; height: 16px; }
@media (hover: hover) { .backlink a:hover .ibtn { background: #fff; color: var(--c-accent); box-shadow: inset 0 0 0 1px var(--c-accent); } }

/* ---------- 1024–1279: подпись заголовка уже ---------- */
@media (max-width: 1279px) {
  .phead__lead { padding-right: 0; width: 420px; }
  .nfilter { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- Мобильная раскладка (375): «5 Новости м», «5.1 Новость м» ---------- */
@media (max-width: 1023px) {
  .phead { flex-direction: column; padding-top: 38px; padding-bottom: 59px; }
  .phead__title { font-size: 40px; line-height: 48px; }
  .phead__lead { width: auto; max-width: 327px; padding-right: 0; margin-top: 52px; }
  .wrap.line-wrap { padding-inline: 0; }

  .nfilter { display: flex; flex-direction: column; align-items: stretch; padding: 0; gap: 0; }
  .nfilter .nsearch { order: -1; margin-inline: calc(-1 * var(--gutter)); height: 64px; border-left: 0; border-right: 0; }
  .nsearch input { padding: 0 72px 0 var(--gutter); }
  .nsearch .ibtn { right: var(--gutter); top: 11px; }
  .nfilter .chips { padding: 48px 0 64px; }
  .nfilter .chip { height: 24px; padding: 0 12px; }

  .ngrid { display: block; margin-inline: calc(-1 * var(--gutter)); }
  .ngrid > .nc { padding: 32px var(--gutter) 32px !important; border-left: 0 !important; }
  .nc .ph { margin-top: 32px; }
  .nc__title { margin-top: 24px; font-size: 20px; line-height: 28px; }
  .nc--text .nc__title { margin-top: 40px; }
  .nc__tags, .nc--text .nc__tags { padding-top: 60px; }
  .nc__tags .chip { padding: 0 12px; }

  .pager { justify-content: space-between; gap: 0; padding: 64px var(--gutter) 96px; }
  .pager__nums { gap: 10px; }
  .pager__nums > :nth-child(n + 6) { display: none; }

  .alist { margin-inline: calc(-1 * var(--gutter)); }
  .alist .ac, .alist--b .ac, .alist--c .ac { display: flex; flex-direction: column; align-items: flex-start; padding: 32px var(--gutter); border-left: 0; border-top: 1px solid var(--c-line); }
  .alist > .ac:first-child { border-top: 0; }
  .alist--c { display: block; }
  .ac .ph, .alist--b .ac .ph { order: 1; align-self: stretch; aspect-ratio: 400 / 267; margin-top: 32px; }
  .ac__body, .alist--b .ac__body, .alist--c .ac__body { display: contents; }
  .ac .ndate, .alist--b .ac .ndate { order: 0; height: 32px; gap: 8px; }
  .ac .ndate__d { font: 300 40px/28px var(--f-head); letter-spacing: .02em; }
  .ac .ndate__d::after { content: none; }
  .ac .ndate__m { line-height: 12px; }
  .ac__title, .alist--b .ac__title, .alist--c .ac__title { order: 2; margin-top: 24px; font-size: 20px; line-height: 28px; }
  .alist--c .ac__title { margin-top: 40px; }
  .ac__text, .alist--b .ac__text, .alist--c .ac__text { order: 3; margin-top: 16px; }
  .ac__btn, .alist--b .ac__btn { order: 4; margin-top: 32px; }
  .alist--c .ac .nc__tags { order: 4; padding-top: 32px; }

  .crumbs { padding-top: 30px; }
  .ahead { display: flex; flex-direction: column; padding: 47px 0 0; border-bottom: 0; }
  .ahead .ndate { margin-top: 0; }
  .ahead__title { margin-top: 32px; font-size: 24px; line-height: 34px; }
  .ahead__title br { display: none; }
  .ahead .nc__tags { display: flex; padding-top: 48px; }
  .article { padding-top: 59px; }
  .article > * { width: auto; }
  .article h2 { margin-top: 52px; font-size: 20px; line-height: 28px; }
  .article h2 + * { margin-top: 28px; }
  .article .article__fig { width: auto; max-width: none; margin: 58px calc(-1 * var(--gutter)) 0; }
  .article ul li { padding-left: 13px; }
  .article h2 br { display: none; }
  .article ul li::before { left: -2px; }
  .article .article__fig + h2 { margin-top: 57px; }
  .article .article__fig .ph { aspect-ratio: 375 / 250; }

  .related__head { padding: 105px var(--gutter) 42px; }
  .backlink { padding: 48px var(--gutter) 96px; }
}

/* Скрытые фильтром карточки и служебные состояния */
.nc[hidden], .ac[hidden], .pager[hidden] { display: none !important; }
.afilter:not(.afilter--on) { display: none !important; }
.ac__btn { pointer-events: none; }
@media (hover: hover) { .ac:hover .ac__btn { background: #fff; color: var(--c-accent); } }
/* Высота карточки на десктопе постоянная, как в макете (ряд из коротких заголовков не проседает) */
@media (min-width: 1024px) {
  .ngrid > .nc { min-height: 643px; }
  .ngrid > .nc--text { min-height: 361px; }
}
@media (max-width: 1023px) {
  .wrap > .line { margin-inline: calc(-1 * var(--gutter)); }
  .nfilter .nsearch { border-top: 0; }
  .alist--b .ac__btn { align-self: flex-start; }
  .alist--c > .ac:nth-child(even) { padding-left: var(--gutter); border-left: 0; }
  .afilter--on { padding-bottom: 0; }
  .alist--c > .ac:first-child { border-top: 1px solid var(--c-line); }
}
/* До запуска скрипта видна только первая страница; без скриптов — весь список, без переключателя страниц */
html.js [data-feed]:not(.is-ready) [data-feed-list] > [data-page]:not([data-page="1"]) { display: none; }
@media (max-width: 1023px) { html.js [data-feed-mobile]:not(.is-ready) [data-feed-list] > [data-page="1"]:nth-child(n+7) { display: none; } }
html:not(.js) [data-feed-pager] { display: none; }
