/* =====================================================================
   Новости: лента и страница новости (брендбук «Латунь»)
   ===================================================================== */

.page { padding-top: var(--s-7); }
.page-head { margin-bottom: var(--s-6); }
.page-head h1 { margin-bottom: var(--s-2); }
.page-head .lead { margin: 0; }

.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: var(--fs-xs); color: var(--c-text-faint); }

/* Свежая новость крупно */
.news-lead { display: grid; gap: var(--s-5); padding-bottom: var(--s-6); margin-bottom: var(--s-2); }
.news-lead img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-2); }
.news-lead h2 { margin: var(--s-2) 0 var(--s-3); font-size: var(--fs-2xl); }
.news-lead h2 a { color: var(--c-text); text-decoration: none; }
.news-lead h2 a:hover { color: var(--c-accent-hover); }
.news-lead p { color: var(--c-text-muted); }
@media (min-width: 1024px) { .news-lead { grid-template-columns: 7fr 5fr; align-items: center; gap: var(--s-7); } }

.news-item__noimg { display: block; aspect-ratio: 4 / 3; border-radius: var(--r-2); background: var(--c-surface); }

/* Фильтр-ссылки: тот же вид, что у кнопок-фильтров */
a.chip { display: inline-flex; align-items: center; text-decoration: none; }
a.chip[aria-current="page"] { color: var(--c-on-accent); background: var(--c-accent); border-color: var(--c-accent); }

/* Типы новостей: обновление — главное (залито латунью), патч — контур латуни, событие — второй акцент */
.type--update { color: var(--c-on-accent); background: var(--c-accent); border-color: var(--c-accent); }
.type--patch  { color: var(--c-accent); }
.type--event  { color: var(--c-accent-2); }
.type--info   { color: var(--c-text-faint); }

/* ---------- Пейджер: наверху и внизу ленты ---------- */
.pager { display: grid; gap: var(--s-3); margin: var(--s-5) 0; }
.pager-top .pager { margin-top: 0; }
.pager__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.pager__info { color: var(--c-text-muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pager__step { padding: 0 var(--s-4); }
.pager__step[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.pager__nums { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1); }
.pager__num {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; min-height: 40px; padding: 0 var(--s-2);
    font: 500 var(--fs-sm) var(--f-text); font-variant-numeric: tabular-nums;
    color: var(--c-text-muted); text-decoration: none;
    border: 1px solid transparent; border-radius: var(--r-1);
    transition: color var(--t-fast), border-color var(--t-fast);
}
a.pager__num:hover { color: var(--c-text); border-color: var(--c-line-strong); }
.pager__num[aria-current="page"] { color: var(--c-on-accent); background: var(--c-accent); border-color: var(--c-accent); font-weight: 600; }
.pager__gap { padding: 0 var(--s-1); color: var(--c-text-faint); }
/* Телефон: кнопки, «N из M» и только ближние номера */
@media (max-width: 639px) {
    .pager__far { display: none; }
    .pager__nums { justify-content: center; }
}
@media (min-width: 640px) {
    .pager { grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-4); }
    .pager__row { display: contents; }
    .pager__info { display: none; }
    .pager__row .pager__step:first-child { grid-column: 1; grid-row: 1; }
    .pager__row .pager__step:last-child { grid-column: 3; grid-row: 1; }
    .pager__nums { grid-column: 2; grid-row: 1; justify-content: center; }
    }

/* ---------- Страница новости ---------- */
.article { max-width: calc(var(--w-read) + 2 * var(--gutter)); }
.crumbs { display: flex; gap: var(--s-2); font-size: var(--fs-sm); color: var(--c-text-faint); margin-bottom: var(--s-4); }
.crumbs a { color: var(--c-text-muted); text-decoration: none; }
.crumbs a:hover { color: var(--c-text); }
.article__head { margin-bottom: var(--s-6); }
.article__head h1 { margin-bottom: var(--s-3); }
.article__share { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--c-line); }

/* Текст новости. Старые записи несут разметку прошлой вёрстки — выравниваем её здесь */
.prose { font-size: var(--fs-md); line-height: 1.7; overflow-wrap: anywhere; }
.prose p { margin: 0 0 var(--s-4); max-width: none; text-indent: 0 !important; text-align: left !important; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--f-text); font-weight: 600; letter-spacing: 0; margin: var(--s-6) 0 var(--s-3); }
.prose h1, .prose h2 { font-size: var(--fs-xl); }
.prose h3, .prose h4 { font-size: var(--fs-lg); }
.prose img { display: block; max-width: 100% !important; height: auto !important; margin: var(--s-5) auto; border-radius: var(--r-2); cursor: zoom-in; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 var(--s-4); }
.prose li { margin-bottom: var(--s-1); }
.prose a { word-break: break-word; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); margin: var(--s-4) 0; display: block; overflow-x: auto; }
.prose td, .prose th { padding: var(--s-2) var(--s-3); border: 1px solid var(--c-line); }
.prose center { text-align: center; }
/* разметка прошлой вёрстки внутри текста не должна задавать ширину и отступы */
.prose .container, .prose .row, .prose [class*="col-"], .prose section, .prose .post-content, .prose .post-bottom,
.prose .full-col, .prose .p60, .prose .mt60, .prose .mt20, .prose .background-4 {
    max-width: none; width: auto; padding: 0; margin-left: 0; margin-right: 0; background: none;
}

.more-news { margin-top: var(--s-8); max-width: calc(var(--w-read) + 2 * var(--gutter)); }
.more-news h2 { font-size: var(--fs-xl); font-family: var(--f-text); letter-spacing: 0; }

/* Назад к ленте */
.back-link { display: inline-flex; align-items: center; gap: var(--s-1); min-height: 44px; margin-bottom: var(--s-3); color: var(--c-text-muted); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }
.back-link:hover { color: var(--c-text); }
.back-link--bottom { margin: var(--s-4) 0 0; }

/* Соседние новости */
.adjacent { display: grid; gap: var(--s-4); margin-top: var(--s-7); max-width: calc(var(--w-read) + 2 * var(--gutter)); }
.adjacent__card { display: grid; grid-template-columns: 96px 1fr; gap: var(--s-4); padding: var(--s-4); border: 1px solid var(--c-line); border-radius: var(--r-2); background: var(--c-surface); }
.adjacent__card img, .adjacent__card .news-item__noimg { width: 96px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-2); }
.adjacent__card:hover { border-color: var(--c-line-strong); }
.adjacent__dir { display: flex; align-items: center; gap: var(--s-1); color: var(--c-accent); font-size: var(--fs-xs); font-weight: 600; }
.adjacent__card--next .adjacent__dir { justify-content: flex-end; }
.adjacent__card time { display: block; margin-top: var(--s-1); font-size: var(--fs-xs); color: var(--c-text-faint); }
.adjacent__card h3 { margin: var(--s-1) 0 0; font-size: var(--fs-md); }
.adjacent__card h3 a { color: var(--c-text); text-decoration: none; }
.adjacent__card h3 a:hover { color: var(--c-accent-hover); }
@media (min-width: 768px) {
    .adjacent { grid-template-columns: 1fr 1fr; }
    .adjacent__card--next:only-child { grid-column: 2; }
}

/* Лента: на десктопе карточки сеткой, без пустого места справа */
@media (min-width: 768px) {
    .news-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-5); border-top: 0; }
    .news-list .news-item { display: flex; flex-direction: column; gap: var(--s-3); padding: 0; border-bottom: 0; }
    .news-list .news-item img, .news-list .news-item__noimg { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
    .news-list .news-item h3 { font-size: var(--fs-lg); }
}
@media (min-width: 1100px) { .news-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Свежая новость — карточкой, чтобы картинка и текст читались вместе */
.news-lead { padding: var(--s-4); margin-bottom: var(--s-6); background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-2); }
@media (min-width: 1024px) { .news-lead { padding: var(--s-5); } .news-lead > div { padding-right: var(--s-4); } }
.news-lead__img, .news-item__img { display: block; overflow: hidden; border-radius: var(--r-2); }
.news-lead__img img, .news-item__img img { display: block; transition: transform var(--t-base); }
.news-lead__img:hover img, .news-item__img:hover img { transform: scale(1.03); }
.news-item__img .news-item__noimg { border-radius: 0; }

/* ---------- Типы и поиск в одну строку: типы слева, поиск справа ---------- */
.news-tools { display: flex; flex-direction: column-reverse; gap: var(--s-3); margin: 0 0 var(--s-5); padding-bottom: var(--s-5); border-bottom: 1px solid var(--c-line); }
.news-tools .chips { margin: 0; }
.news-search, .news-search .search { position: relative; display: flex; align-items: center; }
.news-search .search { flex: 1 1 auto; }
.news-search .icon { position: absolute; left: var(--s-3); color: var(--c-text-faint); pointer-events: none; }
.news-search input[type="search"] {
    width: 100%; min-height: 44px; padding: 0 var(--s-3) 0 40px;
    font: 400 var(--fs-md) var(--f-text); color: var(--c-text);
    background: var(--c-surface); border: 1px solid var(--c-line-strong); border-radius: var(--r-1);
}
.news-search input[type="search"]::placeholder { color: var(--c-text-faint); }
.news-search input[type="search"]:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 1px var(--c-accent); }
@media (min-width: 768px) {
    .news-tools { flex-direction: row; align-items: center; justify-content: space-between; }
    .news-search { flex: 0 1 320px; margin-left: auto; }
}
.news-found { margin: 0 0 var(--s-4); color: var(--c-text-muted); }
.news-found a { margin-left: var(--s-2); }

/* Счётчики в ленте новостей */
.news-stats { display: inline-flex; gap: var(--s-3); margin-left: auto; color: var(--c-text-faint); font-variant-numeric: tabular-nums; }
.news-stats span { display: inline-flex; align-items: center; gap: 4px; }
.news-stats .icon { width: 14px; height: 14px; }
.news-stats__gm { color: var(--c-accent); font-weight: 700; font-size: var(--fs-xs); letter-spacing: 0.04em; }
.news-stats .news-stats__gm img { width: auto; height: 16px; }
