/* css/article.css */

.article-master-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  max-width: 1140px;
  margin: 48px auto 120px;
  padding: 0 24px;
  align-items: start;
}

/* ЛЕВЫЙ САЙДБАР (Автор + Оглавление) */
.article-sidebar {
  position: sticky;
  top: 96px; /* отступ ниже прилипшей шапки */
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.author-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.author-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  background: var(--surface-2);
}

.author-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.author-title {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
}

.author-bio {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.toc-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}

.toc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
  margin-bottom: 14px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-list a {
  font-size: 13.5px;
  color: var(--text-muted);
  transition: color .15s ease, padding-left .15s ease;
}

.toc-list a:hover {
  color: var(--accent);
  padding-left: 4px;
}

/* ПРАВАЯ ЧАСТЬ (Тело статьи) */
.article-body {
  min-width: 0; /* защита от разрыва грида тегами <pre> */
}

/* СТРОКА МЕТА-ДАННЫХ (Дата | Время | Контакты) */
.article-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 13px; /* Сделали на пол-пикселя деликатнее */
  color: var(--text-faint); /* <-- Переключили весь блок в режим «Шёпот» */
  margin-bottom: 2.2rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  color: inherit; /* Магия: послушно наследует приглушенный faint от родителя */
}

/* Физическая вертикальная черта */
.meta-item:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 11px; /* Слегка укоротили под 13px шрифт */
  background-color: var(--border);
  margin-left: 0.9rem;
  opacity: 0.55; /* Погасили саму полоску, чтобы она не «звенела» */
  transform: translateY(1px);
}

.article-body h1 {
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 36px;
}

.article-content {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--text);
  max-width: 72ch;
}

.article-content h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 48px 0 16px;
  color: var(--text);
  scroll-margin-top: 100px; /* чтобы якорь не прыгал под шапку */
}

.article-content h3 {
  font-size: 19px;
  font-weight: 600;
  margin: 32px 0 12px;
}

.article-content p {
  margin-bottom: 20px;
  color: var(--text-muted);
}

.article-content strong {
  color: var(--text);
}

/* Блоки акцентов (Admonitions) */
.admonition {
  margin: 28px 0;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}

.admonition::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

.admonition.warn::before { background: var(--warn); }
.admonition.good::before { background: var(--good); }

.admonition-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admonition.warn .admonition-title { color: var(--warn); }
.admonition.good .admonition-title { color: var(--good); }

.admonition p:last-child { margin-bottom: 0; font-size: 15px; }

/* АДАПТИВ (Всегда строго в самом низу файла) */
@media (max-width: 920px) {
  .article-master-grid { grid-template-columns: 1fr; gap: 40px; margin-top: 32px; }
  .article-sidebar { position: static; gap: 20px; }
  .author-card { flex-direction: row; align-items: center; justify-content: space-between; }
  .author-bio { display: none; }
  .toc-container { display: none; } /* На мобилках оглавление скрываем ради экономии места */
}