/* Wayfinding (pairs with wayfinding.js): a contents card, in-flow chapter
   dividers, and a desktop-only section rail. Reuses the page tokens (Kiya
   headings, darkblue ink, dashed rules, squiggle-light wobble) so every piece
   reads hand-drawn. */

/* Land jumps below the sticky masthead (~60px tall). */
.wf-divider { scroll-margin-top: 84px; }

/* ── dividers ──────────────────────────────────────────────────────────── */
/* A rest stop in the transcript: number + section name, centred between two
   dashed rules. Kiya + darkblue like the exhibit headings, but wider-set and
   ringed with air so it reads as a higher-level break. */
.wf-divider {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 3.75rem 0 2.25rem;
  animation: squiggle-light 0.6s steps(1) infinite;
}

.wf-rule { flex: 1 1 auto; }
.wf-rule-line {
  display: block;
  border-top: 1px dashed var(--rule);
}

.wf-divider-label {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  white-space: nowrap;
}

.wf-num {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--ink-faint);
}

.wf-divider .wf-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-heading);
}

/* ── top menu ("In this issue") ────────────────────────────────────────── */
/* In-column card. Wobbles at a lazier cadence than the interludes so a box this
   size doesn't read as jittery. */
.wf-menu {
  margin: 2rem 0 0.5rem;
  padding: 1.1rem 1.25rem 1.25rem;
  border: 1px dashed var(--rule);
  background: var(--box-bg);
  animation: squiggle-light 1.5s steps(1) infinite;
}

.wf-menu-title {
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.wf-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.15rem 1.5rem;
}

@media (max-width: 520px) {
  .wf-menu-list { grid-template-columns: 1fr; }
}

.wf-menu-link {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.28rem 0.35rem;
  text-decoration: none;
  border-radius: 2px;
}

.wf-menu-link .wf-name {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink-heading);
}

.wf-menu-link:hover .wf-name,
.wf-menu-link:focus-visible .wf-name { color: var(--ink); }

.wf-menu-link.is-active {
  background: rgba(0, 0, 139, 0.06);   /* faint darkblue wash */
}
.wf-menu-link.is-active .wf-num { color: var(--ink-heading); }

/* ── section rail (desktop only, right margin, scroll-spy) ─────────────── */
/* Compact dotted index pinned to the right margin; labels tuck out until the
   rail is hovered or a link is the active section. Only shown where the margin
   is wide enough — below that the menu + dividers carry navigation. */
.wf-rail { display: none; }

@media (min-width: 1160px) {
  .wf-rail {
    display: block;
    position: fixed;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 700;
    max-height: 88vh;
    overflow: hidden;
  }
}

.wf-rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.1rem;
}

/* Dot sits at the right edge; the label expands to its left. */
.wf-rail-link {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink-faint);
}

.wf-rail-dot {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--page-bg);
}

/* Labels: hidden width until the rail is hovered or the item is active. Sit on
   a solid chip so they stay legible over whatever content is behind the rail. */
.wf-rail-link .wf-name {
  box-sizing: border-box;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--ink-heading);
  text-align: right;
  padding: 0.1rem 0.45rem;
  background: var(--page-bg);
  border-radius: 3px;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  transition: max-width 0.25s ease, opacity 0.2s ease;
}

.wf-rail-link:hover .wf-name,
.wf-rail-link:focus-visible .wf-name,
.wf-rail-link.is-active .wf-name {
  max-width: 15rem;
  opacity: 1;
}

.wf-rail-link.is-active .wf-rail-dot {
  border-color: var(--ink-heading);
  color: var(--page-bg);
  background: var(--ink-heading);
}

/* ── quiet down for reduced-motion + print ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .wf-divider,
  .wf-menu { animation: none; }
}

@media print {
  .wf-rail { display: none !important; }
}
