/* СМИ — оформление сайта. Один файл, без сторонних скриптов.
   Шрифт Golos Text (ParaType для The Golos Text Project, SIL OFL 1.1, fonts/OFL.txt): два файла, кириллица и латиница. */

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/golos-text-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/golos-text-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --text: #161616;
  --muted: #5e5e5e;
  --rule: #e4e4e4;
  --accent: #c42a1e;
  --img: #ececec;
  --note: #f3f3f3;
  --pad: 20px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #ececec;
    --muted: #a8a8a8;
    --rule: #2f2f2f;
    --accent: #ff7a6b;
    --img: #262626;
    --note: #1e1e1e;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.55 "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1 0 auto; width: 100%; }
img { display: block; max-width: 100%; height: auto; background: var(--img); color: var(--muted); font-size: 15px; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}

/* ---------- шапка ---------- */
.top { border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; column-gap: 28px; }
.brand { display: inline-flex; align-items: center; min-height: 56px; color: var(--text); }
.logo { display: block; width: 114px; height: 28px; }
.nav { display: flex; flex-wrap: wrap; column-gap: 20px; width: 100%; margin-top: -6px; }
.nav a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none;
}
.nav a[aria-current] { color: var(--text); text-decoration: underline 2px var(--accent); text-underline-offset: 6px; }
/* на телефоне рубрики в шапке только на главной и в рубрике; на статье они в подвале */
.page-article .nav, .page-about .nav { display: none; }

/* ---------- общее для карточек ---------- */
.meta { margin: 0; font-size: 15px; line-height: 1.4; color: var(--muted); }
.meta .rubric { color: var(--accent); font-weight: 600; text-decoration: none; }
.meta time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.card { position: relative; }
.card h2 a, .card h3 a { text-decoration: none; }
.card h2 a::after, .card h3 a::after { content: ""; position: absolute; inset: 0; }
@media (hover: hover) { .card:hover h2 a, .card:hover h3 a { text-decoration: underline 2px; text-underline-offset: 4px; } }

/* главная: свежая статья */
.lead { margin: 0 0 8px; }
.lead-img { margin: 0 calc(-1 * var(--pad)); }
.lead-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.lead-text { padding-top: 14px; }
.lead-noimg .lead-text { padding-top: 24px; }
.lead h2 {
  margin: 6px 0 10px; font-size: 28px; line-height: 1.12; font-weight: 680; letter-spacing: -0.015em;
  text-wrap: balance;
}
.dek { margin: 0 0 8px; font-size: 18px; line-height: 1.45; }

/* лента */
.feed { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 1fr 96px; column-gap: 16px; align-items: start;
  padding: 16px 0; border-top: 1px solid var(--rule);
}
.row-noimg { grid-template-columns: 1fr; }
.row h3 { margin: 4px 0 0; font-size: 18px; line-height: 1.3; font-weight: 620; letter-spacing: -0.005em; }
.thumb { width: 96px; height: 72px; object-fit: cover; margin-top: 4px; }

/* ---------- статья ---------- */
.art { max-width: 680px; margin: 0 auto; }
.art-head { padding-top: 20px; }
.art-head .meta .rubric {
  display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0;
}
.upd { margin-top: 2px; }
.art h1 {
  margin: 12px 0 18px; font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em;
  text-wrap: balance;
}
.art h1.h1-long { font-size: 26px; line-height: 1.15; }
.body p { margin: 0 0 1em; }
.body h2 { margin: 1.7em 0 .45em; font-size: 22px; line-height: 1.25; font-weight: 680; letter-spacing: -0.01em; }
.body h3 { margin: 1.5em 0 .4em; font-size: 18px; line-height: 1.35; font-weight: 680; }
.body b { font-weight: 650; }
.body a { text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.body ol, .body ul { margin: 0 0 1em; padding-left: 1.4em; }
.body li { margin: 0 0 .45em; padding-left: .2em; }
.body li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
figure { margin: 28px calc(-1 * var(--pad)); }
figure + figure { margin-top: -12px; }
figure img { width: 100%; }
figcaption { padding: 8px var(--pad) 0; font-size: 15px; line-height: 1.4; color: var(--muted); }
figcaption a { color: inherit; }
.credit { display: block; }
blockquote {
  margin: 28px 0; padding-left: 18px; border-left: 3px solid var(--accent);
  font-size: 22px; line-height: 1.35; font-weight: 560;
}
blockquote p { margin: 0; }
blockquote footer { margin-top: 8px; font-size: 15px; font-weight: 400; color: var(--muted); }
blockquote footer::before { content: "— "; }

.sources { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--rule); }
.sources h2, .more h2 { margin: 0 0 4px; font-size: 15px; line-height: 1.4; font-weight: 650; color: var(--muted); }
.sources ul { list-style: none; margin: 0; padding: 0; }
.sources a { display: block; padding: 10px 0; font-size: 16px; line-height: 1.4; text-decoration: none; }
.src-t { text-decoration: underline 1.5px var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.host { display: block; margin-top: 2px; font-size: 15px; color: var(--muted); }
.more { max-width: 680px; margin: 44px auto 0; }
.more h2 { margin-bottom: 8px; }

/* ---------- рубрика, пусто, об издании ---------- */
.rub-head { padding: 24px 0 16px; }
.rub-head h1 { margin: 0 0 4px; font-size: 32px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; }
.empty { padding: 48px 0 24px; max-width: 560px; }
.empty-title, .empty-h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.3; font-weight: 700; }
.empty-sub { margin: 0; color: var(--muted); }
.empty-sub a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.note { margin: 0 0 24px; padding: 14px 16px; background: var(--note); border-left: 3px solid var(--accent); font-size: 16px; line-height: 1.45; }
.need { display: inline-block; padding: 0 6px; border: 1px dashed var(--muted); color: var(--muted); font-size: 15px; line-height: 1.5; }
.facts { margin: 0; }
.facts div { padding: 10px 0; border-top: 1px solid var(--rule); }
.facts dt { font-size: 15px; color: var(--muted); }
.facts dd { margin: 2px 0 0; }

/* ---------- подвал ---------- */
.foot {
  margin-top: 56px; border-top: 1px solid var(--rule);
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  font-size: 15px; line-height: 1.4; color: var(--muted);
}
.foot p { margin: 0; }
.foot-name { color: var(--text); }
.foot-name .logo { width: 98px; height: 24px; margin-bottom: 10px; }
.foot-desc { margin-top: 2px !important; }
.foot-nav { display: flex; flex-wrap: wrap; column-gap: 20px; margin-top: 12px; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; }
.foot-nav + .foot-nav { margin-top: 0; padding-top: 4px; border-top: 1px solid var(--rule); }
.foot-legal { margin-top: 12px !important; }

/* ---------- компьютер ---------- */
@media (min-width: 900px) {
  :root { --pad: 40px; }
  body { font-size: 20px; line-height: 1.6; }
  .top-in { flex-wrap: nowrap; column-gap: 40px; }
  .brand { min-height: 72px; }
  .top .logo { width: 138px; height: 34px; }
  .nav { width: auto; margin: 0 0 0 auto; column-gap: 24px; }
  .page-article .nav, .page-about .nav { display: flex; }

  .lead { display: grid; grid-template-columns: 7fr 5fr; column-gap: 40px; align-items: start; margin: 40px 0 28px; }
  .lead-img { margin: 0; }
  .lead-text { padding-top: 0; margin-top: -4px; }
  .lead-noimg { display: block; max-width: 760px; }
  .lead h2 { font-size: 40px; line-height: 1.08; letter-spacing: -0.02em; }
  .dek { font-size: 19px; }
  .feed-home { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; }
  .row { grid-template-columns: 1fr 144px; column-gap: 24px; padding: 20px 0; }
  .row-noimg { grid-template-columns: 1fr; }
  .row h3 { font-size: 20px; }
  .thumb { width: 144px; height: 108px; }

  .art-head { padding-top: 48px; }
  .art h1 { margin: 14px 0 28px; font-size: 48px; line-height: 1.06; }
  .art h1.h1-long { font-size: 38px; line-height: 1.1; }
  .body h2 { font-size: 26px; }
  .body h3 { font-size: 20px; }
  figure { margin: 40px -80px; }
  figure + figure { margin-top: -16px; }
  figcaption { padding: 10px 80px 0; }
  blockquote { font-size: 26px; padding-left: 24px; margin: 36px 0; }
  .sources a { font-size: 17px; }
  .rub-head { padding: 40px 0 20px; }
  .rub-head h1 { font-size: 48px; }
  .foot-in { display: grid; grid-template-columns: 1fr 1fr; column-gap: 56px; }
  .foot-nav + .foot-nav { border-top: 0; padding-top: 0; }
  .foot-name, .foot-desc { grid-column: 1; }
  .foot-nav { grid-column: 2; margin-top: 0; }
  .foot-nav:first-of-type { grid-row: 1 / span 2; align-content: flex-start; }
  .foot-legal { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- добавлено при переносе в сборку (13.11): листание главной, в макете его нет ---------- */
.pager { display: flex; flex-wrap: wrap; column-gap: 24px; margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--rule); }
.pager a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.pager span { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }

/* ---------- добавлено после проверки 17 (13.11): длинная ссылка или слово без пробелов не растягивают страницу ----------
   В макете перенос был только у источников (.src-t). anywhere, а не break-word: в сетке карточек (.row) колонка 1fr
   иначе не сужается меньше самого длинного слова. */
.body, .art h1, .card h2, .card h3, .dek, figcaption, .meta, .rub-head h1, .empty, blockquote { overflow-wrap: anywhere; }

/* ---------- добавлено 16.11: название лицензии в подписи картинки не переносится по дефису ---------- */
.credit .lic { white-space: nowrap; }
