/* Инструмент дня — стили (палитра под неон-лого: спокойный тёмный тил + мягкий фон) */
:root {
  --accent: #0e7490;      /* тёмный тил для текста/ссылок — в тон лого, не режет глаз */
  --accent-bright: #22d3ee; /* яркая бирюза — только мелкие акценты */
  --text: #1e293b;
  --muted: #64748b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.7;
  color: var(--text);
  background: #f1f5f9;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.2rem;
}
/* Шапка */
header {
  background: #0f172a; color: #e2e8f0;
  border-radius: 12px; margin-bottom: 1.2rem; padding: .8rem 1.2rem;
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
}
header img { border-radius: 50%; display: block; }
header .brand { font-size: 1.1rem; font-weight: 700; color: #fff; text-decoration: none; display: flex; align-items: center; gap: .7rem; }
header .brand span em { font-style: normal; color: var(--accent-bright); }
nav { margin-left: auto; display: flex; gap: 1rem; }
nav a { color: #94a3b8; text-decoration: none; font-size: .92rem; font-weight: 500; }
nav a:hover, nav a[aria-current] { color: var(--accent-bright); }

/* Подвал */
footer {
  background: #0f172a; color: #94a3b8;
  border-radius: 12px; margin-top: 1.4rem; padding: 1.4rem 1.2rem;
  text-align: left; font-size: .9rem;
}
footer .cols { display: flex; gap: 2rem; flex-wrap: wrap; }
footer .col { min-width: 160px; }
footer h4 { color: #e2e8f0; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
footer a { color: #94a3b8; text-decoration: none; display: block; margin: .25rem 0; }
footer a:hover { color: var(--accent-bright); }
footer .legal {
  margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid #1e293b;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
  font-size: .8rem; color: #64748b;
}
footer .legal .links { display: flex; gap: 1.2rem; align-items: center; }
footer .legal .links a { margin: 0; display: inline; }
footer .social { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: #1e293b; }
footer .social:hover { background: var(--accent); }
footer .social svg { width: 16px; height: 16px; fill: #e2e8f0; }
main { background: #fff; border-radius: 12px; padding: 1.6rem; box-shadow: 0 2px 10px rgba(15,23,42,.06); }
h1 { font-size: 1.6rem; color: #0f172a; margin-bottom: .3rem; }
.meta { color: var(--muted); font-size: .85rem; margin-bottom: 1.2rem; }
article h2 { margin: 1.2rem 0 .4rem; font-size: 1.15rem; color: #0f172a; }
article p { margin: .6rem 0; }
article ul, article ol { padding-left: 1.3rem; margin: .6rem 0; }
article a { color: var(--accent); }
img { max-width: 100%; border-radius: 10px; margin: .8rem 0; }
footer { color: var(--muted); font-size: .85rem; }
.card { display:block; background:#fff; border-radius:10px; padding:1rem; margin:.7rem 0;
  box-shadow:0 1px 6px rgba(15,23,42,.06); text-decoration:none; color:inherit; }
.card h2 { font-size:1.05rem; color:var(--accent); }
.card p { color:#475569; font-size:.92rem; margin-top:.3rem; }
/* Кнопка подписки на канал */
.subscribe {
  display:flex; align-items:center; justify-content:center; gap:.6rem;
  margin: 1rem 0 1.4rem; padding: .8rem 1.2rem;
  background: var(--accent); color:#fff !important; text-decoration:none;
  border-radius: 10px; font-weight: 600;
}
.subscribe:hover { background:#155e75; }

/* CTA в шапке (принцип IDBI: призыв к действию виден первым) */
header .cta {
  margin-left: 1rem; padding: .45rem .9rem;
  background: var(--accent); color: #fff !important;
  border-radius: 8px; font-size: .9rem; font-weight: 600; text-decoration: none;
}
header .cta:hover { background: #155e75; }
/* Кнопка наверх (принцип IDBI для футера) */
footer .top-link { float: right; margin-top: -2.2rem; color: var(--accent-bright); text-decoration: none; font-weight: 600; }

/* Карточки статей: иконка + категория */
.card { display:flex; gap:.9rem; align-items:flex-start; }
.card .thumb { flex:0 0 44px; width:44px; height:44px; border-radius:10px; display:flex; align-items:center; justify-content:center; }
.card .thumb svg { width:24px; height:24px; }
.card .body { flex:1; }
.card h2 { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.tag { font-size:.68rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em; padding:.12rem .5rem; border-radius:99px; color:#fff; }
.tag-seo { background:#0e7490; } .tag-automation { background:#155e75; } .tag-ai { background:#0f766e; }
.tag-hosting { background:#1e40af; } .tag-business { background:#b45309; } .tag-ads { background:#b45309; } .tag-data { background:#6d28d9; }
.tag-content { background:#be185d; } .tag-saas { background:#15803d; } .tag-security { background:#334155; } .tag-client { background:#7c2d12; }

/* Мобильная шапка: колонкой, кнопка на всю ширину */
@media (max-width: 620px) {
  header { flex-direction: column; align-items: stretch; gap: .6rem; }
  header .brand { justify-content: center; }
  nav { margin: 0; flex-wrap: wrap; justify-content: center; gap: .8rem; }
  header .cta { display: flex; justify-content: center; margin-left: 0; width: 100%; box-sizing: border-box; }
  .card { flex-direction: row; }
}

/* Типографика статей (мобильное чтение) */
article { font-size: 1.06rem; line-height: 1.75; max-width: 720px; margin: 0 auto; }
article h2 { margin-top: 1.6rem; border-bottom: 2px solid #e2e8f0; padding-bottom: .3rem; }
article ul li, article ol li { margin: .35rem 0; }
article ul { list-style: none; padding-left: 1.2rem; }
article ul li { position: relative; }
article ul li::before { content: "▸"; position: absolute; left: -1.1rem; color: var(--accent-bright); font-weight: 700; }
article ol li::marker { color: var(--accent); font-weight: 700; }
article blockquote { border-left: 4px solid var(--accent-bright); background: #f8fafc; margin: 1rem 0; padding: .6rem 1rem; border-radius: 0 8px 8px 0; color: #475569; }
article strong { color: #0f172a; }
/* CTA в конце статьи */
.cta-end {
  margin-top: 1.6rem; padding: 1.1rem 1.2rem; text-align: center;
  background: #0f172a; border-radius: 12px; color: #cbd5e1; max-width: 720px; margin-left: auto; margin-right: auto;
}
.cta-end strong { color: #fff; display: block; font-size: 1.05rem; margin-bottom: .3rem; }
.cta-end a { display: inline-block; margin-top: .5rem; padding: .5rem 1.1rem; background: var(--accent); color: #fff !important; border-radius: 8px; text-decoration: none; font-weight: 600; }
.cta-end a:hover { background: #155e75; }
/* Читайте также */
.related { max-width: 720px; margin: 1.6rem auto 0; }
.related h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .6rem; }
.related a { display: block; padding: .6rem .9rem; background: #fff; border-radius: 10px; margin: .5rem 0; text-decoration: none; color: var(--text); box-shadow: 0 1px 5px rgba(15,23,42,.05); font-weight: 600; }
.related a:hover { color: var(--accent); }
/* Микро-анимации */
.card { transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(15,23,42,.10); }
a { transition: color .15s ease; }
@media (prefers-reduced-motion: reduce) { .card, a { transition: none; } }

/* Виджет Telegram: ровно на мобильном */
.tg-wrap { max-width: 520px; margin: 1.2rem auto; overflow: hidden; }
.tg-wrap iframe { width: 100% !important; max-width: 100% !important; border: none !important; border-radius: 12px; display: block; background: #fff; }
@media (max-width: 560px) {
  .tg-wrap { margin: 1rem 0; }
}

/* Факты и источники: компактные блоки для практических разборов */
.quick-facts {
  margin: 1.2rem 0 1.5rem; padding: 1rem 1.1rem;
  background: #f8fafc; border-left: 4px solid var(--accent-bright);
  border-radius: 0 10px 10px 0; font-size: .98rem; line-height: 1.55;
}
.quick-facts > strong { display:block; color:var(--accent); font-size:1.05rem; margin-bottom:.35rem; }
.quick-facts p { margin:.25rem 0 .55rem; }
.quick-facts ul { margin:.35rem 0 0; padding-left:1.2rem; }
.quick-facts li { margin:.25rem 0; }
.source-note {
  margin-top: 1.5rem; padding: .8rem 1rem; color: #475569;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: .88rem; line-height: 1.55;
}
.source-note strong { color: var(--text); }

/* Иллюстрация статьи: название и авторство */
.article-hero { max-width: 720px; margin: 1.15rem auto 1.35rem; }
.article-hero img { display:block; width:100%; height:auto; margin:0; border-radius:12px; }
.article-hero figcaption { margin-top:.45rem; color:#64748b; font-size:.82rem; line-height:1.45; }
.article-hero figcaption strong { color:#334155; }

/* Фильтры каталога: работают на клиенте и не меняют URL/SEO-разметку */
.filters { display:flex; align-items:center; flex-wrap:wrap; gap:.45rem; margin:1rem 0 1.15rem; padding:.75rem; background:#0f172a; border:1px solid #1e293b; border-radius:12px; }
.filters-label { color:#94a3b8; font-size:.82rem; margin-right:.15rem; }
.filter-btn { appearance:none; border:1px solid #334155; background:#1e293b; color:#cbd5e1; border-radius:999px; padding:.32rem .7rem; font:inherit; font-size:.8rem; cursor:pointer; transition:background .15s ease,color .15s ease,border-color .15s ease,transform .15s ease; }
.filter-btn:hover { border-color:var(--accent-bright); color:#fff; transform:translateY(-1px); }
.filter-btn.is-active { background:var(--accent); border-color:var(--accent-bright); color:#fff; box-shadow:0 0 0 1px rgba(34,211,238,.2); }
.filter-count { color:#64748b; font-size:.78rem; margin-left:auto; }
.card[hidden] { display:none; }
@media (max-width:620px) { .filters { align-items:stretch; } .filters-label { width:100%; } .filter-btn { flex:0 0 auto; } .filter-count { width:100%; margin:0; text-align:right; } }
@media (prefers-reduced-motion:reduce) { .filter-btn { transition:none; } }

/* Фильтры каталога: клиентская фильтрация без новых URL и SEO-дублей */
.filters { display:flex; align-items:center; flex-wrap:wrap; gap:.45rem; margin:1rem 0 1.15rem; padding:.75rem; background:#0f172a; border:1px solid #1e293b; border-radius:12px; }
.filters-label { color:#94a3b8; font-size:.82rem; margin-right:.15rem; }
.filter-btn { appearance:none; border:1px solid #334155; background:#1e293b; color:#cbd5e1; border-radius:999px; padding:.32rem .7rem; font:inherit; font-size:.8rem; cursor:pointer; transition:background .15s ease,color .15s ease,border-color .15s ease,transform .15s ease; }
.filter-btn:hover { border-color:var(--accent-bright); color:#fff; transform:translateY(-1px); }
.filter-btn.is-active { background:var(--accent); border-color:var(--accent-bright); color:#fff; box-shadow:0 0 0 1px rgba(34,211,238,.2); }
.filter-count { color:#64748b; font-size:.78rem; margin-left:auto; }
.card[hidden] { display:none; }
@media (max-width:620px) { .filters { align-items:stretch; } .filters-label { width:100%; } .filter-count { width:100%; margin:0; text-align:right; } }
@media (prefers-reduced-motion:reduce) { .filter-btn { transition:none; } }

/* === Адаптивность: код, таблицы и медиа не должны растягивать страницу === */
html, body { max-width: 100%; overflow-x: hidden; }
img, video, iframe, table, pre { max-width: 100%; }
pre {
  background: #0f172a; color: #e2e8f0;
  padding: .85rem 1rem; border-radius: 10px; margin: .9rem 0;
  font-size: .86rem; line-height: 1.55;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  overflow-x: auto;
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
article p code, article li code { background: #f1f5f9; color: #0f172a; padding: .08em .35em; border-radius: 4px; }
pre code { background: none; color: inherit; padding: 0; white-space: pre-wrap; }
table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .92rem; table-layout: fixed; }
th, td { border: 1px solid #e2e8f0; padding: .5rem .6rem; text-align: left; vertical-align: top; word-break: break-word; overflow-wrap: anywhere; }
th { background: #f8fafc; color: #0f172a; }
