/* Статьи tunelka.ru/guides/ — поверх /style.css лендинга (токены, кнопки, шапка, подвал).
   Страницы собирает docs/guides/build-guides.py, руками HTML не править. */

.nav-links a[aria-current="page"] { color: var(--text-strong); font-weight: 600; }

/* ---------- шапка статьи ---------- */
.g-hero { position: relative; padding: 44px 0 8px; }
.g-hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 420px; z-index: -1;
  background: radial-gradient(560px 300px at 6% 0%, rgba(79, 209, 197, .18), transparent 70%),
              radial-gradient(620px 340px at 96% 10%, rgba(79, 209, 197, .10), transparent 70%);
}
.g-col { max-width: 780px; margin: 0 auto; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand-strong); }
.crumbs span[aria-hidden] { color: var(--faint); }
.g-hero h1 { font-size: 44px; line-height: 1.1; letter-spacing: -.03em; margin-bottom: 18px; }
.g-lead { font-size: 18.5px; line-height: 1.6; color: var(--text); }
.g-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; font-size: 13.5px; color: var(--muted); }
.g-meta span { display: inline-flex; align-items: center; gap: 6px; }
.g-meta .ico { width: 15px; height: 15px; color: var(--brand-strong); }

/* ---------- краткий ответ ---------- */
.answer {
  margin: 30px 0 8px; padding: 22px 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid #d3eeea; box-shadow: var(--shadow-1);
}
.answer-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--brand-ink); margin-bottom: 8px; }
.answer-title .ico { width: 16px; height: 16px; }
.answer p { font-size: 16.5px; }

/* ---------- оглавление ---------- */
.toc { margin: 22px 0 0; padding: 18px 22px; border-radius: var(--radius); background: var(--fill); }
.toc-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; font-size: 15px; }
.toc li { padding: 3px 0; break-inside: avoid; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--brand-strong); text-decoration: underline; }

/* ---------- текст статьи ---------- */
.prose { padding: 8px 0 24px; font-size: 17px; line-height: 1.7; }
.prose h2 { font-size: 29px; line-height: 1.2; margin: 52px 0 16px; scroll-margin-top: 84px; }
.prose h3 { font-size: 20px; line-height: 1.3; margin: 32px 0 10px; scroll-margin-top: 84px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 24px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--brand-strong); }
.prose strong { color: var(--text-strong); }
.prose code { background: var(--fill); padding: 2px 6px; border-radius: 6px; font-size: .86em; color: var(--brand-ink); word-break: break-word; }
.prose a { text-underline-offset: 3px; }

/* шаги */
.steps-g { list-style: none; padding: 0 !important; margin: 8px 0 24px !important; counter-reset: st; }
.steps-g > li { position: relative; margin: 0 !important; padding: 0 0 22px 56px; counter-increment: st; }
.steps-g > li::before {
  content: counter(st); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink);
  font-weight: 700; font-size: 16px; border: 1px solid #c9ece7;
}
.steps-g > li:not(:last-child)::after {
  content: ""; position: absolute; left: 18px; top: 44px; bottom: 6px; width: 2px; background: var(--line-strong);
}
.steps-g b.st { display: block; color: var(--text-strong); font-size: 17.5px; margin-bottom: 2px; padding-top: 6px; }

/* врезки */
.note { display: flex; gap: 14px; margin: 22px 0; padding: 18px 20px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); font-size: 16px; }
.note > .ico { width: 22px; height: 22px; margin-top: 2px; color: var(--brand-strong); }
.note p:last-child { margin-bottom: 0; }
.note-warn { background: #fff8eb; border-color: #f3dfb4; }
.note-warn > .ico { color: #b7791f; }

/* схема маршрута */
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 10px;
  margin: 26px 0; padding: 22px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.flow-node { text-align: center; }
.flow-node .ico { width: 30px; height: 30px; color: var(--brand-strong); margin: 0 auto 6px; display: block; }
.flow-node b { display: block; color: var(--text-strong); font-size: 15px; }
.flow-node small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.flow-pipe { width: 56px; height: 2px; background: repeating-linear-gradient(90deg, var(--brand) 0 8px, transparent 8px 14px); }

/* таблицы */
.tbl { overflow-x: auto; margin: 18px 0 24px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-1); -webkit-overflow-scrolling: touch; }
.tbl table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; line-height: 1.5; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl thead th { background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--muted);
  letter-spacing: .02em; white-space: nowrap; }
.tbl tbody th { font-weight: 600; color: var(--text-strong); white-space: nowrap; }
.tbl .hl { background: var(--brand-soft); }
.tbl thead .hl { color: var(--brand-ink); }
.tbl-note { margin-top: -14px !important; font-size: 13.5px !important; color: var(--muted); }
.yes { color: var(--ok); font-weight: 600; }
.no { color: #b4413c; font-weight: 600; }

/* код */
.term { margin: 16px 0 22px; padding: 16px 18px; border-radius: 14px; background: var(--ink); color: #d7e6e9;
  font-family: var(--mono); font-size: 14px; line-height: 1.65; overflow-x: auto; white-space: pre; }
.term .c { color: #6f8a91; }
.term .p { color: var(--brand); }

/* плюсы / минусы */
.pc { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 24px; }
.pc > div { padding: 18px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.pc h4 { margin: 0 0 8px; font-size: 15px; color: var(--text-strong); }
.pc ul { margin: 0; padding-left: 20px; font-size: 15.5px; }

/* FAQ */
.g-faq { margin: 8px 0 24px; border-top: 1px solid var(--line-strong); }
.g-faq details { border-bottom: 1px solid var(--line-strong); }
.g-faq summary { display: flex; gap: 16px; padding: 18px 0; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 17px; color: var(--text-strong); }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary::after { content: "+"; margin-left: auto; color: var(--faint); font-size: 22px; font-weight: 400; line-height: 1; transition: transform .2s; }
.g-faq details[open] summary::after { transform: rotate(45deg); color: var(--brand-strong); }
.g-faq .a { padding: 0 32px 18px 0; color: var(--text); font-size: 16px; }
.g-faq .a p:last-child { margin-bottom: 0; }

/* CTA */
.g-cta { margin: 36px 0 8px; padding: 34px 32px; border-radius: 22px; background: var(--ink); color: #9fb6bb;
  position: relative; overflow: hidden; }
.g-cta::before { content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 220px at 100% 0%, rgba(79, 209, 197, .22), transparent 70%); }
.g-cta > * { position: relative; }
.g-cta h2 { color: #fff; font-size: 26px; margin: 0 0 8px !important; }
.g-cta p { color: #9fb6bb; margin: 0 0 20px !important; font-size: 16px; }
.g-cta .row { display: flex; flex-wrap: wrap; gap: 10px; }
.g-cta .btn-ghost { background: transparent; color: #e7edef; border-color: #2b383f; box-shadow: none; }
.g-cta .btn-ghost:hover { border-color: var(--brand); }

/* связанные статьи и каталог */
.related { padding: 40px 0 72px; }
.related h2 { font-size: 22px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: var(--brand); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.card .tag { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-strong); }
.card b { color: var(--text-strong); font-size: 17px; line-height: 1.35; }
.card span.d { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.hub-hero { padding-bottom: 28px; }
.hub-group { margin: 26px 0 8px; }
.hub-group h2 { font-size: 15px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.hub-group .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.g-updated { font-size: 13.5px; color: var(--muted); margin-top: 18px; }

/* ---------- адаптив ---------- */
@media (max-width: 960px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .g-hero { padding-top: 28px; }
  .g-hero h1 { font-size: 31px; }
  .g-lead { font-size: 17px; }
  .prose { font-size: 16.5px; }
  .prose h2 { font-size: 24px; margin-top: 40px; }
  .prose h3 { font-size: 18.5px; }
  .toc ol { columns: 1; }
  .answer { padding: 18px; }
  .flow { grid-template-columns: 1fr; justify-items: center; padding: 18px; gap: 6px; }
  .flow-pipe { width: 2px; height: 22px; background: repeating-linear-gradient(180deg, var(--brand) 0 6px, transparent 6px 11px); }
  .pc, .cards, .hub-group .cards { grid-template-columns: minmax(0, 1fr); }
  .g-cta { padding: 26px 20px; border-radius: 18px; }
  .g-cta h2 { font-size: 22px; }
  .g-cta .btn { width: 100%; }
  .steps-g > li { padding-left: 50px; }
  .term { font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; padding: 14px; }
  /* таблицы → карточки: строка = карточка, у значения подпись столбца */
  .tbl { overflow: visible; background: transparent; border: 0; box-shadow: none; border-radius: 0; }
  .tbl table, .tbl tbody, .tbl tr, .tbl th, .tbl td { display: block; width: 100%; min-width: 0; }
  .tbl thead { display: none; }
  .tbl tr { margin: 0 0 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface);
    border: 1px solid var(--line); box-shadow: var(--shadow-1); }
  .tbl tr.hl { background: var(--brand-soft); border-color: #c9ece7; }
  .tbl th, .tbl td, .tbl tbody th { padding: 4px 0; border: 0; white-space: normal; }
  .tbl td.hl { background: transparent; }
  .tbl tbody tr > :first-child { font-size: 16px; font-weight: 650; color: var(--text-strong); padding-bottom: 6px; }
  .tbl tbody tr > [data-label]:first-child::before { display: none !important; }
  .tbl td[data-label]:not([data-label=""])::before, .tbl th[data-label]:not([data-label=""])::before {
    content: attr(data-label); font-size: 12px; font-weight: 700; letter-spacing: .03em;
    text-transform: uppercase; color: var(--muted); }
  .tbl tbody tr > [data-label]:not([data-label=""]):not(:first-child) {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 12px; align-items: baseline;
    border-top: 1px dashed var(--line); padding: 6px 0; }
  .tbl td.hl[data-label]::before { color: var(--brand-ink); }
  .tbl tbody tr > td.hl[data-label]:not([data-label=""]):not(:first-child) {
    margin: 4px -8px 0; padding: 6px 8px; border-radius: 10px; border-top: 0; background: var(--brand-soft); width: calc(100% + 16px); }
  .tbl-note { margin-top: 0 !important; }
  .g-faq .a { padding-right: 0; }
  /* подвал на телефоне: логотип, ссылки в две колонки, копирайт — столбиком
     (у главной лендинга подвал пока узкой колонкой, её не трогаем) */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; width: 100%; }
}
