/* =====================================================
   Блог ВЦ «Система» — стили поверх style.css
   ===================================================== */

.blog-main {
  padding: calc(var(--header-h) + 48px) 0 100px;
  min-height: 60vh;
}

/* --- Индекс блога --- */
.blog-head {
  margin-bottom: 48px;
  max-width: 760px;
}
.blog-head h1 {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.blog-head__sub {
  color: var(--text-muted);
  font-size: 17px;
  margin: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.post-card__cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--bg-alt);
}
.post-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.post-card__title {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}
.post-card__title a {
  color: var(--text);
  transition: color 0.2s ease;
}
.post-card__title a:hover {
  color: var(--accent);
}
.post-card__desc {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  flex: 1;
}
.post-card__meta {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 4px;
}

.blog-empty {
  color: var(--text-muted);
  padding: 32px 0;
  font-size: 16px;
}

/* --- Страница статьи --- */
.post {
  max-width: 780px;
  margin: 0 auto;
}
.post__head {
  margin-bottom: 40px;
}
.post__back {
  font-size: 14px;
  color: var(--text-dim);
  margin: 0 0 20px;
}
.post__back a {
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.post__back a:hover { color: var(--accent); }

.post__title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  color: var(--text-dim);
  font-size: 14px;
}

/* Теги */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.tag a {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  transition: background 0.2s ease;
}
.tag a:hover { background: rgba(224, 163, 62, 0.24); }

/* --- Контент статьи (то, что вставляется из post.html) --- */
.post__body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
}
.post__body > * + * { margin-top: 1.2em; }
.post__body h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 2em 0 0.6em;
}
.post__body h3 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(20px, 2vw, 24px);
  line-height: 1.3;
  margin: 1.8em 0 0.5em;
}
.post__body h4 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 18px;
  margin: 1.5em 0 0.4em;
}
.post__body p { margin: 0; color: var(--text); }
.post__body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.post__body a:hover { color: var(--accent-hover); }
.post__body ul,
.post__body ol {
  padding-left: 1.4em;
  margin: 0;
  color: var(--text);
}
.post__body li + li { margin-top: 0.4em; }
.post__body strong { color: var(--text); }
.post__body em { color: var(--text); }

.post__body blockquote {
  margin: 1.6em 0;
  padding: 16px 24px;
  border-left: 3px solid var(--accent);
  background: var(--bg-elev);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-style: italic;
}
.post__body blockquote p { color: var(--text-muted); }

.post__body figure {
  margin: 1.8em 0;
}
.post__body figure img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}
.post__body figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--text-dim);
  text-align: center;
}

.post__body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.post__body video { max-width: 100%; border-radius: var(--radius); display: block; }
.post__body iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius);
  display: block;
}

.post__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 15px;
}
.post__body th,
.post__body td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.post__body th {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--accent);
  border-bottom-color: var(--border-strong);
}

.post__body code {
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
}
.post__body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}
.post__body pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: inherit;
}

.post__body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}

/* Callout */
.post__body .callout {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  color: var(--text);
  font-size: 15px;
}
.post__body .callout p { color: var(--text); }

/* --- Адаптив --- */
@media (max-width: 768px) {
  .post-grid { grid-template-columns: 1fr; }
  .blog-main { padding: calc(var(--header-h) + 32px) 0 72px; }
  .post__body { font-size: 16px; }
}
