/* Справочник */
@keyframes handbook-fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-handbook main {
  max-width: 1000px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

.handbook-hero {
  text-align: center;
  padding: var(--spacing-xl) var(--spacing-md);
  margin-bottom: var(--spacing-lg);
  animation: handbook-fade-in 0.45s ease-out;
}

.handbook-hero-title {
  margin: 0 0 var(--spacing-md);
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--color-primary-light, #2563eb);
  font-weight: 700;
}

.handbook-hero-lead {
  margin: 0;
  font-size: 1.1rem;
  color: var(--color-text-muted, #555);
  line-height: 1.6;
}

.handbook-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--spacing-xl);
  align-items: start;
}

.handbook-nav {
  position: sticky;
  top: 1rem;
}

.handbook-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.handbook-nav-list li {
  margin-bottom: 0.35rem;
}

.handbook-nav-list a {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  display: block;
  padding: 0.35rem 0;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.handbook-nav-list a:hover {
  color: var(--color-primary-light);
  background: var(--color-surface-alt);
}

.handbook-articles {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.handbook-article {
  scroll-margin-top: 1rem;
  animation: handbook-fade-in 0.4s ease-out backwards;
}
.handbook-article:nth-child(1) { animation-delay: 0.05s; }
.handbook-article:nth-child(2) { animation-delay: 0.1s; }
.handbook-article:nth-child(3) { animation-delay: 0.15s; }
.handbook-article:nth-child(4) { animation-delay: 0.2s; }
.handbook-article:nth-child(5) { animation-delay: 0.25s; }
.handbook-article:nth-child(6) { animation-delay: 0.3s; }
.handbook-article:nth-child(7) { animation-delay: 0.35s; }
.handbook-article:nth-child(8) { animation-delay: 0.4s; }
.handbook-article:nth-child(9) { animation-delay: 0.45s; }
.handbook-article:nth-child(10) { animation-delay: 0.5s; }

.handbook-article .section-title {
  margin-top: 0;
}

.handbook-article p,
.handbook-article ul,
.handbook-article ol {
  margin: 0 0 0.75rem;
  color: var(--color-text);
  line-height: 1.6;
}

.handbook-article ul,
.handbook-article ol {
  padding-left: 1.25rem;
}

.handbook-article li {
  margin-bottom: 0.35rem;
}

.handbook-article code {
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  background: var(--color-surface-alt);
  border-radius: 4px;
}

.handbook-article-highlight {
  animation: handbook-highlight 2s ease-out;
}

@keyframes handbook-highlight {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@media (max-width: 768px) {
  .handbook-layout {
    grid-template-columns: 1fr;
  }
  .handbook-nav {
    position: static;
  }
}
