/* wesbecher.llc · the wiki reading apparatus
 *
 * The pattern proved on /pipeline/: a contents band under the hero that jumps
 * anywhere, a sticky rail that tracks the read on wide screens, and a way back
 * at the end of every section. Built on the shared --wl-* tokens so it lands
 * the same on every route regardless of that page's own neutrals.
 *
 * Below 1152px the rail is gone: the global nav drawer already carries the
 * section list, and two contents systems on one phone screen is one too many.
 * No em dashes anywhere in this file, including comments.
 */

/* ---------------- jump link, sits with the hero ---------------- */
.wiki-jump {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-family: var(--wl-font); font-size: 0.875rem; font-weight: 700;
  color: var(--wl-blue-light); text-decoration: none;
}
.wiki-jump:hover { color: var(--wl-paper); }
.wiki-jump:focus-visible { outline: 2px solid var(--wl-blue-light); outline-offset: 2px; }

/* ---------------- contents band ---------------- */
.contents-band {
  font-family: var(--wl-font);
  border-bottom: 1px solid var(--wl-line);
  padding: 40px 0 44px;
}
.contents-band .cb-in {
  max-width: var(--wiki-w, 1216px); margin: 0 auto; padding: 0 var(--wiki-pad, 24px);
}
.contents-band .c-eyebrow {
  display: flex; align-items: center; gap: 0.55em;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--wl-blue); margin: 0;
}
.contents-band .c-eyebrow::before { content: ''; width: 9px; height: 9px; background: var(--wl-blue); flex: none; }
.contents-band .cgroup {
  margin: 24px 0 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--wl-muted);
}
.contents-band .chipgrid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px;
  margin-top: 8px; border-top: 2px solid var(--wl-ink);
}
.contents-band .chipgrid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.contents-band .chip {
  display: flex; gap: 12px; align-items: baseline;
  /* routes that already own a .chip (the playbook's rate pills) must not
     leak their fill, radius or casing into the contents map */
  background: transparent; border: 0; border-bottom: 1px solid var(--wl-line); border-radius: 0;
  padding: 11px 0; min-height: 44px; white-space: normal;
  font-size: 0.9375rem; font-weight: 700; letter-spacing: normal; text-transform: none;
  color: inherit; text-decoration: none;
}
.contents-band .chip .n { color: var(--wl-blue); font-size: 0.78rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.contents-band .chip:hover, .contents-band .chip:hover .n { color: var(--wl-blue-dark); }
.contents-band .chip:focus-visible { outline: 2px solid var(--wl-blue); outline-offset: 2px; }
.contents-band .chip small { font-weight: 500; color: var(--wl-muted); font-size: 0.8125rem; }
.contents-band .pills {
  display: flex; flex-wrap: wrap; gap: 2px 26px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--wl-line);
}
.contents-band .pills a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 0;
  background: transparent; border: 0; border-radius: 0;
  font-size: 0.84rem; font-weight: 600; letter-spacing: normal; text-transform: none;
  color: var(--wl-blue-dark); text-decoration: none; white-space: nowrap;
}
.contents-band .pills a:hover { color: var(--wl-ink); }
.contents-band .pills a:focus-visible { outline: 2px solid var(--wl-blue); outline-offset: 2px; }

/* ---------------- rail plus article ---------------- */
.page {
  display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 48px;
  max-width: var(--wiki-w, 1216px); margin: 0 auto; padding: 0 var(--wiki-pad, 24px);
}
/* the article column owns the measure, so page wraps inside it stand down */
.page .art > * > .wrap, .page .art > .wrap { max-width: none; padding-left: 0; padding-right: 0; }
.page .rail {
  position: sticky; top: calc(var(--gnav-h, 57px) + 16px); align-self: start;
  max-height: calc(100vh - var(--gnav-h, 57px) - 32px); overflow-y: auto;
  padding: 28px 0 32px; font-family: var(--wl-font); font-size: 0.8125rem;
}
.page .rail .rh {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--wl-muted); margin: 0 0 10px;
}
.page .rail a {
  display: block; padding: 5px 0 5px 12px; border-left: 2px solid transparent;
  color: var(--wl-muted); text-decoration: none; line-height: 1.5;
}
.page .rail a:hover { color: var(--wl-ink); }
.page .rail a.on { color: var(--wl-blue); border-left-color: var(--wl-blue); font-weight: 700; }
.page .rail a:focus-visible { outline: 2px solid var(--wl-blue); outline-offset: 2px; }

/* dark sections stay inside the article column: a full-bleed band would run
   under the sticky rail and swallow it */
.page .art > .module--dark, .page .art > .dark { padding-inline: var(--wl-s3, 24px); }

/* ---------------- the way back ---------------- */
.toplink {
  display: block; text-align: right; margin-top: 28px;
  font-family: var(--wl-font);
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--wl-muted); text-decoration: none;
}
.toplink:hover { color: var(--wl-blue); }
.toplink:focus-visible { outline: 2px solid var(--wl-blue); outline-offset: 2px; }
/* On a dark section --wl-muted lands at 3.31:1, under the 4.5:1 AA floor for
   text this size. The dark neutral clears it at 7.8:1, and the hover and focus
   states take the light blue at 8.3:1. */
.module--dark .toplink, .dark .toplink { color: var(--wl-muted-dark); }
.module--dark .toplink:hover, .dark .toplink:hover { color: var(--wl-blue-light); }
.module--dark .toplink:focus-visible, .dark .toplink:focus-visible { outline-color: var(--wl-blue-light); }

@media (max-width: 1151px) {
  .page { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .page .rail { display: none; }
}
@media (max-width: 960px) {
  .contents-band .chipgrid, .contents-band .chipgrid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
  .contents-band { padding: 28px 0 32px; }
  .contents-band .chip { font-size: 0.875rem; padding: 9px 0; }
  .contents-band .pills { gap: 0 18px; }
  .contents-band .pills a { font-size: 0.8125rem; padding: 4px 0; min-height: 32px; }
}
@media (max-width: 560px) {
  .contents-band .chipgrid, .contents-band .chipgrid--2 { grid-template-columns: minmax(0, 1fr); }
}
@media print { .contents-band, .page .rail, .toplink, .wiki-jump { display: none !important; } }
