/* ============================================================
   OmniSync — блог: список статей + страница статьи.
   Использует токены тем из styles.css.
   ============================================================ */

/* ---- общий герой раздела ---- */
.page-hero {
  position: relative;
  padding: calc(var(--header-h) + 78px) 0 48px;
  background-image: var(--hero-haze);
  background-repeat: no-repeat;
}
.page-back {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 26px;
  transition: color 0.2s ease;
}
.page-back:hover { color: var(--accent); }
.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 6px 15px;
  margin-bottom: 22px;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.6vw, 54px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  max-width: 15em;
}
.page-hero .lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  max-width: 40em;
}

/* ---- сетка карточек ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  padding-bottom: 100px;
}
.blog-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 26px 26px 24px;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.blog-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -24px var(--accent);
}
.blog-card .cat {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 11px;
  margin-bottom: 16px;
}
.blog-card h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 11px;
  text-wrap: pretty;
}
.blog-card p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
}
.blog-card .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--faint);
}
.blog-card .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

/* ---- страница статьи ---- */
.article-shell { padding-bottom: 100px; }
.article {
  max-width: 760px;
  margin: 0 auto;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--faint);
  margin-bottom: 18px;
}
.article-meta .cat {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 11px;
}
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }

/* типографика тела статьи */
.prose { color: var(--muted); font-size: 17px; line-height: 1.72; }
.prose > * + * { margin-top: 20px; }
.prose h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  margin-top: 44px;
  line-height: 1.25;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-top: 32px;
}
.prose p { text-wrap: pretty; }
.prose a { color: var(--accent); font-weight: 600; text-decoration: none; }
.prose a:hover { text-decoration: underline; }
/* Кнопки внутри статьи не должны перекрашиваться правилами .prose a */
.prose a.btn-primary { color: var(--accent-ink); font-weight: 600; }
.prose a.btn-ghost { color: var(--text); }
.prose a.btn:hover { text-decoration: none; }
.prose strong { color: var(--text); font-weight: 700; }
.prose ul, .prose ol { padding-left: 0; list-style: none; display: grid; gap: 11px; }
.prose ol { counter-reset: li; }
.prose li { position: relative; padding-left: 20px; }
.prose ul li::before {
  content: ""; position: absolute; left: 2px; top: 0.62em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}
.prose ol li { counter-increment: li; padding-left: 36px; min-height: 24px; }
.prose ol li::before {
  content: counter(li); position: absolute; left: 0; top: 0.05em;
  width: 24px; height: 24px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 22px;
  color: var(--text);
  font-size: 19px;
  font-style: italic;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
}
.prose pre {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  overflow-x: auto;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose img { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.prose hr { border: none; border-top: 1px solid var(--border); }

/* CTA в конце статьи */
.article-cta {
  margin-top: 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 32px 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.article-cta h3 {
  margin-top: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.article-cta p { color: var(--muted); font-size: 15px; }

@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .page-hero { padding-top: calc(var(--header-h) + 40px); }
  .prose { font-size: 16px; }
}
