/*
  Shared стили для статических страниц блога и других маркетинговых HTML.
  Инлайн-подключение через <link rel="stylesheet" href="/blog/_shared.css"> —
  живут вне SPA-бандла, поэтому Tailwind недоступен, свои переменные.
  Тёмная тема не тянется — приватного локал-стораджа тут нет; блог всегда светлый.
*/

:root {
  --bg: #ffffff;
  --surface: #f9fafb;
  --card: #ffffff;
  --ink: #1d2939;
  --muted: #667085;
  --border: #eaecf0;
  --accent: #465fff;
  --accent-hover: #364fdc;
  --accent-bg: #eef2ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --max: 1200px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Onest, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* Шапка */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.site-header__inner { display: flex; align-items: center; gap: 28px; padding: 14px 24px; max-width: var(--max); margin: 0 auto; flex-wrap: wrap; }
.site-header__logo { font-size: 20px; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.site-header__logo:hover { text-decoration: none; }
.site-header__logo .accent { color: var(--accent); }
.site-nav__list { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav__link { color: var(--ink); font-size: 15px; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav__link:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.site-header__cta { margin-left: auto; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 8px; font-size: 15px; font-weight: 500; text-decoration: none; transition: background 0.15s, color 0.15s; border: 1px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn--secondary:hover { background: var(--accent-bg); }
.btn--lg { padding: 14px 28px; font-size: 16px; }

/* Hero */
.hero { padding: 56px 0 40px; }
.hero__title { font-size: 42px; font-weight: 700; line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero__subtitle { font-size: 18px; color: var(--muted); max-width: 720px; margin: 0; }

/* Секции */
.section { padding: 40px 0; }

/* Сетка карточек блога */
.blog-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 720px)  { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }

.blog-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  color: var(--ink); text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.blog-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 8px 24px rgba(70,95,255,0.15); text-decoration: none; color: var(--ink); }
.blog-card__title { font-size: 18px; line-height: 1.35; margin: 0 0 12px; color: var(--ink); }
.blog-card__excerpt { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0 0 16px; flex: 1; }
.blog-card__excerpt code { background: var(--surface); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }
.blog-card__meta { color: var(--muted); font-size: 13px; margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }

/* Статья */
.article { max-width: 760px; padding: 32px 24px 64px; }
.article__breadcrumb { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.article__title { font-size: 36px; line-height: 1.15; font-weight: 700; margin: 0 0 12px; letter-spacing: -0.01em; }
.article__meta { color: var(--muted); font-size: 14px; margin: 0 0 32px; }
.article p { margin: 0 0 16px; }
.article h2 { font-size: 26px; line-height: 1.25; margin: 32px 0 12px; font-weight: 700; }
.article h3 { font-size: 20px; line-height: 1.3; margin: 24px 0 8px; font-weight: 600; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 24px; }
.article li { margin: 4px 0; }
.article code { background: var(--surface); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; font-family: ui-monospace, SFMono-Regular, monospace; }
.article pre { background: var(--surface); padding: 16px; border-radius: 8px; overflow-x: auto; margin: 16px 0; }
.article pre code { background: none; padding: 0; }
.article blockquote { border-left: 3px solid var(--accent); padding: 4px 16px; margin: 16px 0; color: var(--muted); }
.article table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.article th, .article td { border-bottom: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.article th { background: var(--surface); font-weight: 600; }

/* CTA-блок в конце страницы */
.cta-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 24px; text-align: center; }
.cta-block__title { font-size: 26px; margin: 0 0 12px; font-weight: 700; }
.cta-block__text { color: var(--muted); margin: 0 0 20px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* Подвал */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 32px 0 16px; margin-top: 40px; }
.site-footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; }
.site-footer__col-title { font-weight: 600; margin: 0 0 12px; font-size: 14px; }
.site-footer__list { list-style: none; padding: 0; margin: 0; }
.site-footer__list li { margin: 6px 0; font-size: 14px; }
.site-footer .muted { color: var(--muted); font-size: 14px; }
.site-footer__bottom { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 24px; color: var(--muted); font-size: 13px; }

/* Мобильная адаптация */
@media (max-width: 640px) {
  .hero__title { font-size: 32px; }
  .article__title { font-size: 28px; }
  .site-header__inner { gap: 16px; }
  .site-header__cta { margin-left: 0; }
  .site-nav__list { gap: 14px; }
}

/* Читайте также — блок перелинковки в конце статьи */
.read-also { border-top: 1px solid var(--border); margin: 40px 0 24px; padding-top: 24px; }
.read-also__title { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 14px; }
.read-also__list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.read-also__item { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; color: var(--fg); text-decoration: none; transition: border-color 0.15s, background 0.15s; }
.read-also__item:hover { border-color: var(--accent); background: var(--surface); }
.read-also__item-title { font-size: 15px; font-weight: 600; line-height: 1.3; margin: 0; }
