/* ============================================================
   ФАЙЛ: manual/manual.css
   АВТОР: Ефимов Андрей Михайлович
   НАЗНАЧЕНИЕ: Стили учебника — инженерный стиль в палитре проекта.
   ПОДКЛЮЧАЕТСЯ: на всех страницах папки /manual/.
   ============================================================ */


/* ------------------------------------------------------------
   СЕКЦИЯ 1: БАЗОВЫЕ СБРОСЫ И КАРКАС
   ------------------------------------------------------------ */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans",
               "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fa;
  color: #1e2a3a;
  line-height: 1.7;
  font-size: 1rem;
  overflow-x: hidden;
  max-width: 100vw;
}

code, pre, .manual-mono {
  font-family: "SF Mono", Monaco, Menlo, Consolas, "Liberation Mono",
               "Courier New", monospace;
}


/* ------------------------------------------------------------
   СЕКЦИЯ 2: ШАПКА УЧЕБНИКА
   ------------------------------------------------------------ */
.manual-header {
  background: #0b1a2b;
  color: #ffffff;
  padding: 18px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  border-bottom: 4px solid #2b6f9c;
  position: sticky;
  top: 0;
  z-index: 100;
}
.manual-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}
.manual-header .manual-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.manual-header-text h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin: 0;
}
.manual-header-text .manual-sub {
  font-size: 0.8rem;
  font-weight: 300;
  color: #8fa8c4;
}
.manual-header-right a {
  color: #33ff33;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #33ff33;
  padding: 6px 16px;
  border-radius: 6px;
  transition: all 0.2s;
}
.manual-header-right a:hover {
  background: #33ff33;
  color: #0b1a2b;
}


/* ------------------------------------------------------------
   СЕКЦИЯ 3: МАКЕТ «САЙДБАР + КОНТЕНТ»
   ------------------------------------------------------------ */
.manual-layout {
  display: flex;
  align-items: flex-start;
  max-width: 1400px;
  margin: 0 auto;
  min-height: calc(100vh - 78px);
}


/* ------------------------------------------------------------
   СЕКЦИЯ 4: БОКОВАЯ НАВИГАЦИЯ
   ------------------------------------------------------------ */
.manual-nav {
  flex: 0 0 280px;
  width: 280px;
  background: #ffffff;
  border-right: 1px solid #dce5ef;
  padding: 30px 20px;
  position: sticky;
  top: 78px;
  height: calc(100vh - 78px);
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}
.manual-nav h2 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8a9bb0;
  margin: 0 0 12px 10px;
}
.manual-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}
.manual-nav li { margin-bottom: 2px; }
.manual-nav a {
  display: block;
  padding: 7px 10px;
  color: #2d3f54;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.manual-nav a:hover {
  background: #f0f6fc;
  color: #1a3a5c;
}
.manual-nav a.active {
  background: #f0f6fc;
  color: #1a3a5c;
  border-left-color: #33ff33;
  font-weight: 500;
}
.manual-nav .manual-nav-part {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #b8c5d6;
  margin: 18px 0 6px 10px;
}


/* ------------------------------------------------------------
   СЕКЦИЯ 5: ОСНОВНОЙ КОНТЕНТ
   ------------------------------------------------------------ */
.manual-content {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  padding: 40px 60px 80px;
  background: #ffffff;
  overflow-wrap: break-word;
  box-sizing: border-box;
}
.manual-content h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #0b1a2b;
  letter-spacing: -0.5px;
  margin: 0 0 8px 0;
  line-height: 1.2;
  word-wrap: break-word;
}
.manual-content h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1a3a5c;
  border-bottom: 2px solid #2b6f9c;
  padding-bottom: 8px;
  margin: 45px 0 20px 0;
  word-wrap: break-word;
}
.manual-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a3a5c;
  margin: 30px 0 12px 0;
  word-wrap: break-word;
}
.manual-content p {
  margin-bottom: 16px;
  font-size: 1rem;
  color: #2d3f54;
  word-wrap: break-word;
}
.manual-content ul, .manual-content ol {
  padding-left: 25px;
  margin-bottom: 18px;
}
.manual-content li {
  margin-bottom: 6px;
  color: #2d3f54;
  word-wrap: break-word;
}
.manual-content a {
  color: #2b6f9c;
  text-decoration: none;
  border-bottom: 1px solid #c5dcec;
  transition: border 0.15s;
}
.manual-content a:hover { border-bottom-color: #2b6f9c; }
.manual-content strong { color: #1a3a5c; font-weight: 600; }


/* ------------------------------------------------------------
   СЕКЦИЯ 6: ХЛЕБНЫЕ КРОШКИ
   ------------------------------------------------------------ */
.manual-breadcrumbs {
  font-size: 0.85rem;
  color: #8a9bb0;
  margin-bottom: 20px;
  word-wrap: break-word;
}
.manual-breadcrumbs a {
  color: #8a9bb0;
  border-bottom: none;
}
.manual-breadcrumbs a:hover { color: #2b6f9c; }
.manual-breadcrumbs .sep { margin: 0 8px; }


/* ------------------------------------------------------------
   СЕКЦИЯ 7: БЛОКИ КОДА
   ВАЖНО: white-space: pre (без wrap) + overflow-x: auto —
          код не переносится, а прокручивается внутри блока.
          Это стандарт для документации: отступы кода не ломаются.
   ------------------------------------------------------------ */
.manual-content pre {
  background: #1a2533;
  border-radius: 8px;
  padding: 18px 22px;
  margin: 20px 0;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e8eef5;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre;
  overflow-x: auto;
  overflow-y: hidden;
}

.manual-content pre code {
  background: none;
  color: inherit;
  font-family: "SF Mono", Monaco, Menlo, Consolas, "Liberation Mono",
               "Courier New", monospace;
  font-size: inherit;
  padding: 0;
  white-space: pre;
}

.manual-content code:not(pre code) {
  background: #f0f3f7;
  color: #1a3a5c;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.88rem;
  word-break: break-word;
}

.manual-code-label {
  display: inline-block;
  background: #2b6f9c;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px 4px 0 0;
  margin: 20px 0 0 0;
}
.manual-code-label + pre {
  border-top-left-radius: 0;
  margin-top: 0;
}


/* ------------------------------------------------------------
   СЕКЦИЯ 8: ИНФОРМАЦИОННЫЕ БЛОКИ
   ------------------------------------------------------------ */
.manual-box {
  padding: 16px 22px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
  border-left: 4px solid #2b6f9c;
  background: #f0f6fc;
  word-wrap: break-word;
}
.manual-box p:last-child { margin-bottom: 0; }
.manual-box-title {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}
.manual-box.note { border-left-color: #2b6f9c; background: #f0f6fc; }
.manual-box.note .manual-box-title { color: #2b6f9c; }
.manual-box.warn { border-left-color: #e89c3a; background: #fdf6ec; }
.manual-box.warn .manual-box-title { color: #b8761e; }
.manual-box.example { border-left-color: #33ff33; background: #f3fff3; }
.manual-box.example .manual-box-title { color: #1a8a1a; }


/* ------------------------------------------------------------
   СЕКЦИЯ 9: ASCII-СХЕМЫ
   ВАЖНО: white-space: pre — рамки и отступы сохраняются.
          Моноширинный шрифт Courier New — точно есть на Windows
          и содержит box-drawing символы (─│┌┐└┘├┤).
   ------------------------------------------------------------ */
.manual-scheme {
  background: #f8faff;
  border: 1px solid #dce5ef;
  border-radius: 8px;
  padding: 20px 24px;
  margin: 20px 0;
  font-family: "Courier New", Consolas, Monaco, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #1a3a5c;
  max-width: 100%;
  box-sizing: border-box;
  white-space: pre;
  overflow-x: auto;
  overflow-y: hidden;
}


/* ------------------------------------------------------------
   СЕКЦИЯ 10: НАВИГАЦИЯ «НАЗАД / ОГЛАВЛЕНИЕ / ВПЕРЁД»
   ------------------------------------------------------------ */
.manual-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #dce5ef;
  gap: 15px;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}
.manual-pager a {
  color: #2b6f9c;
  text-decoration: none;
  border-bottom: none;
  font-size: 0.95rem;
  font-weight: 500;
  word-wrap: break-word;
}
.manual-pager a:hover { border-bottom: 1px solid #2b6f9c; }
.manual-pager .manual-pager-toc { color: #8a9bb0; }


/* ------------------------------------------------------------
   СЕКЦИЯ 11: ПОДВАЛ УЧЕБНИКА
   ------------------------------------------------------------ */
.manual-footer {
  background: #0b1a2b;
  color: #8fa8c4;
  padding: 25px 40px;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.8;
}
.manual-footer a { color: #33ff33; text-decoration: none; }
.manual-footer a:hover { text-decoration: underline; }


/* ------------------------------------------------------------
   СЕКЦИЯ 12: АДАПТИВ
   ------------------------------------------------------------ */
@media (max-width: 968px) {
  .manual-layout { flex-direction: column; }
  .manual-nav {
    flex: none;
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #dce5ef;
    padding: 20px;
  }
  .manual-nav ul { margin-bottom: 12px; }
  .manual-content { padding: 30px 24px 60px; }
  .manual-header { padding: 14px 20px; }
  .manual-header-text h1 { font-size: 1rem; }
  .manual-content h1 { font-size: 1.5rem; }
  .manual-content h2 { font-size: 1.2rem; }
  .manual-content pre { font-size: 0.75rem; }
}