/* =====================================================================
   АЛІБІ 2026 — тема новинного порталу
   Токени: папір, туман, чорнило, фірмовий червоний, посилання, бурштин
   Шрифти: Literata (заголовки, текст статей), Manrope (інтерфейс, час)
   ===================================================================== */

/* Шрифти розміщені на сайті (OFL), без запитів до Google */
@font-face { font-family: "Literata"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(../fonts/literata-cyrillic-opsz-normal.woff2) format("woff2-variations"), url(../fonts/literata-cyrillic-opsz-normal.woff2) format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Literata"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(../fonts/literata-latin-opsz-normal.woff2) format("woff2-variations"), url(../fonts/literata-latin-opsz-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; }
@font-face { font-family: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(../fonts/manrope-cyrillic-wght-normal.woff2) format("woff2-variations"), url(../fonts/manrope-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: "Manrope"; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(../fonts/manrope-latin-wght-normal.woff2) format("woff2-variations"), url(../fonts/manrope-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 {
  --paper: #ffffff;
  --mist: #eef1f5;
  --rule: #d6dce4;
  --ink: #182230;
  --muted: #5b6676;
  --brand: #e80304;
  --brand-ink: #ffffff;
  --link: #0b4fa8;
  --amber: #d98e04;
  --calm: #c9d2dd;

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --wrap: 1240px;
  --gutter: 16px;
  --gap: 24px;
  --rail: 340px;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #10161f;
    --mist: #18212d;
    --rule: #2a3443;
    --ink: #e6ebf1;
    --muted: #9aa6b5;
    --brand: #ff3b30;
    --link: #8bb8ff;
    --amber: #f0b13a;
    --calm: #3a4657;
  }
}

:root[data-theme="dark"] {
  --paper: #10161f;
  --mist: #18212d;
  --rule: #2a3443;
  --ink: #e6ebf1;
  --muted: #9aa6b5;
  --brand: #ff3b30;
  --link: #8bb8ff;
  --amber: #f0b13a;
  --calm: #3a4657;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  font-feature-settings: "tnum" 0;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { margin: 0; }
p { margin: 0 0 1em; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: var(--radius);
}
.skip-link:focus { top: 8px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

.btn {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-ink);
  font: 600 15px/1.2 var(--sans);
  padding: 12px 18px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(0.92); }
.btn-outline {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--rule);
}
.btn-outline:hover { box-shadow: inset 0 0 0 1.5px var(--ink); filter: none; }

/* ---------- Шапка: датлайн ---------- */
.dateline {
  background: var(--mist);
  font-size: 13px;
  color: var(--muted);
}
.dateline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
  min-height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.dateline-day { margin: 0; }
.dateline-day strong { color: var(--brand); font-weight: 700; }
.dateline-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-variant-numeric: tabular-nums;
}
.dateline-facts strong { color: var(--ink); font-weight: 600; }
.fact-alerts a { color: var(--ink); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--calm); }
.fact-alerts.is-active .alert-dot { background: var(--brand); }

@media (max-width: 599px) {
  .fact-rate { display: none; }
}

/* ---------- Шапка: логотип, пошук, розділи ---------- */
.masthead { border-bottom: 1px solid var(--rule); background: var(--paper); }
.masthead-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand img { width: 112px; height: auto; }
@media (min-width: 768px) { .brand img { width: 132px; } }

:root[data-theme="dark"] .brand img,
:root[data-theme="dark"] .footer-logo img { filter: invert(1) hue-rotate(180deg); }
/* есть готовый тёмный логотип — показываем его без фильтров (красный остаётся красным) */
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; filter: none !important; }
:root[data-theme="dark"] .logo-light.has-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand img,
  :root:not([data-theme="light"]) .footer-logo img { filter: invert(1) hue-rotate(180deg); }
  :root:not([data-theme="light"]) .logo-dark { display: block; filter: none !important; }
  :root:not([data-theme="light"]) .logo-light.has-dark { display: none; }
}

.search {
  flex: 1;
  display: flex;
  max-width: 460px;
  margin-left: auto;
  background: var(--mist);
  border-radius: 999px;
  overflow: hidden;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 500 15px/1 var(--sans);
  padding: 11px 16px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 2px var(--link); }
.search button {
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  font: 600 14px var(--sans);
}

.theme-toggle {
  border: 0;
  background: transparent;
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--mist); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}

.sections { border-top: 1px solid var(--rule); }
.sections-list {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.sections-list::-webkit-scrollbar { display: none; }
.sections-list a {
  display: block;
  white-space: nowrap;
  color: var(--ink);
  font: 600 15px/1 var(--sans);
  padding: 13px 10px 11px;
  border-bottom: 3px solid transparent;
}
.sections-list li:first-child a { padding-left: 0; }
.sections-list a:hover { text-decoration: none; border-bottom-color: var(--rule); }
.sections-list a.is-active { border-bottom-color: var(--brand); }

/* ---------- Сюжети (картки) ---------- */
.story { min-width: 0; }
.story-media { display: block; margin-bottom: 12px; border-radius: var(--radius); overflow: hidden; background: var(--mist); }
.story-media img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.story-title { font-family: var(--serif); font-weight: 600; color: var(--ink); }
.story-title a { color: inherit; }
.story-title a:hover { color: var(--link); text-decoration: none; }
.story-excerpt { color: var(--muted); font-size: 16px; line-height: 1.55; margin: 10px 0 0; max-width: 62ch; }
.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.story-cat { color: var(--ink); font-weight: 600; }

.story--lead .story-media img { aspect-ratio: 16 / 9; }
@media (min-width: 1024px) { .story--lead .story-media img { aspect-ratio: 2 / 1; } }
.story--lead .story-title { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.12; font-weight: 700; letter-spacing: -0.01em; }

.story--tile .story-title { font-size: 18px; line-height: 1.3; }

.story--row {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}
.story--row .story-media { order: 2; margin: 0; }
.story--row .story-media img { aspect-ratio: 4 / 3; }
.story--row .story-title { font-size: 17px; line-height: 1.32; }
.story--row .story-excerpt { font-size: 15px; margin-top: 6px; }
@media (max-width: 599px) { .story--row .story-excerpt { display: none; } }
@media (min-width: 768px) {
  .story--row { grid-template-columns: 1fr 160px; gap: 20px; }
  .story--row .story-title { font-size: 19px; }
}
.story--row:not(:has(.story-media)) { grid-template-columns: 1fr; }

.story--compact .story-title { font-size: 16px; line-height: 1.35; }

/* ---------- Головна: верх ---------- */
.home-top {
  display: grid;
  gap: 32px;
  padding-top: 24px;
}
.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 600px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}
/* Телефон: головна новина, стрічка, далі плитки */
@media (max-width: 1023px) {
  .home-top .stream { max-height: 620px; overflow: hidden; position: relative; }
  .home-top .stream::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 96px;
    background: linear-gradient(to bottom, transparent, var(--paper) 75%); pointer-events: none;
  }
  .home-top .stream .stream-more { position: absolute; bottom: 4px; z-index: 1; }
}
@media (min-width: 1024px) {
  .home-top {
    grid-template-columns: minmax(0, 1fr) var(--rail);
    grid-template-areas: "lead stream" "tiles stream";
    grid-template-rows: auto 1fr;
    column-gap: 40px;
    row-gap: 28px;
  }
  .home-lead { grid-area: lead; }
  .home-top .stream { grid-area: stream; }
  .home-top .tiles { grid-area: tiles; align-self: start; }
  .tiles { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .tiles .story-title { font-size: 16px; }
}

/* ---------- Стрічка: головний акцент ---------- */
.stream { --time: 52px; }
.stream-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--ink);
}
.stream-title { font: 700 22px/1.2 var(--serif); }
.stream-live { color: var(--brand); font-weight: 700; font-size: 13px; }
.stream-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.stream-list::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--time) + 8px);
  width: 1px;
  background: var(--rule);
}
.stream-hour {
  position: relative;
  padding: 14px 0 4px calc(var(--time) + 22px);
  font: 700 12px/1 var(--sans);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.stream-hour::before {
  content: "";
  position: absolute;
  left: calc(var(--time) + 4px);
  top: 14px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--muted);
}
.stream-item {
  position: relative;
  display: grid;
  grid-template-columns: var(--time) 1fr;
  gap: 22px;
  padding: 8px 0;
}
.stream-item time {
  font: 600 14px/1.45 var(--sans);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.stream-item a {
  color: var(--ink);
  font: 500 15px/1.45 var(--sans);
}
.stream-item a:hover { color: var(--link); }
.stream-item.is-fresh time { color: var(--brand); }
.stream-item.is-fresh::before {
  content: "";
  position: absolute;
  left: calc(var(--time) + 5px);
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 60%, transparent);
  animation: fresh-pulse 2.4s ease-out infinite;
}
.stream-item.is-fresh a { font-weight: 700; }
@keyframes fresh-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.stream-more {
  display: inline-block;
  margin: 12px 0 0 calc(var(--time) + 22px);
  font-weight: 700;
}
@media (min-width: 1024px) {
  .home-top .stream { max-height: 1000px; overflow: hidden; position: relative; }
  .home-top .stream::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 96px;
    background: linear-gradient(to bottom, transparent, var(--paper) 75%);
    pointer-events: none;
  }
  .home-top .stream .stream-more { position: absolute; bottom: 4px; z-index: 1; }
}

/* ---------- Панелі (тривоги, найчитаніше, курси) ---------- */
.home-band {
  display: grid;
  gap: 32px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}
@media (min-width: 900px) {
  .home-band { grid-template-columns: 1.3fr 1fr 0.9fr; gap: 40px; }
}
.panel-title { font: 700 20px/1.25 var(--serif); margin-bottom: 14px; }

.alerts-map {
  min-height: 160px;
  color: var(--muted);
}
.alerts-map svg { width: 100%; height: auto; }
.alerts-map svg path, .alerts-map svg polygon { fill: var(--mist); stroke: var(--paper); stroke-width: 1; transition: fill .3s; }
.alerts-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.alerts-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw-full { background: var(--brand); }
.sw-partial { background: var(--amber); }
.sw-none { background: var(--mist); box-shadow: inset 0 0 0 1px var(--rule); }
.alerts-summary { margin: 10px 0 0; font-weight: 600; }
.alerts-feed { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14px; max-height: 220px; overflow: auto; }
.alerts-feed li { padding: 6px 0; border-top: 1px solid var(--rule); }

.popular-list {
  list-style: none;
  counter-reset: pop;
  margin: 0;
  padding: 0;
}
.popular-list li {
  counter-increment: pop;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
}
.popular-list li::before {
  content: counter(pop);
  font: 700 20px/1.2 var(--serif);
  color: var(--brand);
}
.popular-list a { color: var(--ink); font: 600 16px/1.4 var(--serif); }
.popular-list a:hover { color: var(--link); text-decoration: none; }

.rates-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rates-table th, .rates-table td { padding: 9px 0; border-top: 1px solid var(--rule); text-align: right; font-size: 15px; }
.rates-table thead th { border-top: 0; font-size: 12px; color: var(--muted); font-weight: 600; padding-top: 0; }
.rates-table tbody th { text-align: left; font-weight: 600; }
.rates .muted { margin-top: 10px; }

/* ---------- Розділи на головній ---------- */
.section { margin-top: 56px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 3px solid var(--ink);
}
.section-title { font: 700 26px/1.2 var(--serif); }
.section-title a { color: var(--ink); }
.section-more { font-weight: 600; font-size: 14px; white-space: nowrap; }
.section-grid { display: grid; gap: 8px 32px; }
.section-rows .story--row:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 900px) {
  .section-grid { grid-template-columns: 1.15fr 1fr; }
  .section-grid > .story--tile .story-title { font-size: 24px; line-height: 1.2; }
  .section-grid > .story--tile .story-media img { aspect-ratio: 16 / 9; }
}
@media (max-width: 899px) {
  .section-rows .story--row:first-child { border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 16px; }
}

/* ---------- Внутрішні сторінки ---------- */
.page-head { padding-top: 28px; padding-bottom: 8px; }
.page-title { font: 700 clamp(28px, 4vw, 40px)/1.15 var(--serif); }
.page-head .search--page { margin: 18px 0 0; max-width: 620px; }

.with-rail {
  display: grid;
  gap: 48px;
  padding-top: 20px;
}
@media (min-width: 1024px) {
  .with-rail { grid-template-columns: minmax(0, 1fr) var(--rail); gap: 56px; }
  .rail { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow: auto; scrollbar-width: thin; }
}
.rail > * + * { margin-top: 36px; }

.listing-items .story--row:first-child { border-top: 0; }

.pager .pagination { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 28px 0 0; }
.pager .page-link {
  display: block;
  min-width: 40px;
  text-align: center;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--mist);
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.pager .page-link:hover { text-decoration: none; background: var(--rule); }
.pager .active .page-link { background: var(--ink); color: var(--paper); }
.pager .disabled .page-link { opacity: .45; pointer-events: none; }

.empty { padding: 40px 0; max-width: 56ch; }
.empty h2 { font: 700 24px/1.25 var(--serif); margin-bottom: 8px; }
.empty p { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0 0; }
.chips a { display: block; padding: 8px 14px; border-radius: 999px; background: var(--mist); color: var(--ink); font-weight: 600; font-size: 14px; }
.chips a:hover { background: var(--rule); text-decoration: none; }

.web-results { margin-top: 40px; }
.web-results .section-title { margin-bottom: 12px; }
.web-results .gsc-control-cse, .web-results .gsc-control-cse * { font-family: var(--sans) !important; }
.web-results .gsc-control-cse { background: transparent !important; border: 0 !important; padding: 0 !important; }

/* ---------- Стаття ---------- */
.read-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 50; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--brand); }

.article { min-width: 0; max-width: 720px; }
.article-head { margin-bottom: 20px; }
.article-cat { display: inline-block; font-weight: 700; color: var(--brand); margin-bottom: 10px; }
.article-title {
  font: 700 clamp(28px, 4.2vw, 44px)/1.12 var(--serif);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.article-figure { margin: 0 0 24px; }
.article-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--mist); }
.article-figure figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

.article-text {
  font: 400 19px/1.72 var(--serif);
  max-width: 68ch;
}
.article-text p { margin: 0 0 1.1em; }
.article-text h2, .article-text h3 { font-family: var(--serif); margin: 1.4em 0 .5em; line-height: 1.25; }
.article-text img { border-radius: var(--radius); margin: 1em 0; }
.article-text a { text-decoration: underline; text-underline-offset: 3px; }

.source-note {
  margin: 22px 0 0;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
}

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.share-label { font-weight: 700; margin-right: 6px; }
.share a, .share button {
  font: 600 14px/1 var(--sans);
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--mist);
  color: var(--ink);
  border: 0;
  cursor: pointer;
}
.share a:hover, .share button:hover { background: var(--rule); text-decoration: none; }

.related { margin-top: 44px; }
.related .section-title { padding-bottom: 12px; margin-bottom: 20px; border-bottom: 3px solid var(--ink); }
.related-grid { display: grid; gap: 24px; }
@media (min-width: 600px) { .related-grid { grid-template-columns: 1fr 1fr; } }

.crumbs { margin-top: 36px; font-size: 14px; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; list-style: none; padding: 0; margin: 0; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--rule); }
.crumbs .breadcrumb-item, .crumbs li { display: inline; }

.page-article .article-title { margin-bottom: 20px; }
.page-wide { max-width: none; }
.notfound .lede { font-size: 19px; color: var(--muted); margin: 16px 0 24px; max-width: 56ch; }

.ad { margin: 0 0 1.2em; }

/* ---------- Форми ---------- */
.form { margin-top: 28px; max-width: 560px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  font: 400 16px/1.4 var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--rule);
  border-radius: 6px;
  padding: 11px 12px;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--link); }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; background: var(--mist); }
.alert-success { box-shadow: inset 4px 0 0 #1f8a4c; }
.alert-danger { box-shadow: inset 4px 0 0 var(--brand); }
.alert .close { display: none; }

/* ---------- Підвал ---------- */
.site-footer {
  margin-top: 72px;
  background: var(--mist);
  padding: 44px 0 24px;
  font-size: 15px;
}
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-logo img { width: 120px; }
.footer-about { color: var(--muted); max-width: 42ch; margin: 14px 0 18px; }
.footer-heading { font: 700 16px/1.2 var(--serif); margin-bottom: 12px; }
.footer-nav ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.footer-nav li { padding: 4px 0; break-inside: avoid; }
.footer-nav a { color: var(--ink); }
.footer-bottom { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; }
.footer-bottom p { margin: 0; }

/* ---------- Доступність руху ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Друк ---------- */
@media print {
  .site-header, .rail, .share, .site-footer, .read-progress, .related { display: none !important; }
  .with-rail { display: block; }
  body { color: #000; background: #fff; }
}

.stream-new { width: 100%; margin: 12px 0 4px; font-size: 14px; }

/* ---------- Наживо (Telegram) ---------- */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  margin-right: 7px;
  vertical-align: 2px;
}
.live-dot--big { width: 14px; height: 14px; margin-right: 12px; vertical-align: 6px; }
.nav-live { color: var(--brand) !important; }

.live-intro { color: var(--muted); max-width: 64ch; margin: 10px 0 0; }

.live-feed { --time: 52px; min-width: 0; max-width: 720px; position: relative; }
.live-feed::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: calc(var(--time) + 8px);
  width: 1px;
  background: var(--rule);
}
.tg-post {
  position: relative;
  display: grid;
  grid-template-columns: var(--time) 1fr;
  gap: 22px;
  padding: 18px 0;
}
.tg-post + .tg-post .tg-body { border-top: 1px solid var(--rule); padding-top: 18px; margin-top: -18px; }
.tg-time {
  font: 700 15px/1.6 var(--sans);
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tg-post::before {
  content: "";
  position: absolute;
  left: calc(var(--time) + 4px);
  top: 25px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--muted);
}
.tg-post.is-fresh .tg-time { color: var(--brand); }
.tg-post.is-fresh::before { background: var(--brand); box-shadow: none; animation: fresh-pulse 2.4s ease-out infinite; }
.tg-post.is-new { animation: tg-arrive 1.2s ease-out; }
@keyframes tg-arrive { from { background: color-mix(in srgb, var(--brand) 10%, transparent); } to { background: transparent; } }

.tg-text { font: 400 18px/1.6 var(--serif); overflow-wrap: anywhere; }
.tg-text strong { font-weight: 700; }
.tg-text a { text-decoration: underline; text-underline-offset: 3px; }
.tg-media { position: relative; display: block; margin-top: 14px; border-radius: var(--radius); overflow: hidden; background: var(--mist); max-width: 560px; }
.tg-media img { width: 100%; max-height: 520px; object-fit: cover; }
.tg-play {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  background: rgba(16, 22, 31, .78);
  color: #fff;
  font: 600 13px/1 var(--sans);
}
.tg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tg-meta a { font-weight: 600; }

.stream-item > div { min-width: 0; }
.stream-src { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.stream-item.is-tg a { font-family: var(--sans); }
.stream-item.is-new { animation: tg-arrive 1.2s ease-out; }
a.stream-live:hover { text-decoration: underline; }

.live-new { margin: 0 0 12px calc(var(--time) + 22px); }

@media (max-width: 599px) {
  .live-feed, .stream { --time: 44px; }
  .tg-post, .stream-item { gap: 16px; }
  .tg-text { font-size: 17px; }
}

/* ---------- Карта тривог і моніторинг загроз ---------- */
.alerts-map { min-height: 0; }
.ua-map { width: 100%; height: auto; display: block; }
.ua-map path { fill: var(--mist); stroke: var(--paper); stroke-width: 1.4; stroke-linejoin: round; transition: fill .4s; }
.ua-map path:hover { fill: var(--rule); }
.ua-map path.is-full { fill: var(--brand); }
.ua-map path.is-partial { fill: var(--amber); }
.ua-map path.is-full:hover, .ua-map path.is-partial:hover { filter: brightness(1.1); }
:root[data-theme="dark"] .ua-map path { stroke: var(--paper); }

.alerts-regions { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 10px 0 0; }
.alerts-regions li { font-size: 13px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--mist); }
.alerts-regions li.is-full { box-shadow: inset 3px 0 0 var(--brand); }
.alerts-regions li.is-partial { box-shadow: inset 3px 0 0 var(--amber); }

.threats { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.threats-title { font: 700 17px/1.3 var(--serif); margin-bottom: 6px; }
.alerts-feed li { display: grid; grid-template-columns: 44px 1fr; gap: 10px; }
.alerts-feed time { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.map-credit { margin-top: 10px; }

/* ---------- Кнопка «Нагору» ---------- */
.to-top {
  position: fixed; z-index: 900;
  right: calc(20px + env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 6px 18px rgba(16, 22, 31, .28);
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(16px) scale(.9);
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s, box-shadow .2s ease;
}
.to-top.is-visible {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .25s ease, transform .25s ease, visibility 0s, box-shadow .2s ease;
}
.to-top:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(16, 22, 31, .34); }
.to-top:hover .to-top-arrow { transform: translateY(-2px); }
.to-top:active { transform: translateY(0) scale(.96); }
.to-top:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.to-top-arrow { position: relative; transition: transform .2s ease; }
/* кольцо показывает, сколько страницы прокручено */
.to-top-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.to-top-ring circle {
  fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: var(--to-top-progress, 100);
  transition: stroke-dashoffset .12s linear;
}
@media (max-width: 640px) {
  .to-top { width: 46px; height: 46px; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .to-top, .to-top.is-visible, .to-top-arrow, .to-top-ring circle { transition: none; }
}

/* ---------- Погода ---------- */
.weather-page { padding-block: 24px 40px; }
.wx-head { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.wx-title { display: grid; gap: 10px; min-width: 0; }
.wx-title .page-title { margin: 0; }
.wx-picker { position: relative; }
.wx-picker summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-weight: 700; color: var(--link); padding: 6px 12px; border: 1.5px solid var(--rule); border-radius: 999px;
}
.wx-picker summary::-webkit-details-marker { display: none; }
.wx-picker summary::after { content: "▾"; font-size: 12px; }
.wx-picker[open] summary::after { content: "▴"; }
.wx-picker-panel {
  position: absolute; z-index: 50; top: calc(100% + 8px); left: 0;
  width: min(760px, calc(100vw - 32px)); max-height: 70vh; overflow: auto;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 14px 40px rgba(16, 22, 31, .18); padding: 16px;
}
.wx-search { width: 100%; padding: 10px 12px; border: 1.5px solid var(--rule); border-radius: 6px; font: inherit; background: var(--paper); color: var(--ink); }
.wx-search:focus { outline: none; border-color: var(--link); }
.wx-regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 20px; margin-top: 14px; }
.wx-region h2 { font: 700 12px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; }
.wx-region ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.wx-region a { display: block; padding: 3px 0; color: var(--ink); text-decoration: none; }
.wx-region a:hover { color: var(--brand); }
.wx-region a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.wx-noresult { margin: 12px 0 0; color: var(--muted); }

.wx-now { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.wx-ico { width: 44px; height: 44px; flex: none; }
.wx-ico--now { width: 84px; height: 84px; }
.wx-now-temp { margin: 0; font: 700 52px/1 var(--serif); font-variant-numeric: tabular-nums; }
.wx-now-desc { margin: 4px 0 0; color: var(--muted); font-weight: 600; }
.wx-now-facts { display: grid; gap: 4px; margin: 0; font-size: 14px; }
.wx-now-facts div { display: flex; gap: 8px; }
.wx-now-facts dt { color: var(--muted); min-width: 76px; }
.wx-now-facts dd { margin: 0; font-weight: 600; }

/* значки погоды */
.wx-sun { fill: #f5a524; }
.wx-ray { stroke: #f5a524; fill: none; }
.wx-moon { fill: #f2c94c; }
.wx-cloud { fill: #c4cdd8; }
.wx-drop { stroke: #2f80ed; fill: none; }
.wx-flake { fill: #7fb2f0; }
.wx-bolt { fill: #f5a524; }
.wx-fogline { stroke: #a7b3c2; fill: none; }
:root[data-theme="dark"] .wx-cloud { fill: #7f8ea3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wx-cloud { fill: #7f8ea3; } }

.wx-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; border: 1px solid var(--rule); border-radius: 8px 8px 0 0; overflow: hidden; }
.wx-day {
  display: grid; justify-items: center; gap: 4px; padding: 12px 6px 14px; border: 0; border-right: 1px solid var(--rule);
  background: var(--mist); color: var(--ink); font: inherit; cursor: pointer; position: relative;
}
.wx-day:last-child { border-right: 0; }
.wx-day:hover { background: var(--paper); }
.wx-day[aria-selected="true"] { background: var(--paper); }
.wx-day[aria-selected="true"]::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand); }
.wx-day:focus-visible { outline: 3px solid var(--link); outline-offset: -3px; }
.wx-day-name { font-weight: 700; font-size: 14px; }
.wx-day-date { font-size: 13px; color: var(--muted); }
.wx-day-temps { font-variant-numeric: tabular-nums; font-size: 15px; }
.wx-day-temps b { font-size: 18px; }
.wx-day-temps span { color: var(--muted); }

.wx-panel { border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 8px 8px; padding: 20px; background: var(--paper); }
.wx-panel-head h2 { font: 700 22px/1.25 var(--serif); margin: 0; }
.wx-panel-head p { margin: 6px 0 0; color: var(--muted); }
.wx-table-wrap { overflow-x: auto; margin-top: 16px; }
.wx-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 420px; }
.wx-table th, .wx-table td { padding: 9px 8px; text-align: center; border-bottom: 1px solid var(--rule); }
.wx-table thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.wx-table tbody th { text-align: left; font-weight: 600; color: var(--muted); font-size: 14px; white-space: nowrap; }
.wx-table tr:last-child th, .wx-table tr:last-child td { border-bottom: 0; }
.wx-table .wx-ico { width: 40px; height: 40px; margin: 0 auto; display: block; }
.wx-t { font-size: 20px; }
.wx-wind { display: inline-flex; align-items: center; gap: 4px; }
.wx-wind svg { color: var(--muted); }
.wx-na { color: var(--calm); }
.wx-sunline { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.wx-sunline b { color: var(--ink); }
.wx-credit { margin-top: 18px; font-size: 12px; color: var(--muted); }
.wx-empty { padding: 24px; background: var(--mist); border-radius: 8px; }

@media (max-width: 760px) {
  .wx-days { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 88px; overflow-x: auto; scroll-snap-type: x mandatory; }
  .wx-day { scroll-snap-align: start; }
  .wx-now-temp { font-size: 44px; }
  .wx-ico--now { width: 68px; height: 68px; }
  .wx-panel { padding: 16px 12px; }
  .wx-table { min-width: 0; }
  .wx-table th, .wx-table td { padding: 8px 4px; }
  .wx-table tbody th { font-size: 12px; white-space: normal; }
  .wx-table .wx-ico { width: 32px; height: 32px; }
  .wx-t { font-size: 17px; }
}

/* погода в шапке */
.fact-weather a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.fact-weather a:hover { color: var(--brand); }
.fact-weather .wx-ico { width: 20px; height: 20px; }
