/* ============================================================
   ABISSO — правовые документы (публичная оферта, политики)
   Экран: тёмная тема сайта. Печать: чистый A4-документ в PDF.
   ============================================================ */

.doc {
  position: relative;
  z-index: 1;
  padding-top: var(--space-7, 72px);
  padding-bottom: var(--space-8, 104px);
}

.doc__container {
  max-width: 780px;
}

/* ---------- Хлебные крошки ---------- */
.doc__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  margin-bottom: var(--space-5, 36px);
}
.doc__crumbs a {
  color: var(--text-low);
  text-decoration: none;
  transition: color 150ms ease-out;
}
.doc__crumbs a:hover { color: var(--acc-bright); }
.doc__crumbs span[aria-current] { color: var(--text-mid); }
.doc__crumbs .doc__sep { opacity: .5; }

/* ---------- Шапка документа ---------- */
.doc__kicker {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--acc);
  margin-bottom: 12px;
}
.doc__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.75rem, 5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -.01em;
  background: linear-gradient(92deg, #8FF0FF 0%, #3FE0FF 45%, #3B6CFF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 18px;
}
.doc__meta {
  font-size: var(--fs-sm);
  color: var(--text-mid);
  line-height: 1.7;
  padding-bottom: var(--space-5, 36px);
  border-bottom: 1px solid var(--line-soft);
}
.doc__meta a { color: var(--acc); text-decoration: none; }
.doc__meta a:hover { text-decoration: underline; }

.doc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: var(--space-5, 36px) 0;
}
.doc__actions .btn { font-size: var(--fs-sm); padding: 12px 22px; }
.doc__actions .btn--ghost {
  color: var(--text-hi);
  background: var(--acc-tint);
  border: 1px solid var(--line-strong);
  text-decoration: none;
}

/* ---------- Содержание ---------- */
.doc__toc {
  background: var(--bg-surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg, 18px);
  padding: var(--space-5, 32px) var(--space-5, 34px);
  margin-bottom: var(--space-7, 64px);
}
.doc__toc-title {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-low);
  margin-bottom: 16px;
}
.doc__toc ol {
  list-style: none;
  display: grid;
  gap: 10px;
}
.doc__toc a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-mid);
  text-decoration: none;
  transition: color 150ms ease-out;
}
.doc__toc a:hover { color: var(--acc-bright); }

/* ---------- Текст документа ---------- */
.doc__body {
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-mid);
}
.doc__section {
  scroll-margin-top: 96px;
  margin-bottom: var(--space-6, 48px);
}
.doc__h2 {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-hi);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.doc__body p { margin-bottom: 14px; }
.doc__body p:last-child { margin-bottom: 0; }
.doc__body strong { color: var(--text-hi); font-weight: 700; }
.doc__body a {
  color: var(--acc);
  text-decoration: none;
  border-bottom: 1px solid var(--acc-tint);
}
.doc__body a:hover { color: var(--acc-bright); border-bottom-color: var(--acc); }

.doc__list {
  list-style: none;
  margin: 4px 0 16px;
  display: grid;
  gap: 10px;
}
.doc__list > li {
  position: relative;
  padding-left: 26px;
}
.doc__list > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .68em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 12px var(--acc-glow);
}
.doc__list .doc__list { margin-top: 10px; }
.doc__list .doc__list > li::before {
  width: 6px;
  height: 6px;
  background: var(--violet, #7B8CFF);
  box-shadow: none;
}

/* ---------- Выходные данные ---------- */
.doc__colophon {
  margin-top: var(--space-7, 64px);
  padding-top: var(--space-5, 32px);
  border-top: 1px solid var(--line-soft);
  font-family: "Manrope", sans-serif;
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--text-faint);
}
.doc__colophon a { color: var(--text-low); }

/* Блок, который виден только в PDF */
.doc__print-foot { display: none; }

@media (max-width: 640px) {
  .doc { padding-top: var(--space-6, 40px); }
  .doc__body { font-size: 16px; }
  .doc__toc { padding: 24px 22px; }
}

/* ============================================================
   Печать → PDF (headless Chromium)
   ============================================================ */
@page {
  size: A4;
  margin: 18mm 16mm 20mm 16mm;
}

@media print {
  html, body {
    background: #fff !important;
    color: #14161a !important;
  }
  .abyss,
  .header,
  .mobile-panel,
  .search-overlay,
  .footer,
  .toast-stack,
  .skip-link,
  .doc__actions,
  .doc__crumbs {
    display: none !important;
  }
  .doc { padding: 0 !important; }
  .doc__container { max-width: none !important; }

  .doc__kicker { color: #0a6f92; }
  .doc__title {
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: #0b2a4a !important;
    font-size: 22pt !important;
    margin-bottom: 6mm;
  }
  .doc__meta,
  .doc__colophon {
    color: #3c4250 !important;
    border-color: #d5d9e0 !important;
  }
  .doc__toc {
    background: #f5f7fa !important;
    border-color: #d5d9e0 !important;
    padding: 5mm 6mm !important;
    margin-bottom: 8mm !important;
    break-inside: avoid;
  }
  .doc__toc-title,
  .doc__toc a { color: #0b2a4a !important; }

  .doc__body {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 10.5pt;
    line-height: 1.55;
    color: #14161a !important;
  }
  .doc__section { margin-bottom: 6mm; }
  .doc__h2 {
    color: #0b2a4a !important;
    border-color: #c9ced8 !important;
    font-size: 13pt !important;
    break-after: avoid;
    break-inside: avoid;
  }
  .doc__body strong { color: #000 !important; }
  .doc__body a {
    color: #0b2a4a !important;
    border-bottom: none !important;
    text-decoration: none !important;
  }
  .doc__list > li { break-inside: avoid; }
  .doc__list > li::before {
    background: #0a6f92 !important;
    box-shadow: none !important;
  }
  .doc__colophon { break-inside: avoid; }

  /* Колонтитул PDF: название документа и номер страницы */
  .doc__print-foot {
    display: block !important;
    margin-top: 8mm;
    padding-top: 3mm;
    border-top: .4pt solid #c9ced8;
    font-family: "Manrope", sans-serif;
    font-size: 8.5pt;
    color: #6b7280 !important;
    text-align: center;
  }
  p { orphans: 2; widows: 2; }
}
