/* Блог мойбух.рф — поверх /style.css главной (токены, шапка, кнопки, FAQ, форма).
   Своё здесь только то, чего на главной нет: шапка статьи, текст статьи,
   оглавление, карточки статей. Отступы — из шкалы главной: 4 8 12 16 24 32 40 48 64. */

/* ─── Шапка статьи / списка ─── */
.post-hero { padding: 96px 0 32px; }
@media (min-width: 768px) { .post-hero { padding: 128px 0 40px; } }
/* Статья и список — в контейнере 1180, всё по левому краю. */
.wrap--post { max-width: calc(1180px + 2 * var(--pad)); }
.post-hero__in > * { max-width: 860px; }
/* Статья: справа от заголовка — карточка услуги, по колонке оглавления ниже. */
.post-hero__grid > * { max-width: none; }
.post-hero__grid .svc { display: none; }
@media (min-width: 1024px) {
  .post-hero__grid { display: grid; grid-template-columns: minmax(0, 760px) 320px; gap: 64px;
    justify-content: space-between; align-items: end; }
  .post-hero__grid .svc { display: grid; }
}
.post-hero__text > * { max-width: 860px; }
.post-hero .kicker { margin-top: 24px; }
.post__title {
  margin: 16px 0 16px; font-size: 30px; line-height: 36px; font-weight: 600; letter-spacing: -.025em;
}
@media (min-width: 768px) { .post__title { font-size: 44px; line-height: 48px; letter-spacing: -.03em; } }
@media (min-width: 1280px) { .post__title { font-size: 52px; line-height: 56px; } }
.post__lead { max-width: 760px; }
.post__meta {
  display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 24px;
  font-size: 14px; line-height: 20px; color: var(--muted);
}
.post__meta span + span { position: relative; }
.post__meta span + span::before {
  content: ""; position: absolute; left: -14px; top: 9px; width: 4px; height: 4px; border-radius: 9999px; background: var(--line-2);
}

/* Хлебные крошки */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 14px; line-height: 20px; color: var(--muted); }
.crumbs li { display: inline-flex; gap: 8px; align-items: center; min-width: 0; }
.crumbs li + li::before { content: "/"; color: var(--line-2); }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; display: inline-block; }

/* Обложка */
.post__cover { display: block; margin: 0 0 40px; border-radius: 24px; overflow: hidden; background: var(--paper); }
.post__cover img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
@media (min-width: 1024px) { .post__cover img { aspect-ratio: 21 / 8; } }
.post__cover--empty { display: none; }

/* ─── Сетка статьи: текст + липкая колонка ─── */
.post__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-bottom: 48px; }
@media (min-width: 1024px) {
  .post__grid { grid-template-columns: minmax(0, 760px) 320px; gap: 64px; justify-content: space-between; }
  .post__aside { position: sticky; top: 104px; align-self: start; display: grid; gap: 24px; }
}
@media (max-width: 1023px) {
  .post__aside { order: -1; }
}

.toc { background: var(--card); border-radius: 20px; padding: 20px 24px; box-shadow: inset 0 0 0 1px var(--line); }
.toc__cap { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.toc ol { counter-reset: toc; display: grid; gap: 4px; }
.toc li { counter-increment: toc; }
.toc a {
  display: grid; grid-template-columns: 24px 1fr; padding: 4px 0;
  font-size: 15px; line-height: 22px; color: var(--ink-2); text-decoration: none; transition: color .3s var(--ease);
}
.toc a::before { content: counter(toc); color: var(--muted); font-variant-numeric: tabular-nums; }
.toc a:hover, .toc a.is-active { color: var(--accent); }
.toc a.is-active { font-weight: 600; }
@media (max-width: 1023px) {
  .toc { padding: 0; box-shadow: none; background: none; }
  .toc details summary { cursor: pointer; }
}

.svc { background: var(--dark); color: #fff; border-radius: 20px; padding: 24px; display: grid; gap: 12px; }
.svc__t { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.svc__d { font-size: 15px; line-height: 22px; color: rgba(255, 255, 255, .72); }
.svc .btn { margin-top: 4px; white-space: normal; text-align: center; }
.svc > * { min-width: 0; }
.svc__tel { font-size: 18px; line-height: 28px; font-weight: 600; text-decoration: none; text-align: center; }
.svc__tel:hover { color: #aec2ff; }

/* ─── Текст статьи ─── */
.prose { font-size: 17px; line-height: 28px; color: var(--ink); }
@media (min-width: 768px) { .prose { font-size: 18px; line-height: 30px; } }
.prose > * + * { margin-top: 20px; }
.prose h2 {
  margin-top: 56px; font-size: 26px; line-height: 32px; font-weight: 600; letter-spacing: -.02em; scroll-margin-top: 104px;
}
@media (min-width: 768px) { .prose h2 { font-size: 32px; line-height: 40px; } }
.prose h3 { margin-top: 36px; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; scroll-margin-top: 104px; }
.prose h2 + *, .prose h3 + * { margin-top: 16px; }
.prose > :first-child { margin-top: 0; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-2); text-decoration-thickness: 2px; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { display: grid; gap: 10px; }
.prose ul > li { position: relative; padding-left: 28px; }
.prose ul > li::before {
  content: ""; position: absolute; left: 6px; top: 12px; width: 8px; height: 8px; border-radius: 9999px; background: var(--accent);
}
@media (min-width: 768px) { .prose ul > li::before { top: 11px; } }
.prose ol { counter-reset: ol; }
.prose ol > li { position: relative; padding-left: 40px; counter-increment: ol; }
.prose ol > li::before {
  content: counter(ol); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 9999px;
  background: var(--accent-soft); color: var(--accent); font-size: 14px; line-height: 28px; font-weight: 700; text-align: center;
}
.prose li > ul, .prose li > ol { margin-top: 10px; }
.prose li p + p { margin-top: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 40px 0; }
.prose code { font-size: .9em; background: var(--paper); padding: 2px 6px; border-radius: 6px; }

/* Таблицы — без горизонтальной прокрутки (решение владельца 25.11.2026).
   В широкой колонке — обычная таблица на 100 %, текст в ячейках переносится.
   В узкой (по ширине колонки текста, не экрана) каждая строка — карточка
   «столбец — значение»; подписи сборщик кладёт в td[data-label]. */
.prose { container-type: inline-size; }
.post-table { border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.prose th, .prose td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.post-table[data-cols="5"] :is(th, td), .post-table[data-cols="6"] :is(th, td) { padding: 10px 10px; font-size: 14px; line-height: 20px; }
.prose th { font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: .02em; color: var(--muted); background: var(--paper); }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 500; }

/* Карточки. Без JS — когда колонка текста уже 560 px. С JS (blog.js) — любая
   таблица, которая не помещается в колонку целиком: класс .is-cards. */
@container (max-width: 559px) {
  .post-table :is(table, tbody, tr, td) { display: block; }
  .post-table thead { display: none; }
  .post-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .post-table tr:last-child { border-bottom: 0; }
  .post-table td { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 12px; padding: 4px 0; border: 0; font-size: 15px; line-height: 22px; }
  .post-table td::before { content: attr(data-label); font-size: 13px; line-height: 20px; color: var(--muted); font-weight: 500; }
  .post-table td:first-child { display: block; padding-bottom: 8px; font-size: 16px; font-weight: 600; }
  .post-table td:first-child::before { display: none; }
}
.post-table.is-cards :is(table, tbody, tr, td) { display: block; }
.post-table.is-cards thead { display: none; }
.post-table.is-cards tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.post-table.is-cards tr:last-child { border-bottom: 0; }
.post-table.is-cards td { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 12px; padding: 4px 0; border: 0; font-size: 15px; line-height: 22px; }
.post-table.is-cards td::before { content: attr(data-label); font-size: 13px; line-height: 20px; color: var(--muted); font-weight: 500; }
.post-table.is-cards td:first-child { display: block; padding-bottom: 8px; font-size: 16px; font-weight: 600; }
.post-table.is-cards td:first-child::before { display: none; }
/* 7+ столбцов в широкой колонке — компактнее */
.post-table:is([data-cols="7"], [data-cols="8"], [data-cols="9"]) :is(th, td) { padding: 10px 8px; font-size: 13px; line-height: 18px; }

/* Выноски */
.callout { border-radius: 16px; padding: 20px 24px; background: var(--card); box-shadow: inset 4px 0 0 var(--accent), inset 0 0 0 1px var(--line); }
.callout p + p { margin-top: 8px; }
.callout ul, .callout ol { margin-top: 8px; }
.callout--warn { background: #fff6ee; box-shadow: inset 4px 0 0 var(--risk), inset 0 0 0 1px rgba(255, 138, 61, .25); }
.callout--example { background: var(--paper); box-shadow: inset 4px 0 0 var(--accent); }
.callout strong:first-child { font-weight: 700; }

/* FAQ под статьёй — уже, чем на лендинге */
.post-faq .faq { max-width: 860px; }

/* ─── Карточки статей ─── */
.pgrid { display: grid; gap: 24px; }
@media (min-width: 640px) { .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.pcard__link {
  display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--card);
  border-radius: 20px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.pcard__link:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--line-2), 0 16px 40px rgba(20, 34, 62, .08); }
.pcard__img { display: block; aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--paper), #dfe7fb); overflow: hidden; }
.pcard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.pcard__link:hover .pcard__img img { transform: scale(1.04); }
.pcard__img--empty { display: block; }
.pcard__cat { margin: 20px 24px 0; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.pcard__t { margin: 8px 24px 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.pcard__link:hover .pcard__t { color: var(--accent); }
.pcard__d {
  margin: 8px 24px 0; font-size: 15px; line-height: 22px; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pcard__meta { margin: auto 24px 24px; padding-top: 16px; font-size: 13px; line-height: 18px; color: var(--muted); }

/* ─── Список статей ─── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.chip {
  display: inline-flex; gap: 8px; align-items: center; padding: 8px 16px; border-radius: 9999px; background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.chip span { color: var(--muted); font-weight: 500; }
.chip:hover { background: var(--ink); color: #fff; }
.chip:hover span { color: rgba(255, 255, 255, .6); }
.chip.is-active { background: var(--ink); color: #fff; box-shadow: none; }
.chip.is-active span { color: rgba(255, 255, 255, .6); }
.blog-list { padding-bottom: 64px; display: grid; gap: 48px; }

/* Постраничная навигация списка статей */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager__nums { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pager__num, .pager__step {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px;
  border-radius: 9999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px; line-height: 20px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background .3s var(--ease), color .3s var(--ease);
}
a.pager__num:hover, a.pager__step:hover { background: var(--ink); color: #fff; }
.pager__num.is-current { background: var(--ink); color: #fff; box-shadow: none; }
.pager__step.is-off { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); opacity: .5; }
.pager__gap { min-width: 20px; text-align: center; color: var(--muted); }
@media (max-width: 479px) {
  .pager { justify-content: center; }
  .pager__nums { order: -1; width: 100%; justify-content: center; }
  .pager__step { flex: 1 1 0; }
}
