/* ==================== PLUGIN DOCS STYLES (DARK THEME) ==================== */
/* ПРАВИЛО ЧИСЕЛ (🗣 Е.Г. 2026-07-31): все размеры и отступы ЧЁТНЫЕ.
   Проверка: python check_even.py assets/css/docs.css                */
/* Источник правды для CSS страницы документации на onyxofx.com.            */
/* Правим ЗДЕСЬ, потом копируем на сайт целиком — чтобы версии не разъезжались. */
/* Обновлено: 31.07.2026                                                     */

/* ширина как у остального сайта — 🗣 Е.Г. 2026-08-01 */
.plugin-docs {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
  /* Цель кнопки «наверх» (#docs-top). Без этого H1 уезжает под липкое меню — */
  /* держать ТАКИМ ЖЕ, как scroll-margin-top у .plugin-docs-section.          */
  scroll-margin-top: 96px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #e0e0e0;
}

/* Header */
.docs-header {
  text-align: center;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 2px solid #2a2b2e;
}

.docs-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #ffffff;
}

.docs-intro {
  font-size: 1.2rem;
  color: #b0b0b0;
  max-width: 800px;
  margin: 0 auto;
}

/* ==================== TABLE OF CONTENTS ==================== */

.docs-toc {
  background: linear-gradient(180deg, #1c1d21 0%, #17181b 100%);
  border: 2px solid #2a2b2e;
  border-radius: 12px;
  padding: 28px 32px 32px;
  margin-bottom: 64px;
}

.docs-toc > h2 {
  /* должен оставаться крупнее заголовков групп — иначе иерархия переворачивается */
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #09a9ff;
  margin: 0 0 2px 0;
  padding: 0;
  border: none;
}

/* Заголовки групп — главные ориентиры оглавления, а не подпись мелким серым */
.docs-toc-group {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffffff;
  /* сверху воздух ОСТАЁТСЯ (группы разделяем), снизу прижимаем к своим ссылкам */
  margin: 26px 0 8px;
}

.docs-toc-group + .docs-toc-list {
  margin-top: 0;
}

.docs-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0 20px;
}

.docs-toc-list li {
  margin: 0;
}

.docs-toc-list a {
  display: block;
  padding: 4px 14px;
  border-radius: 6px;
  color: #c8c8c8;
  text-decoration: none;
  font-size: 1.08rem;
  /* страница задаёт 1.6 — для навигации это слишком просторно */
  line-height: 1.2;
  border-left: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.docs-toc-list a:hover,
.docs-toc-list a:focus-visible {
  background: #212226;
  color: #ffffff;
  border-left-color: #09a9ff;
}

/* ==================== BACK TO TOP ==================== */
/* Обычная ссылка на якорь #docs-top — без JavaScript и без Elementor.        */
/* Держим СПРАВА внизу: слева на сайте уже висит своя круглая кнопка.         */

.docs-top-link {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  color: #ffffff;
  text-decoration: none;
  background: #1a1b1e;
  border: 2px solid #3a3b3f;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  opacity: 0.7;
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.docs-top-link:hover,
.docs-top-link:focus-visible {
  opacity: 1;
  background: #09a9ff;
  border-color: #09a9ff;
  color: #ffffff;
  transform: translateY(-2px);
}

/* Sections */
.plugin-docs-section {
  margin-bottom: 64px;
  /* Липкое меню сайта ~60px: без этого отступа переход по ссылке из оглавления  */
  /* уводит заголовок раздела ПОД меню. Значение = высота меню + воздух.         */
  /* Если меню изменится по высоте — правится только здесь.                      */
  scroll-margin-top: 96px;
}

.plugin-docs-section > h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 4px solid #09a9ff;
  color: #ffffff;
}

.section-intro {
  font-size: 1rem;
  color: #c0c0c0;
  margin-bottom: 32px;
  padding: 16px 20px;
  background: #1a1b1e;
  border-left: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.param-note-inline {
  font-size: 1rem;
  color: #ffc107;
  background: #2d2416;
  padding: 12px 16px;
  border-left: 4px solid #ffc107;
  border-radius: 4px;
  margin-bottom: 24px;
}

/* Subsections */
.subsection-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin: 32px 0 20px 0;
  color: #f0f0f0;
}

/* Parameter Cards */
.param-card {
  background: #1a1b1e;
  border: 2px solid #2a2b2e;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  transition: all 0.2s ease;
}

.param-card:hover {
  background: #1f2023;
  border-color: #09a9ff;
  box-shadow: 0 4px 12px rgba(9, 169, 255, 0.15);
}

.param-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #2a2b2e;
}

.param-header h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0;
  color: #ffffff;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  background: #09a9ff;
  color: #ffffff;
  border-radius: 12px;
}

.param-note {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  background: #ffc107;
  color: #121314;
  border-radius: 12px;
  margin-left: 8px;
}

/* Definition Lists */
.param-details {
  margin: 0;
}

.param-details dt {
  font-weight: 600;
  color: #a0a0a0;
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 1rem;
}

.param-details dd {
  margin-left: 0;
  margin-bottom: 12px;
  color: #c0c0c0;
  line-height: 1.6;
}

.param-details dd:last-child {
  margin-bottom: 0;
}

.param-details ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.param-details li {
  margin-bottom: 4px;
  color: #c0c0c0;
}

.param-details a {
  color: #09a9ff;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.param-details a:hover {
  color: #4dc3ff;
  border-bottom-color: #09a9ff;
}

/* Quick Reference Table */
.quick-reference {
  background: #1a1b1e;
  padding: 32px;
  border-radius: 8px;
  border: 2px solid #2a2b2e;
}

.quick-reference h2 {
  border-bottom-color: #d264fb;
}


.param-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
  background: #1f2023;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.param-table thead {
  background: #09a9ff;
  color: #ffffff;
}

.param-table th {
  padding: 16px;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
}

.param-table td {
  padding: 16px;
  border-bottom: 2px solid #2a2b2e;
  color: #c0c0c0;
}

.param-table tbody tr:last-child td {
  border-bottom: none;
}

.param-table tbody tr:hover {
  background: #252629;
}

/* Responsive */
@media (max-width: 768px) {
  .plugin-docs {
    padding: 16px;
  }

  .docs-header h1 {
    font-size: 2rem;
  }

  .docs-toc {
    padding: 20px 18px 24px;
  }

  .docs-toc-list {
    grid-template-columns: 1fr;
  }

  .docs-top-link {
    right: 16px;
    bottom: 16px;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }

  .plugin-docs-section > h2 {
    font-size: 1.6rem;
  }

  .param-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .badge {
    margin-top: 8px;
  }

  .param-table {
    font-size: 0.8rem;
  }

  .param-table th,
  .param-table td {
    padding: 12px 8px;
  }
}

/* Smooth scroll for anchor links */
html {
  scroll-behavior: smooth;
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
