[data-fg-section-jump] {
  font-weight: 650;
  text-underline-offset: .2em;
}

details[data-fg-section-arrival] {
  scroll-margin-block-start: 1.25rem;
}

[data-fg-section-marker] {
  display: none;
}

[data-fg-section-arrival]:target > :is(summary, h2) {
  position: relative;
}

[data-fg-section-arrival]:target > :is(summary, h2) > [data-fg-section-marker] {
  display: block;
  position: absolute;
  inset-inline-start: -.6rem;
  inset-block-start: 50%;
  inline-size: 2px;
  block-size: 1.15rem;
  border-radius: 1px;
  background: currentColor;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Put the shared focus outline on the heading of the addressed section. */
[data-fg-section-arrival][tabindex="-1"]:target:focus-visible {
  outline: none !important;
}

[data-fg-section-arrival]:target:focus-visible > :is(summary, h2) {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: .25rem;
}

@media (prefers-reduced-motion: no-preference) {
  [data-fg-section-arrival]:target > :is(summary, h2) > [data-fg-section-marker] {
    animation: fg-section-arrival 200ms cubic-bezier(.2, .65, .3, 1) both;
  }

  @keyframes fg-section-arrival {
    from {
      opacity: .2;
      transform: translateY(-50%) scaleY(.4);
    }
  }
}
