/* Новости ИИ — стили. Без внешних шрифтов и JS: только системный стек. */
:root {
  --ink: #12161f;
  --ink-soft: #3d4553;
  --muted: #6b7280;
  --line: #e6e8ee;
  --bg: #ffffff;
  --bg-soft: #f6f7fa;
  --accent: #1c4ed8;
  --accent-ink: #143aa8;
  --accent-soft: #eaf0ff;
  --radius: 14px;
  --wrap: 1120px;
  --gap: 20px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .18);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Noto Sans", sans-serif;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; letter-spacing: -.01em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

.sr-only,
.skip-link {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: static; width: auto; height: auto; margin: 8px; padding: 8px 12px;
  clip: auto; background: var(--accent); color: #fff; border-radius: 8px; display: inline-block;
}

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.empty { padding: 40px 0; color: var(--muted); }
.button {
  display: inline-block; padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: #fff; font-weight: 600;
}
.button:hover { background: var(--accent-ink); text-decoration: none; }

/* --- шапка ---------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.head-row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  padding-top: 10px; padding-bottom: 10px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff;
  font-weight: 700; font-size: 15px; letter-spacing: .5px;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 1.06rem; line-height: 1.2; }
.brand-text small { color: var(--muted); font-size: .78rem; line-height: 1.2; }

.rubrics {
  grid-column: 1 / -1; display: flex; gap: 4px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px;
}
.rubrics::-webkit-scrollbar { display: none; }
.rubrics a {
  flex: none; padding: 7px 11px; border-radius: 999px; color: var(--ink-soft);
  font-size: .92rem; white-space: nowrap;
}
.rubrics a:hover { background: var(--bg-soft); text-decoration: none; }

.search { display: flex; gap: 6px; grid-column: 1 / -1; }
.search input {
  flex: 1 1 auto; min-width: 0; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; background: var(--bg);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.search button {
  flex: none; padding: 10px 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--ink); color: #fff; font: inherit; font-weight: 600;
}
.search-wide { max-width: 560px; }
.search-wide input { padding: 12px 14px; }

/* --- лента --------------------------------------------------------------- */
main { padding: 22px 0 48px; }

.feed-head { max-width: 760px; margin-bottom: 22px; }
.feed-head h1 { font-size: clamp(1.5rem, 6vw, 2.3rem); }
.lead { color: var(--ink-soft); font-size: 1.05rem; margin: 0 0 14px; }

.chip-row { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 6px; }
.chip {
  display: inline-flex; gap: 6px; align-items: center; padding: 6px 11px; border-radius: 999px;
  background: var(--bg-soft); color: var(--ink-soft); font-size: .88rem; border: 1px solid var(--line);
}
.chip:hover { background: var(--accent-soft); color: var(--accent-ink); text-decoration: none; }
.chip span { color: var(--muted); font-size: .8rem; }

.feed { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--gap); }

.card {
  display: grid; grid-template-columns: 1fr; gap: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -14px rgba(16, 24, 40, .3); }
.card-cover { display: block; background: var(--bg-soft); aspect-ratio: 16 / 9; overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 18px; }
.card-meta { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; font-size: .84rem; color: var(--muted); }
.rubric { color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 3px 9px; font-weight: 600; }
.rubric:hover { text-decoration: none; background: #dde7ff; }
.card-title { font-size: 1.14rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-summary { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* --- пагинация ----------------------------------------------------------- */
.pager {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line);
}
.pager-btn {
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
  background: var(--bg); font-weight: 600; font-size: .94rem;
}
.pager-btn:hover { border-color: var(--accent); text-decoration: none; color: var(--accent-ink); }
.pager-btn.disabled { color: var(--muted); background: var(--bg-soft); }
.pager-num { color: var(--muted); font-size: .9rem; }

/* --- страница материала -------------------------------------------------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 14px; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "→"; margin-right: 8px; color: var(--line); }
.crumbs [aria-current] { color: var(--muted); }

.post { max-width: 760px; }
.post-head h1 { font-size: clamp(1.5rem, 6.2vw, 2.35rem); }
.post-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; font-size: .87rem; color: var(--muted); }

.post-cover { margin: 18px 0 22px; }
.post-cover img { width: 100%; border-radius: var(--radius); }
.post-cover figcaption { margin-top: 8px; color: var(--muted); font-size: .85rem; }

.facts {
  background: var(--accent-soft); border: 1px solid #d6e2ff; border-radius: var(--radius);
  padding: 16px 18px; margin: 0 0 22px;
}
.facts h2 { font-size: 1.02rem; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-ink); margin: 0 0 10px; }
.facts ul { margin: 0; padding-left: 20px; }
.facts li { margin-bottom: 6px; }

.post-body { font-size: 1.06rem; }
.post-body p { margin: 0 0 1.05em; }
.post-body h2 { font-size: 1.32rem; margin: 1.6em 0 .6em; }
.post-body h3 { font-size: 1.14rem; margin: 1.4em 0 .5em; }
.post-body ul, .post-body ol { margin: 0 0 1.05em; padding-left: 22px; }
.post-body li { margin-bottom: .4em; }
.post-body blockquote {
  margin: 1.2em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}
.post-body table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: .96rem; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }

.post-tags { margin-top: 26px; }

.related { max-width: 760px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.16rem; }
.related-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.related-list li { display: flex; flex-direction: column; gap: 2px; }

.page { max-width: 760px; }
.page h1 { font-size: clamp(1.5rem, 6vw, 2.2rem); }
.page h2 { font-size: 1.25rem; margin-top: 1.6em; }
.page ul, .page ol { padding-left: 22px; }
.contacts { list-style: none; padding: 0; }
.contacts li { margin-bottom: 10px; }
.contacts-label { display: inline-block; min-width: 110px; color: var(--muted); }

/* --- подвал -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 26px 0; }
.footer-row { display: grid; gap: 14px; }
.footer-brand { margin: 0 0 4px; font-weight: 700; }
.footer-row nav { display: flex; flex-wrap: wrap; gap: 14px; }
.site-footer p { margin: 0; }

/* --- планшет / десктоп --------------------------------------------------- */
@media (min-width: 700px) {
  .wrap { padding: 0 24px; }
  .head-row { grid-template-columns: auto 1fr auto; }
  .rubrics { grid-column: auto; overflow: visible; justify-content: center; }
  .search { grid-column: auto; }
  .search input { width: 200px; }
  .feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-row { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .footer-row > .muted.small { grid-column: 1 / -1; }
}

@media (min-width: 1060px) {
  .feed { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feed .card:first-child { grid-column: span 2; grid-template-columns: 1.05fr 1fr; }
  .feed .card:first-child .card-cover { aspect-ratio: 4 / 3; height: 100%; }
  .feed .card:first-child .card-body { display: flex; flex-direction: column; justify-content: center; }
  .feed .card:first-child .card-title { font-size: 1.5rem; }
  .feed .card:first-child .card-summary { font-size: 1rem; }
  .post, .related, .page, .feed-head { max-width: 780px; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1f6; --ink-soft: #c3cad6; --muted: #98a1b0; --line: #262c38;
    --bg: #0e1117; --bg-soft: #151a23; --accent: #7ea2ff; --accent-ink: #b9ccff;
    --accent-soft: #1a2333; --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  }
  .site-header { background: rgba(14, 17, 23, .94); }
  .search button { background: var(--accent); color: #0e1117; }
  .rubric { color: var(--accent-ink); }
  .facts { border-color: #26344f; }
  .card-cover { background: #1b2130; }
}

@media print {
  .site-header, .site-footer, .related, .pager, .search { display: none; }
  body { font-size: 12pt; }
}
