/* ============================================================
   Блог КЛЮЧНИК.РФ. Палитра сайта, оранжевого из старой палитры больше нет.
   Список: промо-блок плюс сетка карточек с категориями.
   Статья: два переключателя классами на <article>:
     .post--steps — тело нумерованными шагами
     .post--toc   — боковое оглавление и карточка вызова
   ============================================================ */

.blog-main { padding-block: clamp(28px, 4vw, 48px) clamp(48px, 7vw, 88px); }
.blog-head { max-width: 62ch; margin-bottom: clamp(24px, 3vw, 34px); }
.blog-head h1 { font-size: clamp(1.5rem, 2.7vw, 2.1rem); letter-spacing: -.03em; margin-bottom: 12px; }
.blog-head p { color: var(--muted); font-size: 1.01rem; }

/* категории */
.cat { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 7px;
  border-radius: 999px; font-size: .73rem; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.cat svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cat--now { background: var(--gold); color: #2a1f05; }
.cat--price { background: var(--gold-wash); color: var(--gold-ink); border: 1px solid rgba(212,168,67,.5); }
.cat--law { background: var(--white); color: var(--slate); border: 1px solid var(--line); }
.cat--safe { background: var(--slate); color: #fff; }

/* фильтры */
.blog-filters { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px;
  padding-bottom: 6px; scrollbar-width: none; }
.blog-filters::-webkit-scrollbar { display: none; }
.blog-filters a { flex: none; padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); font-size: .86rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.blog-filters a:hover { color: var(--slate); border-color: var(--slate); }
.blog-filters a.is-on { background: var(--slate); color: #fff; border-color: var(--slate); }

/* промо-блок */
.blog-promo { display: grid; overflow: hidden; margin-bottom: 20px; background: var(--white);
  border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); }
@media (min-width: 820px) { .blog-promo { grid-template-columns: 1.05fr 1fr; } }
.blog-promo img { display: block; width: 100%; height: 100%; min-height: 200px; object-fit: cover; }
.blog-promo__body { display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: clamp(22px, 3vw, 30px); }
.blog-promo__body h2 { font-size: clamp(1.2rem, 2vw, 1.6rem); line-height: 1.24; }
.blog-promo__body h2 a:hover { color: var(--gold-ink); }
.blog-promo__body p { color: var(--muted); font-size: .96rem; }
.blog-promo__more { align-self: flex-start; padding-bottom: 2px; color: var(--gold-ink);
  border-bottom: 2px solid var(--gold); font-size: .92rem; font-weight: 700; }

/* сетка карточек */
.blog-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 0; }
@media (min-width: 700px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }
.blog-card { position: relative; display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  padding: 20px; background: var(--white); border: 1px solid var(--line-soft); border-radius: 20px;
  box-shadow: 0 12px 34px rgba(31,45,59,.06); transition: transform .2s ease, border-color .2s ease; }
.blog-card::before { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 0;
  background: var(--gold); transition: height .3s ease; }
.blog-card:hover { transform: translateY(-3px); border-color: rgba(212,168,67,.5); }
.blog-card:hover::before { height: 100%; }
.blog-card__ic { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
  background: var(--gold-soft); color: var(--slate); }
.blog-card__ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.blog-card h2 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.blog-card h2 a { color: inherit; }
.blog-card p { flex: 1; margin: 0; color: var(--muted); font-size: .89rem; line-height: 1.5; }
.blog-meta { display: flex; flex-wrap: wrap; gap: 5px 13px; color: var(--muted); font-size: .8rem; }
.blog-meta b { font-weight: 600; color: var(--slate); }

/* пагинация */
.blog-pagination { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.blog-pagination a { padding: 9px 15px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); font-size: .9rem; font-weight: 600; color: var(--slate); }
.blog-pagination a:hover { border-color: var(--gold); color: var(--gold-ink); }
.blog-pagination a.is-active { background: var(--slate); color: #fff; border-color: var(--slate); }

/* ---------- страница статьи ---------- */
.post-head { max-width: 62ch; margin-bottom: 20px; }
.post-head h1 { margin: 12px 0; max-width: 22ch; font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  line-height: 1.16; letter-spacing: -.03em; }
.post-answer { margin: 0 0 24px; padding: 18px 20px; background: var(--white);
  border: 1px solid var(--line-soft); border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.post-answer b { display: block; margin-bottom: 7px; color: var(--gold-ink); font-size: .73rem;
  font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.post-answer p { margin: 0; font-size: .99rem; line-height: 1.62; }
.blog-content { max-width: 68ch; line-height: 1.72; }
.blog-content h2 { margin: 30px 0 12px; font-size: 1.22rem; }
.blog-content h3 { margin: 22px 0 8px; font-size: 1.05rem; }
.blog-content p { color: #4a5a69; }
.blog-content ul, .blog-content ol { margin: 14px 0; padding-left: 0; list-style: none; }
.blog-content ul li { position: relative; margin-bottom: 8px; padding-left: 18px; color: #4a5a69; }
.blog-content ul li::before { content: ""; position: absolute; left: 0; top: 10px; width: 6px;
  height: 6px; border-radius: 50%; background: var(--gold); }
.post--steps .blog-content ol { counter-reset: st; }
.post--steps .blog-content ol > li { counter-increment: st; position: relative; margin-bottom: 20px;
  padding-left: 48px; }
.post--steps .blog-content ol > li::before { content: counter(st); position: absolute; left: 0; top: -2px;
  display: grid; place-items: center; width: 33px; height: 33px; border-radius: 50%;
  background: var(--gold); color: #2a1f05; font-size: .92rem; font-weight: 800; }
.post-warn { margin: 22px 0; padding: 16px 18px; background: var(--milk); border: 1px solid var(--line-soft);
  border-left: 4px solid var(--slate); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .94rem; }
.post-warn b { font-weight: 800; }
.post-author { display: flex; align-items: center; gap: 13px; margin: 24px 0; padding: 14px 16px;
  background: var(--white); border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.post-author img { width: 46px; height: 46px; flex: none; border-radius: 50%; object-fit: cover; }
.post-author b { display: block; font-size: .93rem; }
.post-author span { color: var(--muted); font-size: .83rem; }
.post-also { display: grid; gap: 10px; margin-top: 12px; }
@media (min-width: 700px) { .post-also { grid-template-columns: repeat(3, 1fr); } }
.post-also a { display: block; padding: 14px 16px; background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); font-size: .9rem; font-weight: 600; line-height: 1.36; }
.post-also a:hover { border-color: rgba(212,168,67,.55); }
.post-also a span { display: block; margin-bottom: 5px; color: var(--gold-ink); font-size: .72rem;
  font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }

/* две колонки с оглавлением */
.post-layout { display: grid; gap: 26px; }
@media (min-width: 960px) { .post--toc .post-layout { grid-template-columns: minmax(0,1fr) 270px; } }
.post-side { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 960px) { .post-side { position: sticky; top: 92px; align-self: start; } }
.post-toc { padding: 16px 18px; background: var(--white); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm); }
.post-toc b { display: block; margin-bottom: 10px; color: var(--muted); font-size: .73rem;
  font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.post-toc ul { margin: 0; padding: 0; list-style: none; }
.post-toc li { padding: 6px 0 6px 12px; border-left: 2px solid var(--line); font-size: .88rem; }
.post-toc a { color: var(--muted); }
.post-toc li:hover { border-left-color: var(--gold); }
.post-toc li:hover a, .post-toc li.is-on a { color: var(--slate); font-weight: 700; }
.post-toc li.is-on { border-left-color: var(--gold); }
.post-call { padding: 18px; background: var(--slate-2); color: #fff; border-radius: var(--radius-sm); }
.post-call > span { color: rgba(255,255,255,.6); font-size: .77rem; }
.post-call b { display: block; margin: 5px 0 11px; font-size: 1.16rem; letter-spacing: -.02em; }
.post-call b a { color: #fff; }
.post-call .pc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px;
  margin-bottom: 8px; border-radius: 12px; background: var(--gold); color: #2a1f05;
  font-size: .89rem; font-weight: 800; }
.post-call .pc-btn--tg { background: transparent; border: 1.5px solid rgba(255,255,255,.3); color: #fff; }
.post-call .pc-btn svg { width: 16px; height: 16px; fill: currentColor; }
.post-call p { margin: 9px 0 0; color: rgba(255,255,255,.55); font-size: .78rem; text-align: center; }
@media (max-width: 959px) {
  .post-toc { padding: 0; border: 0; background: none; }
  .post-toc details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
  .post-toc summary { padding: 13px 16px; cursor: pointer; list-style: none; font-size: .9rem; font-weight: 800; }
  .post-toc summary::-webkit-details-marker { display: none; }
  .post-toc ul { padding: 0 16px 14px; }
}
.blog-alert { padding: 18px 20px; background: var(--milk); border: 1px solid var(--line);
  border-left: 4px solid var(--slate); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); }

/* Банд внутри статьи. Классы без двойного дефиса: текст статьи хранится
   в базе и проходит через раннер миграций, который режет всё после «--». */
.cta-band .btn-phone {
  color: var(--white);
  background: var(--slate-2);
  box-shadow: 0 12px 36px rgba(31, 45, 59, 0.22);
}
.cta-band .btn-phone:hover { background: var(--slate); }
.cta-band .btn-tg-outline {
  color: var(--slate-2);
  background: transparent;
  border: 2px solid rgba(31, 45, 59, 0.45);
}
.cta-band .btn-tg-outline:hover { background: rgba(31, 45, 59, 0.08); border-color: var(--slate-2); }
.cta-band .btn-tg-outline svg { fill: #229ed9; }

/* Таблица цен внутри статьи */
.blog-content table {
  width: 100%;
  margin: 16px 0 22px;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.blog-content td {
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
.blog-content td:last-child {
  padding-left: 16px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

/* Шаги: заголовок шага внутри пункта списка */
.post--steps .blog-content ol > li > h3 {
  margin: 4px 0 8px;
  font-size: 1.08rem;
}

/* Предупреждение о справочном характере */
.post-note {
  margin-top: 22px;
  padding: 14px 16px;
  color: var(--muted);
  background: var(--milk);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

/* Хвост статьи после блока авторства */
.post-tail { margin-top: 8px; }
.post-tail > h2 { margin: 30px 0 12px; font-size: 1.22rem; }

/* FAQ внутри статьи */
.blog-content details.faq-item { max-width: 68ch; }

/* Пункты оглавления для шагов инструкции */
.post-toc li.is-sub { padding-left: 22px; font-size: 0.84rem; }
