/* ============================================================================
   Документация Corvu — страницы landing/docs/{ru,en}/
   ----------------------------------------------------------------------------
   Стоят поверх site.css: шапка, кнопки, подвал и токены (--ink, --text,
   --line, --mist, --indigo-ink, --night …) те же, что у лендинга, поэтому
   своих цветов здесь нет. Здесь только то, чего у лендинга нет: колонка
   чтения, боковое оглавление, таблицы и блоки кода.
   Код — на ночной плоскости (как окна продукта на лендинге), остальное — на
   белой бумаге.
   ========================================================================= */

.docs {
  padding: 104px 0 56px;
}
.docs-grid {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ─────────────────────────────────────────────────────────────── sidebar ── */
.docs-side {
  position: sticky;
  top: 92px;
}
.docs-side-title {
  margin: 0 0 10px;
  color: var(--weak);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.docs-side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 20px;
}
.docs-side nav a {
  padding: 8px 12px;
  border-radius: var(--r-ctl);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 550;
  transition: background 0.2s ease, color 0.2s ease;
}
.docs-side nav a:hover {
  background: var(--mist);
  color: var(--ink);
}
.docs-side nav a[aria-current='page'] {
  background: var(--mist);
  color: var(--ink);
  box-shadow: inset 2px 0 0 var(--indigo-ink);
}
.docs-side-lang {
  font-size: 13px;
  color: var(--weak);
}
.docs-side-lang a {
  color: var(--indigo-ink);
  font-weight: 600;
}
.docs-side-lang a:hover {
  text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────────── article ── */
.docs-main {
  max-width: 900px;
  min-width: 0;
}
.docs-kicker {
  margin: 0 0 12px;
  color: var(--indigo-ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.docs-main h1 {
  font-size: clamp(30px, 4.2vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.docs-lead {
  margin-top: 16px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
}
.docs-main h2 {
  margin: 48px 0 12px;
  padding-top: 8px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  scroll-margin-top: 92px;
}
.docs-main h3 {
  margin: 28px 0 8px;
  font-size: 17px;
  scroll-margin-top: 92px;
}
.docs-main p {
  margin: 12px 0 0;
}
.docs-main ul,
.docs-main ol {
  margin: 12px 0 0;
  padding-left: 22px;
}
.docs-main li {
  margin: 6px 0;
}
.docs-main a:not(.btn) {
  color: var(--indigo-ink);
  text-decoration: underline;
  text-decoration-color: rgb(79 70 229 / 0.3);
  text-underline-offset: 3px;
}
.docs-main a:not(.btn):hover {
  text-decoration-color: currentColor;
}
.docs-main code {
  padding: 1px 6px;
  border-radius: var(--r-chip);
  background: var(--mist);
  color: var(--ink);
  font-size: 0.88em;
}
.docs-main pre {
  margin: 16px 0 0;
  padding: 16px 18px;
  overflow-x: auto;
  border-radius: var(--r-win);
  background: var(--night);
  box-shadow: var(--shadow-window);
  color: var(--steel);
  font-size: 13px;
  line-height: 1.65;
}
.docs-main pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}
.docs-main kbd {
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-chip);
  background: var(--paper);
  font-family: var(--mono);
  font-size: 0.85em;
}

/* ───────────────────────────────────────────────────────────────── steps ── */
.docs-main .docs-steps {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.docs-steps > li {
  position: relative;
  margin: 0;
  padding: 0 0 28px 52px;
  border-left: 1px solid var(--line);
  margin-left: 15px;
  counter-increment: step;
}
.docs-steps > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
.docs-steps > li::before {
  content: counter(step);
  position: absolute;
  left: -16px;
  top: -2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}
.docs-steps h2 {
  margin: 0 0 6px;
  padding: 0;
  font-size: 20px;
}
.docs-steps p {
  margin-top: 8px;
}

/* ─────────────────────────────────────────────────────── tables / callouts ── */
.docs-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
}
.docs-main table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14.5px;
}
.docs-main th,
.docs-main td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.docs-main tr:last-child td {
  border-bottom: 0;
}
.docs-main th {
  background: var(--mist);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.docs-main .docs-routes {
  min-width: 720px;
}
.docs-main .docs-routes td:nth-child(1),
.docs-main .docs-routes td:nth-child(2) code {
  white-space: nowrap;
}
.docs-main .docs-routes td:nth-child(3) {
  min-width: 110px;
}
.docs-main .docs-routes td:nth-child(4) {
  min-width: 240px;
}
.docs-note {
  margin: 20px 0 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--indigo-ink);
  border-radius: var(--r-ctl);
  background: var(--mist);
  font-size: 15px;
}
.docs-note p {
  margin: 0;
}
.docs-note p + p {
  margin-top: 8px;
}
.docs-note b {
  color: var(--ink);
}
.docs-warn {
  border-left-color: var(--c3);
}

/* ───────────────────────────────────────────────────── index: page cards ── */
.docs-main .docs-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.docs-cards li {
  margin: 0;
}
.docs-cards a {
  display: block;
  height: 100%;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--paper);
  text-decoration: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.docs-cards a:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}
.docs-cards b {
  display: block;
  color: var(--ink);
  font-size: 17px;
}
.docs-cards span {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ───────────────────────────────────────────────────── prev/next + cta ── */
.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.docs-pager a {
  font-weight: 600;
}
.docs-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 40px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--mist);
}
.docs-cta p {
  flex: 1 1 260px;
  margin: 0 !important;
  color: var(--ink);
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────── responsive ── */
@media (max-width: 900px) {
  .docs {
    padding-top: 88px;
  }
  .docs-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .docs-side {
    position: static;
  }
  .docs-side nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
  }
  .docs-side nav a {
    border: 1px solid var(--line);
  }
  .docs-main .docs-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .docs-steps > li {
    padding-left: 44px;
  }
  .docs-pager {
    flex-direction: column;
  }
}
@media print {
  .nav,
  .docs-side,
  .docs-cta,
  .docs-pager {
    display: none !important;
  }
  .docs {
    padding-top: 0;
  }
  .docs-grid {
    display: block;
  }
  .docs-main pre {
    box-shadow: none;
    border: 1px solid var(--line-2);
    background: var(--mist);
    color: var(--ink);
  }
}
