/* LifeSEO — статьи (/guides), их список и помощь (/help). Поверх home.css: шапка, подвал,
   кнопки .role, вопросы .faq и цвета — оттуда. Страницы собирает scripts/guides.js. */

/* ── «Хлебные крошки» ──────────────────────────────────── */

.crumbs {
  padding-top: 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--t3);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--l3);
}

.crumbs a:hover {
  color: var(--t1);
}

.crumbs [aria-current="page"] {
  color: var(--t2);
}

/* ── Заголовок статьи ──────────────────────────────────── */

.art {
  padding-bottom: 96px;
}

.art__head {
  max-width: 860px;
  padding: 28px 0 40px;
}

.art__head h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.05;
}

.art__head .lead {
  max-width: 680px;
}

.art__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 22px;
  font-size: 14px;
  color: var(--t3);
}

/* ── Текст и оглавление ────────────────────────────────── */

.art__grid {
  display: grid;
  grid-template-columns: minmax(0, 720px) 264px;
  justify-content: space-between;
  gap: 64px;
  padding-top: 44px;
  border-top: 1px solid var(--line);
}

/* В разметке оглавление стоит раньше текста — на телефоне оно над статьёй */
.art__side {
  grid-column: 2;
  grid-row: 1;
}

.art__body {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.side {
  position: sticky;
  top: calc(var(--hd) + 28px);
  display: grid;
  gap: 28px;
  max-height: calc(100vh - var(--hd) - 44px);
  overflow-y: auto;
  scrollbar-width: none;
}

.toc__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t3);
}

.toc ol {
  display: grid;
  margin-top: 12px;
  border-left: 1px solid var(--line-2);
}

.toc a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  border-left: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--t2);
  transition: color 0.15s, border-color 0.15s;
}

.toc a:hover {
  color: var(--t1);
  border-left-color: var(--accent);
}

.side-cta {
  padding: 20px;
  border-radius: 18px;
  background: radial-gradient(120% 90% at 100% 0%, rgba(220, 191, 134, 0.1), transparent 60%), var(--l1);
  box-shadow: inset 0 0 0 1px rgba(220, 191, 134, 0.2);
}

.side-cta b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.side-cta p {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--t2);
}

.side-cta .role {
  min-height: 56px;
  margin-top: 16px;
}

/* ── Текст статьи ──────────────────────────────────────── */

.prose {
  font-size: 17px;
  line-height: 1.72;
  color: #c9cbd1;
}

.prose > * + * {
  margin-top: 20px;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h2 {
  margin-top: 60px;
  font-size: clamp(25px, 2.6vw, 31px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--t1);
  scroll-margin-top: calc(var(--hd) + 20px);
}

.prose h3 {
  margin-top: 36px;
  font-size: 19px;
  line-height: 1.35;
  color: var(--t1);
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 14px;
}

.prose a:not([class]) {
  color: var(--t1);
  text-decoration: underline;
  text-decoration-color: rgba(220, 191, 134, 0.5);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

.prose a:not([class]):hover {
  text-decoration-color: var(--accent);
}

.prose b,
.prose strong {
  font-weight: 700;
  color: var(--t1);
}

/* Кнопки внутри статьи — со своими цветами (белая кнопка — чёрный текст) */
.prose .role b {
  color: inherit;
}

.prose :not(pre) > code {
  white-space: nowrap;
}

.prose ul,
.prose ol {
  display: grid;
  gap: 10px;
}

.prose ul > li {
  position: relative;
  padding-left: 24px;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.74em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--t3);
}

.prose ol {
  counter-reset: item;
}

.prose ol > li {
  position: relative;
  padding-left: 38px;
  counter-increment: item;
}

.prose ol > li::before {
  content: counter(item);
  position: absolute;
  left: 0;
  top: 0.18em;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--l3);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  color: var(--t2);
}

/* Коротко о главном — в начале статьи */
.sum {
  padding: 22px 24px 24px;
  border-radius: 18px;
  background: var(--l1);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 16px;
  line-height: 1.6;
}

.sum__title {
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t3);
}

/* Совет и предупреждение */
.tip,
.warn {
  padding: 18px 20px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--t1);
}

.tip {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(220, 191, 134, 0.22);
}

.warn {
  background: rgba(239, 143, 126, 0.08);
  box-shadow: inset 0 0 0 1px rgba(239, 143, 126, 0.25);
}

.tip > b:first-child,
.warn > b:first-child {
  display: block;
  margin-bottom: 4px;
}

.tip > b:first-child {
  color: var(--accent);
}

.warn > b:first-child {
  color: #ef8f7e;
}

/* Таблицы — с прокруткой на узком экране */
.table {
  overflow-x: auto;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.table table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.table th,
.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--l1);
  font-size: 13px;
  font-weight: 700;
  color: var(--t2);
}

.table td:first-child {
  font-weight: 700;
  color: var(--t1);
}

.table tr:last-child td {
  border-bottom: 0;
}

/* Расчёт: строки «что — сколько» */
.calc {
  display: grid;
  padding: 6px 22px;
  border-radius: 16px;
  background: var(--l1);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 16px;
}

.calc p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.calc p:last-child {
  border-bottom: 0;
}

.calc b {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.calc .calc__total b {
  color: var(--money);
}

/* Код */
.prose pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: 16px;
  background: #0c0d10;
  box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: #d9d8d3;
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

/* Вопросы внутри статьи — компактнее, чем на страницах ролей */
.prose .faq {
  margin-top: 18px;
}

.prose .faq summary {
  font-size: 16px;
  line-height: 1.4;
}

.prose .faq details p {
  font-size: 16px;
  line-height: 1.65;
}

/* Призыв к действию посреди статьи */
.cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 28px;
  align-items: center;
  margin-block: 36px;
  padding: 24px;
  border-radius: 20px;
  background: radial-gradient(90% 120% at 100% 0%, rgba(220, 191, 134, 0.1), transparent 60%), var(--l1);
  box-shadow: inset 0 0 0 1px rgba(220, 191, 134, 0.22);
  line-height: 1.55;
}

.prose > .cta + * {
  margin-top: 0;
}

.cta__title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--t1);
}

.cta__text p:not(.cta__title) {
  margin-top: 6px;
  font-size: 15px;
  color: var(--t2);
}

.cta__act {
  display: grid;
  gap: 8px;
  min-width: 250px;
}

.cta__act .role {
  min-height: 58px;
}

/* ── Читайте также ─────────────────────────────────────── */

.reads {
  padding: 72px 0 96px;
  border-top: 1px solid var(--line);
}

.reads h2 {
  font-size: clamp(26px, 3vw, 34px);
}

/* ── Список статей ─────────────────────────────────────── */

.hub {
  padding-bottom: 96px;
}

.hub__group {
  padding-top: 44px;
  border-top: 1px solid var(--line);
}

.hub__group + .hub__group {
  margin-top: 48px;
}

.hub__group h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(24px, 2.6vw, 30px);
}

.hub__group h2 .card__ic {
  /* в h2 у span из home.css — display: block (серая вторая строка) */
  display: inline-grid;
  width: 36px;
  height: 36px;
  color: var(--t1);
}

.hub__note {
  max-width: 640px;
  margin-top: 10px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--t2);
}

/* ── Узкие экраны ──────────────────────────────────────── */

@media (max-width: 1080px) {
  .art__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 28px;
  }

  .art__side,
  .art__body {
    grid-column: auto;
    grid-row: auto;
  }

  .side {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .toc {
    margin-bottom: 40px;
    padding: 18px 20px 14px;
    border-radius: 16px;
    background: var(--l1);
    box-shadow: inset 0 0 0 1px var(--line);
  }

  .toc ol {
    border-left: 0;
  }

  .toc a {
    margin-left: 0;
    padding: 7px 0;
    border-left: 0;
  }

  .side-cta {
    display: none;
  }
}

@media (max-width: 600px) {
  .crumbs {
    padding-top: 20px;
  }

  .art__head {
    padding: 20px 0 32px;
  }

  .prose {
    font-size: 16.5px;
    line-height: 1.7;
  }

  .prose h2 {
    margin-top: 48px;
  }

  .sum,
  .cta {
    padding: 20px;
  }

  .cta {
    grid-template-columns: minmax(0, 1fr);
  }

  .cta__act {
    min-width: 0;
  }

  .calc {
    padding: 4px 18px;
    font-size: 15px;
  }

  .table table {
    font-size: 14px;
  }

  .reads {
    padding: 56px 0 72px;
  }
}
