/**
 * NIVEL — стили статей блога: таблицы и чеклисты
 * Подключается только на страницах статей (cache-bust через ?v=).
 * Не влияет на главную, /prices/ и остальные разделы.
 */

/* Шире колонка текста — только в блоге, чтобы широкие таблицы меньше скроллились */
body.page-blog-article .article-content {
  max-width: min(1080px, 100%);
}

/* Блок «Итог»: заголовок может быть h2 или h3 — оба должны быть светлыми на тёмном фоне */
.article-content .article-summary h2,
.article-content .article-summary h3,
.article-summary h2,
.article-summary h3 {
  color: #c9a961 !important;
  margin: 0 0 12px !important;
  font-size: 1.1rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
}

.article-content .article-summary p,
.article-summary p {
  color: rgba(255, 255, 255, 0.88) !important;
}

/* ===== Чеклист ===== */
.article-content ul.article-checklist,
.article-checklist {
  list-style: none !important;
  padding: 0 !important;
  margin: 20px 0 28px !important;
}

.article-checklist li {
  position: relative;
  padding: 10px 0 10px 36px !important;
  margin: 0 !important;
  border-bottom: 1px solid #f1f5f9;
  font-size: 16px;
  line-height: 1.55;
  list-style: none !important;
}

.article-checklist li:last-child {
  border-bottom: none;
}

.article-checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 10px;
  width: 22px;
  height: 22px;
  background: #16a34a;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.article-checklist li::marker {
  content: none;
}

/* ===== Таблицы ===== */
.article-content .article-table-wrap,
.article-table-wrap {
  display: block;
  margin: 28px 0;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.article-content table,
.article-table-wrap table,
.article-content .article-table-wrap table {
  display: table !important;
  width: 100% !important;
  min-width: 0;
  max-width: none !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  table-layout: auto !important;
  font-size: 14.5px;
  line-height: 1.5;
  color: #0f172a;
  margin: 0 !important;
  background: #fff;
}

.article-content thead,
.article-table-wrap thead {
  display: table-header-group !important;
}

.article-content tbody,
.article-table-wrap tbody {
  display: table-row-group !important;
}

.article-content tr,
.article-table-wrap tr {
  display: table-row !important;
}

.article-content th,
.article-content td,
.article-table-wrap th,
.article-table-wrap td {
  display: table-cell !important;
  padding: 13px 14px !important;
  border: none !important;
  border-bottom: 1px solid #f1f5f9 !important;
  vertical-align: top !important;
  text-align: left !important;
  background: transparent;
}

.article-content thead th,
.article-table-wrap thead th,
.article-content tr:first-child > th,
.article-table-wrap tr:first-child > th {
  background: linear-gradient(135deg, #fffdf7 0%, #fff8e6 100%) !important;
  color: #0f172a !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid rgba(201, 169, 97, 0.4) !important;
  white-space: nowrap;
}

.article-content tbody tr:nth-child(even) td,
.article-table-wrap tbody tr:nth-child(even) td {
  background: #fafbfc !important;
}

.article-content tbody tr:hover td,
.article-table-wrap tbody tr:hover td {
  background: rgba(201, 169, 97, 0.08) !important;
}

.article-content tbody tr:last-child td,
.article-table-wrap tbody tr:last-child td {
  border-bottom: none !important;
}

.article-content td:first-child,
.article-table-wrap td:first-child,
.article-content th:first-child,
.article-table-wrap th:first-child {
  font-weight: 700 !important;
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff !important;
  box-shadow: 4px 0 10px rgba(15, 23, 42, 0.04);
  min-width: 120px;
}

.article-content thead th:first-child,
.article-table-wrap thead th:first-child,
.article-content tr:first-child > th:first-child,
.article-table-wrap tr:first-child > th:first-child {
  background: linear-gradient(135deg, #fffdf7 0%, #fff8e6 100%) !important;
  z-index: 2;
}

.article-content tbody tr:nth-child(even) td:first-child,
.article-table-wrap tbody tr:nth-child(even) td:first-child {
  background: #fafbfc !important;
}

.article-content tbody tr:hover td:first-child,
.article-table-wrap tbody tr:hover td:first-child {
  background: #f7f0de !important;
}

.article-content caption,
.article-table-wrap caption {
  caption-side: bottom;
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  color: #5b6577;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
}

@media (max-width: 900px) {
  body.page-blog-article .article-content {
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .article-table-wrap {
    margin: 22px -8px;
    border-radius: 14px;
  }

  /* На узких экранах оставляем мягкий горизонтальный скролл только у таблицы */
  .article-content table,
  .article-table-wrap table {
    min-width: 520px;
    font-size: 13px;
  }

  .article-content th,
  .article-content td,
  .article-table-wrap th,
  .article-table-wrap td {
    padding: 10px 11px !important;
  }

  .article-content thead th,
  .article-table-wrap thead th,
  .article-content tr:first-child > th,
  .article-table-wrap tr:first-child > th {
    white-space: normal;
  }

  .article-checklist li {
    font-size: 15px;
    padding-left: 34px !important;
  }
}

/* ===== Список без маркеров (чек-лист текстом) ===== */
.article-content ul.article-plainlist,
.article-plainlist {
  list-style: none !important;
  margin: 16px 0 24px !important;
  padding: 0 !important;
}
.article-plainlist li {
  list-style: none !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  font-size: 17px;
  line-height: 1.7;
  color: inherit;
}
.article-plainlist li::before,
.article-plainlist li::marker {
  content: none !important;
  display: none !important;
}
.article-plainlist li:last-child {
  margin-bottom: 0 !important;
}

/* ===== FAQ в статье ===== */
.article-content .article-faq,
.article-content .accordion {
  margin: 28px 0 36px;
}

.article-content .accordion__item button {
  font-family: "Manrope", sans-serif;
}

.article-content .accordion__item > div p {
  margin: 0 0 10px;
  color: #5b6577;
  font-size: 15px;
  line-height: 1.65;
}

.article-content .accordion__item > div p:last-child {
  margin-bottom: 0;
}

/* ===== Лид и разделитель ===== */
.article-content .article-lead {
  font-size: 1.15rem !important;
  line-height: 1.7 !important;
  color: #334155 !important;
  font-weight: 500;
  margin: 0 0 24px !important;
  padding-left: 16px;
  border-left: 3px solid #c9a961;
}

.article-content hr.article-divider,
.article-divider {
  border: 0;
  height: 1px;
  margin: 36px auto;
  max-width: 180px;
  background: linear-gradient(90deg, transparent, #c9a961, transparent);
}

/* ===== Акцентный callout ===== */
.article-content .callout--accent,
.callout--accent {
  background: #fffdf7;
  border-color: #c9a961;
  color: #8a6d2b;
}
.callout--accent strong { color: #8a6d2b; }
.callout--accent p { color: #6b5422; }

/* ===== Заметка ===== */
.article-content .article-note {
  margin: 20px 0 28px;
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.article-content .article-note p {
  margin: 0 !important;
  font-size: 15px !important;
  color: #5b6577 !important;
  line-height: 1.6 !important;
}

/* ===== Этапы ===== */
.article-content ol.article-steps,
.article-steps {
  list-style: none !important;
  counter-reset: article-step;
  margin: 24px 0 32px !important;
  padding: 0 !important;
  display: grid;
  gap: 14px;
}
.article-steps > li {
  counter-increment: article-step;
  position: relative;
  padding: 18px 20px 18px 68px !important;
  background: #fff;
  border: 1.5px solid #e8ecf1;
  border-radius: 14px;
  margin: 0 !important;
  list-style: none !important;
}
.article-steps > li::before {
  content: counter(article-step, decimal-leading-zero);
  position: absolute;
  left: 16px;
  top: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(201, 169, 97, 0.14);
  color: #b8912a;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.article-steps > li strong {
  display: block;
  font-size: 16px;
  color: #0f172a;
  margin-bottom: 4px;
}
.article-steps > li p {
  margin: 0 !important;
  font-size: 14.5px !important;
  color: #5b6577 !important;
  line-height: 1.55 !important;
}

/* ===== Ключевые тезисы ===== */
.article-content .article-keys {
  display: grid;
  gap: 12px;
  margin: 24px 0 32px;
}
.article-key {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
}
.article-key:last-child { border-bottom: none; }
.article-key__num {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #c9a961;
  min-width: 28px;
  padding-top: 2px;
}
.article-key strong {
  display: block;
  font-size: 15.5px;
  color: #0f172a;
  margin-bottom: 2px;
}
.article-key p {
  margin: 0 !important;
  font-size: 14px !important;
  color: #5b6577 !important;
  line-height: 1.5 !important;
}

/* ===== Определение терминов ===== */
.article-content dl.article-dl,
.article-dl {
  margin: 24px 0 32px;
  padding: 0;
}
.article-dl dt {
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 4px;
  font-size: 15.5px;
}
.article-dl dd {
  margin: 0 0 16px;
  padding: 0 0 0 14px;
  border-left: 2px solid rgba(201, 169, 97, 0.45);
  color: #5b6577;
  font-size: 14.5px;
  line-height: 1.55;
}
.article-dl dd:last-child { margin-bottom: 0; }

/* ===== Плюсы / минусы ===== */
.article-content .article-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}
.article-compare__col {
  border-radius: 14px;
  padding: 20px 22px;
  border: 1.5px solid #e8ecf1;
  background: #fff;
}
.article-compare__col h3 {
  margin: 0 0 12px !important;
  font-size: 15px !important;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.article-compare__col ul {
  margin: 0 !important;
  padding-left: 18px !important;
}
.article-compare__col li {
  margin: 0 0 8px !important;
  font-size: 14.5px;
  line-height: 1.5;
  color: #475569;
}
.article-compare__col--pro {
  background: #f0fdf4;
  border-color: rgba(22, 163, 74, 0.25);
}
.article-compare__col--pro h3 { color: #15803d !important; }
.article-compare__col--con {
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.25);
}
.article-compare__col--con h3 { color: #c2410c !important; }

/* ===== CTA-бокс в тексте ===== */
.article-content .article-cta-box {
  margin: 32px 0;
  padding: 22px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffdf7 0%, #fff8e6 100%);
  border: 1.5px solid rgba(201, 169, 97, 0.45);
  text-align: center;
}
.article-cta-box__text {
  margin: 0 0 14px !important;
  font-size: 16px !important;
  color: #0f172a !important;
  line-height: 1.5 !important;
}
.article-cta-box .btn {
  display: inline-flex;
}

@media (max-width: 700px) {
  .article-content .article-compare {
    grid-template-columns: 1fr;
  }
  .article-steps > li {
    padding-left: 60px !important;
  }
}

.blog-views {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.blog-views__icon {
  flex-shrink: 0;
  opacity: .7;
}
.article-meta .blog-views {
  font-size: 14px;
}
.blog-card__image {
  position: relative;
}
.blog-views--card {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.2);
  pointer-events: none;
}
.blog-views--card .blog-views__icon {
  opacity: 1;
  color: #e4c97e;
}
