/* Reader features for book pages (see book.js) */
[id] { scroll-margin-top: 4rem; }
:target { animation: flash 2.5s; }
@keyframes flash { from { background: color-mix(in srgb, currentColor 14%, transparent); } }
.arg-cite a { text-decoration: underline dotted; text-underline-offset: .2em; }
.arg-cite a:hover { text-decoration-style: solid; }

/* A followed citation, and the way back */
main * { transition: background 1s; }
.cited { background: color-mix(in srgb, currentColor 12%, transparent); }
#back { position: fixed; bottom: 1.5rem; left: 50%; translate: -50%; z-index: 1; padding: .5em 1.1em; font: inherit; font-size: 15px;
  color: inherit; background: inherit; border: 1px solid #8886; border-radius: 99px; box-shadow: 0 .4em 1.5em #0003; cursor: pointer; }

/* Running head */
#bar { position: fixed; inset: 0 0 auto; z-index: 1; display: flex; align-items: center; gap: .8em;
  padding: .55rem max(1.5rem, calc(50% - 300px)); font: inherit; font-size: 15px; color: inherit; background: inherit;
  border: 0; border-bottom: 1px solid #8883; cursor: pointer; text-align: left; }
#rh { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; opacity: .7; }
#sec { flex: none; opacity: .7; }
#bar svg { flex: none; margin-left: auto; opacity: .6; }
@supports (animation-timeline: scroll()) {
  #bar::after { content: ''; position: absolute; inset: auto 0 -1px; height: 1px; background: currentColor; opacity: .5;
    transform-origin: left; animation: read linear both; animation-timeline: scroll(root); }
}
@keyframes read { from { transform: scaleX(0); } }
@media print { #bar { display: none; } }

/* Contents + search */
#pal { width: min(36rem, 100vw - 2rem); max-height: 76vh; margin: 12vh auto auto; padding: 0; font-size: 16px;
  color: inherit; background: inherit; border: 1px solid #8885; border-radius: 10px; box-shadow: 0 1em 3em #0003; }
#pal[open] { display: flex; flex-direction: column; }
#pal::backdrop { background: #0003; }
#pal input { font: inherit; font-size: 1.15em; padding: .8em 1em; border: 0; border-bottom: 1px solid #8884; background: none; color: inherit; outline: 0; }
#pal ol { list-style: none; margin: 0; padding: .4em 0; overflow: auto; }
#pal a { display: block; padding: .4em 1em; text-decoration: none; }
#pal a.sel, #pal a:hover { background: color-mix(in srgb, currentColor 9%, transparent); }
#pal a[aria-current] { font-style: italic; }
#pal .part { margin-top: .5em; font-weight: 600; }
#pal .sub a { padding-left: 2.2em; font-size: .92em; opacity: .85; }
#pal small { display: block; opacity: .55; font-variant: small-caps; }
#pal .hit { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#pal mark { color: inherit; background: color-mix(in srgb, currentColor 18%, transparent); border-radius: 2px; }
#pal .none { padding: .4em 1em; opacity: .55; }
