/* WP eLDeR Quiz — документация. Стиль «Trust & Authority». */
:root {
  --teal: #0f766e;
  --teal-dark: #134e4a;
  --teal-bg: #f0fdfa;
  --accent: #0369a1;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card: #ffffff;
  --bg: #f8fafc;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 118, 110, 0.08), 0 4px 14px rgba(15, 118, 110, 0.06);
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Шапка ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  padding: 0 20px;
  background: var(--teal-dark);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--teal); color: #fff; font-weight: 800;
}
.brand__sub { font-weight: 400; opacity: 0.75; font-size: 14px; }
.topbar__version { margin-left: auto; font-size: 13px; opacity: 0.75; }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 22px; cursor: pointer; }

/* ---------- Каркас ---------- */
.layout { display: flex; max-width: 1400px; margin: 0 auto; }

.sidebar {
  flex: 0 0 290px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 18px 10px 40px 16px;
  border-right: 1px solid var(--border);
  background: #fff;
}
.nav-filter {
  width: 100%;
  margin-bottom: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}
.nav-filter:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.nav-section { margin-bottom: 18px; }
.nav-section__title {
  margin: 0 0 6px 10px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav a {
  display: block;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--text);
  text-decoration: none;
  font-size: 14.5px;
}
.nav a:hover { background: var(--teal-bg); color: var(--teal-dark); }
.nav a.active { background: var(--teal); color: #fff; font-weight: 600; }

/* ---------- Контент ---------- */
.content { flex: 1; min-width: 0; padding: 28px 42px 60px; }

.crumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); font-size: 13.5px; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs b { color: var(--text); font-weight: 600; }

/* Статья + оглавление — две колонки; оглавление липнет при прокрутке.
 * Флоат не годится: фоновые блоки (плашки, карточки) заезжали под него. */
.content-body {
  display: flex;
  align-items: flex-start;
  gap: 34px;
}

.page-toc {
  flex: 0 0 240px;
  position: sticky;
  top: 76px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 13.5px;
}
.page-toc__title { font-weight: 700; color: var(--teal-dark); margin-bottom: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.page-toc a { display: block; padding: 3px 0; color: var(--text); text-decoration: none; }
.page-toc a:hover { color: var(--teal); }

.article { flex: 1 1 auto; min-width: 0; max-width: 860px; }
.article h1 { margin: 0 0 10px; font-size: 32px; line-height: 1.25; color: var(--teal-dark); }
.article .lead { font-size: 18px; color: var(--muted); margin: 0 0 26px; }
.article h2 {
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--teal-bg);
  font-size: 24px;
  color: var(--teal-dark);
}
.article h3 { margin: 28px 0 10px; font-size: 18.5px; color: var(--text); }
.article a { color: var(--accent); }
.article img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.article figure { margin: 20px 0; }
.article figcaption { margin-top: 8px; color: var(--muted); font-size: 13.5px; text-align: center; }

code {
  padding: 2px 6px;
  background: #eef2f7;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 0.88em;
  color: #0f4c81;
  overflow-wrap: anywhere;
}
pre {
  padding: 14px 18px;
  overflow-x: auto;
  background: #0d2b29;
  color: #d9f2ef;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.55;
}
pre code { background: none; color: inherit; padding: 0; }

/* Таблицы параметров */
table { width: 100%; border-collapse: collapse; margin: 16px 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 14.5px; }
th, td { padding: 9px 13px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--teal-bg); color: var(--teal-dark); font-size: 13px; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* Плашки */
.callout {
  display: block;
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 14.5px;
}
.callout--info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.callout--warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.callout--good { background: var(--teal-bg); border-color: #99f6e4; color: var(--teal-dark); }
.callout b:first-child { display: block; margin-bottom: 2px; }

/* Карточки на главной */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 22px 0; }
.card {
  display: block;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 18px rgba(15,118,110,0.16); }
.card b { display: block; color: var(--teal-dark); margin-bottom: 5px; font-size: 15.5px; }
.card span { font-size: 13.5px; color: var(--muted); }

/* Бейджи версий */
.v { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--teal-bg); color: var(--teal-dark); font-size: 12px; font-weight: 700; vertical-align: middle; }

/* Пейджер */
.pager { display: flex; justify-content: space-between; gap: 16px; max-width: 860px; margin-top: 46px; }
.pager a {
  display: block;
  min-width: 200px;
  padding: 12px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
}
.pager a span { display: block; font-size: 12.5px; color: var(--muted); }
.pager a b { color: var(--teal-dark); }
.pager__next { text-align: right; margin-left: auto; }
.pager a:hover b { color: var(--teal); }

.footer { max-width: 860px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* Списки шагов */
ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps > li {
  position: relative;
  margin: 0 0 14px;
  padding: 14px 16px 14px 56px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
ol.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

kbd {
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #fff;
  font-family: var(--mono);
  font-size: 0.85em;
}

/* ---------- Мобильная версия ---------- */
/* Узкие экраны: оглавление — обычным блоком над статьёй. */
@media (max-width: 1280px) {
  .content-body { display: block; }
  .page-toc { position: static; margin: 0 0 18px; }
}

@media (max-width: 960px) {
  .burger { display: block; }
  .sidebar {
    position: fixed;
    left: 0; top: 56px;
    width: 290px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 40;
    box-shadow: 4px 0 18px rgba(0,0,0,0.12);
  }
  body.nav-open .sidebar { transform: none; }
  .content { padding: 20px 18px 50px; }
  .article h1 { font-size: 26px; }
}
