/* «Всемила» — блог: лента, материал, 404 раздела.
   Классы news-* остались от исходного сервиса (docs/03-stack-decision.md), оформление — токены vsemila.css. */

/* ---------- Лента ---------- */
.news-tools { display: flex; justify-content: flex-end; margin-bottom: 16px; }
/* Рубрики над списком (замечания 06.11, Б2): на телефоне переносятся на новую строку. */
.news-rubrics { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.news-rubric { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--paper); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.news-rubric:hover { border-color: var(--green); color: var(--green); }
.news-rubric[aria-current="page"] { background: var(--green); border-color: var(--green); color: #fff; }
.viewswitch { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: #F6F2E6; }
.viewswitch__btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.viewswitch__btn[aria-pressed="true"] { background: var(--green); color: #fff; }

.news-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 768px) { .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1100px) { .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.news-card { display: flex; flex-direction: column; border-radius: var(--r-card); overflow: hidden; background: #FBF8EF; border: 1px solid var(--line); }
.news-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--tint-4); }
.news-card__media img { width: 100%; height: 100%; object-fit: cover; }
.news-card__body { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 18px; }
.news-card__title { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.25; }
.news-card__title a { color: var(--ink); text-decoration: none; }
.news-card__title a:hover { color: var(--green); }
.news-card__lead { margin: 0; color: var(--text-2); font-size: 14.5px; }

/* Вид «Список»: одна колонка, обложка слева. */
.news-shelf--rows .news-grid { grid-template-columns: 1fr; max-width: 880px; }
.news-shelf--rows .news-card { flex-direction: row; }
.news-shelf--rows .news-card__media { flex: 0 0 34%; aspect-ratio: auto; }
@media (max-width: 560px) { .news-shelf--rows .news-card { flex-direction: column; } .news-shelf--rows .news-card__media { aspect-ratio: 16 / 10; } }

.news-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.news-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.news-tag { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); background: rgba(34, 93, 56, 0.08); color: var(--green); font-size: 13px; font-weight: 500; text-decoration: none; }
.news-tag:hover { background: rgba(34, 93, 56, 0.16); }
/* Касание пальцем (до 1200 px): метки и переключатель вида — не меньше 44 px (регрессия 10.11). */
@media (max-width: 1199px) { .news-tag, .viewswitch__btn { min-height: 44px; } }
.news-empty { padding: 24px 0; color: var(--text-2); }

/* ---------- Постраничная навигация ---------- */
.news-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }
.news-pager__count { margin: 0; font-size: 13px; color: var(--muted); }
.pages { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.pages__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 10px; border-radius: var(--r-btn); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 600; }
.pages__btn:hover { border-color: var(--green); color: var(--green); }
.pages__btn.is-current { background: var(--green); border-color: var(--green); color: #fff; }
.pages__btn.is-off { opacity: 0.35; }
.pages__gap { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--muted); }

/* ---------- Материал ---------- */
.news-article { max-width: 800px; }
.news-article__title { margin: 14px 0 12px; font-size: 32px; }
@media (min-width: 768px) { .news-article__title { font-size: 44px; } }
.news-article .news-meta { margin-bottom: 10px; }
.news-article__cover { width: 100%; max-height: 420px; object-fit: cover; margin: 24px 0 8px; border-radius: var(--r-card); }
.news-lead { margin: 20px 0 8px; font-size: 18px; line-height: 1.6; color: var(--ink); }
.news-body { padding: 8px 0 24px; font-size: 16px; line-height: 1.7; overflow-wrap: break-word; }
.news-body > * { max-width: 68ch; }
.news-body h2 { margin: 1.6em 0 0.5em; font-family: var(--serif); font-size: 26px; line-height: 1.2; color: var(--ink); }
.news-body h3 { margin: 1.4em 0 0.4em; font-family: var(--serif); font-size: 21px; color: var(--ink); }
.news-body p, .news-body ul, .news-body ol { margin: 0 0 1em; }
.news-body ul, .news-body ol { padding-left: 1.3em; }
.news-body li + li { margin-top: 0.3em; }
.news-body blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--sun); color: var(--text-2); }
.news-body img { max-width: 100%; border-radius: 12px; }
.news-body table { border-collapse: collapse; width: 100%; font-size: 15px; }
.news-body th, .news-body td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.news-body code { padding: 1px 5px; border-radius: 4px; background: #F6F2E6; font-size: 0.92em; }

/* ---------- 404 ---------- */
.nf { padding-top: 32px; padding-bottom: 32px; }
.nf__code { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 72px; line-height: 1; color: var(--sun-core); }
.nf-recent ul { list-style: none; margin: 12px 0 0; padding: 0; }
.nf-recent li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.nf-recent a { color: var(--ink); font-weight: 600; text-decoration: none; }
.nf-recent a:hover { color: var(--green); }
.nf-recent time { font-size: 13px; color: var(--muted); }
