/* ─────────────────────────────────────────────
   doc.css — Document pages (Политика, Условия…)
   Подключается поверх style.css, токены берёт из :root
   ───────────────────────────────────────────── */

/* ─── Hero ─── */
.doc-hero {
  padding: 72px 0 52px;
  border-bottom: 1px solid var(--hairline);
}

.doc-hero h1 {
  font-size: clamp(26px, 3.5vw, 46px);
  letter-spacing: -1px;
  line-height: 1.05;
  min-height: auto;
  /* Убираем градиентную анимацию из style.css — для текста читабельнее */
  background: none;
  -webkit-text-fill-color: var(--ink);
  color: var(--ink);
  animation: none;
  margin-top: 14px;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  margin-top: 18px;
}

.doc-meta-item {
  display: inline-flex;
  align-items: center;
  color: var(--mute);
  font-size: 12px;
  font-family: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.04em;
}

.doc-meta-item + .doc-meta-item::before {
  content: "·";
  margin: 0 12px;
  color: var(--hairline);
}

/* ─── Shell wrapper ─── */
.doc-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

/* ─── Two-column layout ─── */
.doc-layout {
  display: grid;
  grid-template-columns: 224px 1fr;
  gap: 72px;
  align-items: start;
  padding: 56px 0 120px;
}

/* ─── Sidebar ─── */
.doc-sidebar {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.doc-toc-label {
  display: block;
  margin-bottom: 14px;
  font-family: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mute);
  padding-left: 14px;
}

.doc-toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.doc-toc a {
  display: block;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--mute);
  border-left: 2px solid transparent;
  transition: color 180ms var(--ease), background 180ms var(--ease), border-color 180ms var(--ease);
  line-height: 1.4;
}

.doc-toc a:hover {
  color: var(--body);
  background: rgba(255, 255, 255, 0.03);
}

.doc-toc a.is-active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border-left-color: var(--accent);
}

.doc-sidebar-footer {
  margin-top: 28px;
  padding-top: 20px;
  padding-left: 14px;
  border-top: 1px solid var(--hairline);
}

.doc-sidebar-footer p {
  margin: 0;
  font-size: 11px;
  font-family: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  color: var(--mute);
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.doc-sidebar-footer a {
  color: var(--accent-dark);
  transition: color 180ms var(--ease);
}

.doc-sidebar-footer a:hover {
  color: var(--ink);
}

/* ─── Content ─── */
.doc-content {
  min-width: 0;
  max-width: 720px;
}

/* ─── Sections ─── */
.doc-section {
  scroll-margin-top: 100px;
}

.doc-section + .doc-section {
  margin-top: 52px;
  padding-top: 52px;
  border-top: 1px solid var(--hairline);
}

/* ─── Headings ─── */
.doc-content h2 {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 18px;
}

.doc-content h3 {
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.01em;
  margin: 28px 0 10px;
}

/* ─── Body text ─── */
.doc-content p {
  color: var(--body);
  font-size: 15px;
  line-height: 1.72;
  letter-spacing: -0.01em;
  margin: 14px 0 0;
}

.doc-content p:first-child {
  margin-top: 0;
}

/* ─── Lists ─── */
.doc-content ul,
.doc-content ol {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/*
  Используем position:absolute для ::before — иначе display:grid/flex
  разбивает inline-детей (текст после <strong>) на отдельные ячейки
  и слова рендерятся столбиком по одному.
*/
.doc-content ul li {
  position: relative;
  padding-left: 22px;
  color: var(--body);
  font-size: 15px;
  line-height: 1.65;
}

.doc-content ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--mute);
  font-family: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.doc-content ol {
  counter-reset: doc-counter;
}

.doc-content ol li {
  position: relative;
  padding-left: 28px;
  color: var(--body);
  font-size: 15px;
  line-height: 1.65;
  counter-increment: doc-counter;
}

.doc-content ol li::before {
  content: counter(doc-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--mute);
  font-family: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  padding-top: 1px;
}

/* ─── Inline formatting ─── */
.doc-content strong {
  color: var(--ink);
  font-weight: 400;
}

.doc-content a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(136, 160, 255, 0.4);
  transition: color 180ms var(--ease), text-decoration-color 180ms var(--ease);
}

.doc-content a:hover {
  color: var(--ink);
  text-decoration-color: rgba(255, 255, 255, 0.5);
}

.doc-content code {
  font-family: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--canvas-soft);
  border: 1px solid var(--hairline);
  color: var(--accent-dark);
}

/* ─── Callout box ─── */
.doc-callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--canvas-soft);
  margin-top: 20px;
}

.doc-callout-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--accent-dark);
  margin-top: 1px;
}

.doc-callout p {
  margin: 0;
  font-size: 14px;
  color: var(--body);
  line-height: 1.6;
}

/* ─── Info grid (контакты, реквизиты) ─── */
.doc-info-grid {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  background: var(--canvas-card);
}

.doc-info-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: baseline;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--hairline);
  transition: background 180ms var(--ease);
}

.doc-info-row:last-child {
  border-bottom: none;
}

.doc-info-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.doc-info-key {
  font-size: 11px;
  font-family: "Geist Mono", "SFMono-Regular", Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mute);
  padding-top: 1px;
  white-space: nowrap;
}

.doc-info-val {
  font-size: 14px;
  color: var(--body);
  line-height: 1.5;
}

.doc-info-val a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(136, 160, 255, 0.35);
  transition: color 180ms var(--ease), text-decoration-color 180ms var(--ease);
}

.doc-info-val a:hover {
  color: var(--ink);
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

@media (max-width: 580px) {
  .doc-info-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 13px 16px;
  }
}

/* ─── Responsive: 960px ─── */
@media (max-width: 960px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 32px;
  }

  .doc-sidebar {
    position: static;
    margin-bottom: 40px;
  }

  .doc-toc-label {
    display: none;
  }

  .doc-toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .doc-toc a {
    border-left: none;
    border: 1px solid var(--hairline);
    border-radius: 9999px;
    font-size: 12px;
    padding: 5px 12px;
    background: var(--canvas-card);
  }

  .doc-toc a.is-active {
    background: rgba(59, 91, 219, 0.12);
    border-color: rgba(59, 91, 219, 0.35);
    color: var(--accent-dark);
  }

  .doc-sidebar-footer {
    display: none;
  }
}

/* ─── Responsive: 720px ─── */
@media (max-width: 720px) {
  .doc-hero {
    padding: 48px 0 36px;
  }

  .doc-hero h1 {
    font-size: 26px;
    letter-spacing: -0.5px;
  }

  .doc-layout {
    padding-bottom: 72px;
  }

  .doc-section + .doc-section {
    margin-top: 40px;
    padding-top: 40px;
  }

  .doc-content p,
  .doc-content ul li,
  .doc-content ol li {
    font-size: 14px;
  }
}

/* ─── Language visibility ─── */
.ev { display: none; }
html[data-lang="en"] .ev { display: revert; }
html[data-lang="en"] .rv { display: none; }
