/* Outline of the reading view. On wide screens it stays at the right edge of the window, a little above the middle
   of the area below the header, while the reader is in the idea, architecture, and evidence sections. Narrow or short screens and the
   opening keep their layout. */
.page-outline { display: none; }
@media (min-width: 1180px) and (min-height: 480px) {
  body.content-active {
    --outline-width: 196px; --outline-gap: 40px; --outline-edge: 28px;
    --outline-at: .4; /* vertical center of the outline, as a fraction of the area below the header */
  }
  /* Room for the outline only where the right margin of the page is narrower than the outline. */
  body.content-active .idea-section > .wrap {
    padding-right: max(0px, calc(var(--outline-width) + var(--outline-gap) + var(--outline-edge) - (100% - min(1240px, 100% - 96px)) / 2));
  }
  body.content-active .page-outline {
    display: block;
    position: fixed;
    z-index: 40;
    top: calc(var(--outline-at) * 100% + (1 - var(--outline-at)) * var(--reading-bar-height, 82px));
    right: var(--outline-edge);
    width: var(--outline-width);
    padding: 14px 16px;
    border-radius: 10px;
    background: rgba(247,245,242,.92);
    opacity: 0;
    visibility: hidden;
    transform: translateY(calc(-50% + 8px));
    transition: opacity .35s, transform .35s, visibility .35s;
  }
  body.content-active .page-outline.is-shown { opacity: 1; visibility: visible; transform: translateY(-50%); }
}
.page-outline-title { margin: 0 0 12px; color: var(--faint); font: 10px/1.4 var(--mono); letter-spacing: .12em; }
.page-outline ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.page-outline a { display: grid; grid-template-columns: 24px minmax(0,1fr); margin-left: -1px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; color: var(--muted); font-size: 14px; line-height: 1.35; transition: color .2s, border-color .2s; }
.page-outline a span { color: var(--faint); font: 11px/1.7 var(--mono); }
.page-outline a:hover { color: var(--fg); }
.page-outline a[aria-current] { color: var(--red); border-left-color: var(--red); }
.page-outline a[aria-current] span { color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .page-outline { transition: none !important; }
}
