/* Chapter editor — single chapter view inside the course editor's main area. */

.chapter-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 400px;
}

.chapter-editor__topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-bg-elevated, #f9fafb);
}

.chapter-editor__title-input {
  flex: 1;
  font-weight: 600;
}

.chapter-editor__title-input input {
  font-weight: 600;
  font-size: 1rem;
}

.chapter-editor__mode-toggle {
  display: flex;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  overflow: hidden;
}

.chapter-editor__body {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.chapter-editor__list {
  max-width: 920px;
}

.chapter-editor__node-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chapter-editor__node-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  cursor: grab;
  transition: box-shadow 0.15s ease;
}

.chapter-editor__node-row:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.chapter-editor__node-handle {
  color: var(--color-text-muted, #9ca3af);
  letter-spacing: -2px;
  cursor: grab;
}

.chapter-editor__node-pos {
  font-variant-numeric: tabular-nums;
  width: 28px;
  color: var(--color-text-muted, #6b7280);
  font-size: 0.85rem;
}

.chapter-editor__node-title {
  flex: 1;
  font-weight: 500;
}

@media (max-width: 768px) {
  .chapter-editor__topbar { flex-wrap: wrap; }
  .chapter-editor__title-input { width: 100%; order: -1; }
}
