.section-heading,
main figure[id],
main table[id] {
  scroll-margin-top: calc(var(--navbar-height, 60px) + 24px);
}

.heading-title-link,
.rk-chart-title-link,
.rk-content-title-link {
  color: inherit !important;
  text-decoration: none !important;
}

.heading-anchor {
  display: inline-flex;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.4em;
  align-items: center;
  justify-content: center;
  color: var(--ink-3, var(--global-text-color-light));
  opacity: 0;
  transform: translateY(0.06em);
  transition: color 0.15s ease, opacity 0.15s ease;
}

.heading-anchor svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.section-heading:hover > .heading-anchor,
.section-heading:focus-within > .heading-anchor,
.rk-chart-heading:hover > .heading-anchor,
.rk-chart-heading:focus-within > .heading-anchor,
.rk-content-heading:hover > .heading-anchor,
.rk-content-heading:focus-within > .heading-anchor,
.heading-anchor:focus {
  opacity: 1;
}

.heading-title-link:hover,
.heading-title-link:focus,
.rk-chart-title-link:hover,
.rk-chart-title-link:focus,
.rk-content-title-link:hover,
.rk-content-title-link:focus,
.heading-anchor:hover,
.heading-anchor:focus {
  color: var(--accent, var(--global-hover-color)) !important;
}

@media (prefers-reduced-motion: reduce) {
  .heading-anchor { transition: none; }
}
