/* The public policy documents share the same paper, text and link colours. */
.reading-index {
  margin: 1.5rem 0;
  border-block: 1px solid var(--line);
  color: var(--fg);
}

.reading-index summary {
  width: fit-content;
  padding: .65rem .25rem;
  cursor: pointer;
  font-weight: 650;
}

.reading-index summary::marker {
  color: var(--link);
}

.reading-index ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr));
  gap: .1rem 1.2rem;
  margin: 0 0 .8rem;
  padding: 0;
  list-style: none;
}

.reading-index a {
  display: block;
  padding: .35rem .25rem;
  text-underline-offset: .16em;
}

.reading-index :is(a, summary):focus-visible,
main h2[tabindex]:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

main h2[id] {
  scroll-margin-block-start: 1rem;
}

main h2:target {
  border-top-color: var(--link);
  color: var(--link);
}

.reading-progress {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .reading-progress {
      display: block;
      position: fixed;
      z-index: 1;
      inset: 0 0 auto;
      height: .2rem;
      background: var(--link);
      transform: scaleX(0);
      transform-origin: left;
      pointer-events: none;
      animation: reading-position linear both;
      animation-timeline: scroll(root block);
    }

    @keyframes reading-position {
      to { transform: scaleX(1); }
    }
  }

  main h2:target {
    animation: reading-destination .55s ease-out;
  }

  @keyframes reading-destination {
    from { background-color: color-mix(in srgb, var(--link) 12%, transparent); }
    to { background-color: transparent; }
  }
}

@media print {
  .reading-index, .reading-progress { display: none; }
  main h2:target { color: inherit; animation: none; }
}

/* Brand artwork comes from the same intact transparent source as the app. */
.reading-brand {
  max-width:46rem;
  margin:0 auto;
  padding:1.1rem max(1rem,env(safe-area-inset-left)) 0 max(1rem,env(safe-area-inset-right));
}
.reading-brand + main { padding-top:.8rem; }
.reading-home { display:inline-flex; gap:.45rem; align-items:center; min-height:44px; color:var(--fg); text-decoration:none; font-weight:760; letter-spacing:-.025em; }
.reading-home:focus-visible { outline:2px solid var(--link); outline-offset:3px; border-radius:.2rem; }
.reading-mark {
  width: 2.2rem;
  height: 2.2rem;
  display: block;
  transform-origin: 50% 75%;
  background: url('dtrblocks-mark-160.png') center/contain no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
  .reading-mark {
    animation: dtr-reading-seat .78s cubic-bezier(.16,.74,.28,1) both;
    transition: rotate .28s ease-out;
  }
  .reading-home:focus-visible .reading-mark { rotate: -3deg; }
  @media (hover: hover) { .reading-home:hover .reading-mark { rotate: -3deg; } }
  @keyframes dtr-reading-seat {
    0% { transform: translateY(-7%) rotate(-4deg); }
    60% { transform: translateY(1.3%) rotate(1.4deg); }
    82% { transform: translateY(-.4%) rotate(-.45deg); }
    100% { transform: none; }
  }
  @supports (animation-timeline: view()) {
    .reading-home {
      animation: dtr-reading-leave linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
      transform-origin: left center;
    }
    @keyframes dtr-reading-leave { from { scale: 1; } to { scale: .92; } }
  }
}
@media print { .reading-brand {display:none} }
