/* ==========================================================================
   amoBridge — блог
   Дополнение к styles.css. Подключается только на /blog/ и /blog/*.html
   Использует токены из :root в styles.css
   ========================================================================== */

/* ---------- Общая обёртка страницы ---------- */
.page-head { padding: 40px 0 8px; }
.page-head .lead {
  font-size: 19px; line-height: 1.55; color: var(--muted);
  max-width: 56ch; margin-top: 14px;
}
.page-head h1 { font-size: clamp(30px, 3.2vw, 42px); font-weight: 600; margin-top: 10px; }
.page-head h1.eyebrow-h1 {
  font-size: 16px; font-weight: 700; color: var(--accent);
  letter-spacing: .01em; line-height: 1.2; margin: 0 0 6px;
}

/* ---------- Хлебные крошки ---------- */
.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--muted-2); margin-bottom: 18px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs__sep { color: var(--line); }
.crumbs [aria-current="page"] { color: var(--muted-2); }
@media (max-width: 720px) {
  .crumbs .crumbs__last, .crumbs .crumbs__last-sep { display: none; }
}

/* ---------- Чипы-фильтры ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--line);
  font: 600 14px/1 'Onest', system-ui, sans-serif; color: var(--ink);
  cursor: pointer; transition: .18s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.chip__count { font-size: 12px; font-weight: 700; color: var(--muted-2); }
.chip[aria-pressed="true"] .chip__count { color: rgba(255,255,255,.75); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Сетка постов ---------- */
.post-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
@media (max-width: 1080px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); transition: .22s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: #cfdaea; }
.post-card:focus-within { outline: 3px solid var(--accent-10); outline-offset: 2px; }

.post-card__media {
  position: relative; aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #eef3fb 0%, #dfe9f8 100%);
  display: flex; align-items: center; justify-content: center;
}
.post-card__media--dark { background: linear-gradient(135deg, #101a33 0%, #020617 100%); }
.post-card__media svg { width: 74px; height: 74px; color: var(--accent); opacity: .85; }
.post-card__media--dark svg { color: var(--orange); }
.post-card__badge {
  position: absolute; top: 14px; left: 14px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(4px);
  font-size: 12px; font-weight: 700; color: var(--accent);
}

.post-card__body { padding: 24px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--muted-2); margin: 0 0 12px;
}
.post-meta__sep { color: var(--line); }
.post-card__title { font-size: 21px; font-weight: 700; line-height: 1.22; margin: 0 0 12px; }
.post-card__title a { color: var(--ink); text-decoration: none; }
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt { font-size: 15.5px; line-height: 1.6; color: var(--muted); margin: 0 0 20px; }
.post-card__more {
  margin-top: auto; display: inline-flex; align-items: center; gap: 7px;
  font-size: 14.5px; font-weight: 600; color: var(--accent);
}
.post-card__more svg { width: 16px; height: 16px; }

/* ---------- Планируемые темы ---------- */
.soon { margin-top: 44px; padding: 28px 30px; background: var(--bg); border-radius: var(--radius); }
.soon h3 { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.soon ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.soon li {
  padding: 8px 14px; background: var(--white); border: 1px solid var(--line);
  border-radius: 999px; font-size: 14px; color: var(--muted);
}

/* ==========================================================================
   Страница статьи
   ========================================================================== */
.pill {
  display: inline-block; padding: 6px 13px; border-radius: 999px;
  background: var(--accent-10); color: var(--accent);
  font-size: 13px; font-weight: 700; margin-bottom: 16px;
}
.article-head h1 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 600; max-width: 22ch; }
.article-head .post-meta { margin-top: 18px; font-size: 15px; }

.article-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 290px;
  gap: 36px; align-items: start; padding: 40px 0 8px;
}
@media (max-width: 1080px) {
  .article-grid { grid-template-columns: 1fr; gap: 28px; }
  .toc-wrap { order: -1; }
}

/* ---------- Автор ---------- */
.author {
  display: grid; grid-template-columns: 64px 1fr; gap: 18px; align-items: start;
  padding: 22px 24px; background: var(--bg); border-radius: var(--radius-sm);
  margin-bottom: 36px;
}
.author__photo {
  position: relative; width: 64px; height: 64px; border-radius: 50%;
  background: var(--accent); color: #fff; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; flex-shrink: 0;
}
/* Инициалы — подложка на случай, если фото не загрузилось */
.author__photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.author__name { font-size: 16px; font-weight: 700; }
.author__role { font-size: 13.5px; color: var(--muted-2); margin-top: 2px; }
.author__quote { font-size: 15px; line-height: 1.6; color: var(--muted); margin-top: 10px; }

/* ---------- Типографика текста ---------- */
.prose { font-size: 17.5px; line-height: 1.72; color: var(--ink); }
.prose p { margin: 0 0 20px; color: var(--ink); }
.prose h2 {
  font-size: clamp(24px, 2.4vw, 30px); font-weight: 600;
  margin: 46px 0 16px; scroll-margin-top: 100px; line-height: 1.2;
}
.prose h3 {
  font-size: 20px; font-weight: 700;
  margin: 32px 0 12px; scroll-margin-top: 100px; line-height: 1.3;
}
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 22px; }
.prose li { margin-bottom: 9px; }
.prose ul li::marker { color: var(--accent); }
.prose ol li::marker { color: var(--accent); font-weight: 700; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.prose code {
  font: 500 14.5px/1.5 var(--p-mono);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 6px; color: var(--accent);
}
.prose pre {
  background: var(--p-bg); color: var(--p-text);
  border-radius: var(--radius-sm); padding: 20px 22px;
  overflow-x: auto; margin: 0 0 22px;
  font: 400 14px/1.65 var(--p-mono);
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

/* Диалог с ассистентом */
.dialog { margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; }
.dialog__row { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.dialog__ava {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--muted-2);
}
.dialog__ava--ai { background: var(--accent); }
.dialog__bubble {
  background: var(--bg); border-radius: 14px; padding: 13px 17px;
  font-size: 16px; line-height: 1.6;
}
.dialog__row--ai .dialog__bubble { background: #eef3fb; }

/* Врезка-заметка */
.note {
  display: grid; grid-template-columns: 22px 1fr; gap: 14px;
  padding: 20px 22px; border-radius: var(--radius-sm);
  background: rgba(247,162,59,.09); border: 1px solid rgba(247,162,59,.28);
  margin: 0 0 24px; font-size: 16px; line-height: 1.6;
}
.note svg { width: 22px; height: 22px; color: var(--orange); margin-top: 2px; }
.note p:last-child { margin-bottom: 0; }
.note--info { background: var(--accent-10); border-color: rgba(26,83,198,.22); }
.note--info svg { color: var(--accent); }

/* Таблица */
.prose .table-scroll { overflow-x: auto; margin: 0 0 24px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; min-width: 520px; }
.prose th, .prose td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { font-weight: 700; color: var(--ink); background: var(--bg); }
.prose td { color: var(--muted); vertical-align: top; }

/* ---------- Содержание ---------- */
.toc-wrap { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 1081px) { .toc-wrap { position: sticky; top: 100px; } }
.toc {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 8px 10px;
}
.toc__title {
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  text-transform: uppercase; letter-spacing: .07em;
  padding: 0 10px; margin-bottom: 4px;
  cursor: pointer; list-style: none; display: flex;
  align-items: center; justify-content: space-between;
}
.toc__title::-webkit-details-marker { display: none; }
.toc__title::after { content: '−'; color: var(--muted-2); font-size: 18px; letter-spacing: 0; }
.toc:not([open]) .toc__title::after { content: '+'; }
.toc__list { margin-top: 4px; max-height: 46vh; overflow-y: auto; }
.toc__list ul {
  list-style: none; margin: 0; padding: 0;   /* снимаем браузерный отступ списка */
  display: flex; flex-direction: column; gap: 0;
}
.toc__link {
  display: block; padding: 9px 10px; border-radius: 10px;
  font-size: 14.5px; line-height: 1.35; color: var(--muted); text-decoration: none;
}
.toc__link:hover { color: var(--accent); background: var(--bg); }
.toc__link.is-active { color: var(--accent); font-weight: 700; background: var(--accent-10); }
.toc__link--sub { padding-left: 24px; }

/* Карточка-CTA в сайдбаре */
.side-cta {
  background: var(--dark); color: #e9eefc;
  border-radius: var(--radius-sm); padding: 24px 22px;
}
.side-cta__tag { font-size: 12.5px; font-weight: 700; color: var(--orange); margin-bottom: 8px; }
.side-cta h2 { font-size: 19px; font-weight: 700; margin-bottom: 10px; color: #fff; }
.side-cta p { font-size: 14.5px; line-height: 1.55; color: #9fb0d4; margin-bottom: 16px; }
.side-cta .btn { width: 100%; }

/* ---------- Навигация блога в шапке ---------- */
.nav__back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14.5px; font-weight: 500; color: var(--muted);
  text-decoration: none; padding: 8px 11px; border-radius: 10px;
}
.nav__back:hover { color: var(--accent); background: var(--bg); }
.nav__back svg { width: 15px; height: 15px; }
@media (max-width: 720px) { .nav__back span { display: none; } }
