/* Chapter destinations are navigation, not paragraphs of the translated work. */
.chapter-navigation {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: .5rem 0 1.5rem; padding: 8px 0; border-block: 1px solid var(--line);
}
.chapter-navigation:last-child { margin: 2rem 0 .5rem; }

/* Native links retain their URL behaviour while matching the reader's action buttons. */
.chapter-navigation a, [data-reader-resume] {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 0 13px; border: 1px solid var(--line); border-radius: 6px;
  background: transparent; color: var(--ink); font: 600 13px var(--ui-font); text-decoration: none;
}
:is(.chapter-navigation a, [data-reader-resume]):hover {
  background: color-mix(in srgb, var(--line) 28%, transparent);
}
:is(.chapter-navigation a, [data-reader-resume], .chapter-contents a, [data-reader-marks] a):focus-visible {
  outline: 2px solid var(--brand); outline-offset: 3px;
}

/* Reuse the shared contents rows outside the dialog, without a nested scroll pane. */
.chapter-contents.reader-toc-list, [data-reader-marks].reader-toc-list {
  padding: 0; overflow: visible; color: var(--ink); font: 400 16px/1.6 var(--ui-font);
}
.chapter-contents.reader-toc-list ul { padding: 0; }
.chapter-contents.reader-toc-list li { margin: 0; }
.chapter-contents h2 { margin: 0 0 16px; font-size: 18px; }
.chapter-contents h3 { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.chapter-contents section + section { margin-top: 24px; }
.chapter-contents.reader-toc-list a { color: var(--ink); text-decoration: none; }
[data-reader-role="index"] [hidden] { display: none !important; }
#chapter-contents { scroll-margin-top: calc(var(--header-h, 64px) + 12px); }
