/* ===================================================================
   Provision lineage: the Tier-0 line under a section heading, the sidebar
   drawer, and the dedicated `/usc/:t/:n/lineage` page. One node vocabulary
   (glyph + colour per kind) shared across all three -- see
   `Uslm::Lineage` and `LineageHelper`.
   ================================================================== */

/* -------------------------------------------------- Tier 0: the one line */

.lineage-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3) var(--space-5);
  margin: .35rem 0 1.4rem;
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: var(--text-xs);
  color: var(--muted);
}
.lineage-line-text { text-wrap: pretty; }
.lineage-line-link {
  flex: none;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}
.lineage-line-link:hover { text-decoration: underline; }

/* -------------------------------------------------- the timeline itself */

.lineage-glyph { display: block; flex: none; }
/* One colour per node kind, used identically in the drawer and on the page. */
.lineage-glyph[data-kind="enactment"]     { color: var(--accent); }
.lineage-glyph[data-kind="amendment"]     { color: var(--accent); }
.lineage-glyph[data-kind="codification"]  { color: var(--muted); }
.lineage-glyph[data-kind="release_point"] { color: var(--faint); }
.lineage-glyph[data-kind="editorial_note"]{ color: var(--note); }
.lineage-glyph[data-kind="regulation"]    { color: var(--muted); }
.lineage-glyph[data-kind="bill_stage"]    { color: var(--faint); }

.lineage-track {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
/* The rail the marks sit on. */
.lineage-track::before {
  content: "";
  position: absolute;
  left: 7px;
  top: .55rem;
  bottom: .55rem;
  width: 1.5px;
  background: var(--rule);
}

.lineage-node {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: var(--space-5);
  padding: 0 0 var(--space-7) 0;
  font-family: var(--sans);
  font-size: var(--text-xs);
  line-height: 1.45;
}
.lineage-node:last-child { padding-bottom: 0; }

.lineage-mark {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: .05rem;
  background: var(--panel);
}
.lineage-full .lineage-mark { background: var(--bg); }

.lineage-body {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 0;
}

.lineage-when {
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  font-size: var(--text-2xs);
}
.lineage-now {
  display: inline-block;
  margin-left: var(--space-2);
  padding: .05rem .4rem;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--bg);
  font-size: var(--text-3xs);
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.lineage-kind {
  font-size: var(--text-3xs);
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: var(--space-3);
}

.lineage-actor {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
a.lineage-actor:hover { text-decoration: underline; }

.lineage-ext-icon {
  display: inline-block;
  vertical-align: -1px;
  margin-left: .25em;
  color: var(--faint);
}
a.lineage-actor-ext:hover .lineage-ext-icon { color: var(--accent); }

/* An older law we hold no text for: the link goes to its "changes to the
   Code" view instead. Dotted, the same "there's a nuance here" cue the
   release sub-labels use. */
a.lineage-actor-changes {
  text-decoration: underline dotted;
  text-decoration-color: var(--rule);
  text-underline-offset: 2px;
}
a.lineage-actor-changes:hover {
  text-decoration-style: solid;
  text-decoration-color: currentColor;
}
.lineage-node[data-kind="release_point"] .lineage-actor { color: var(--ink); font-weight: 550; }

.lineage-name { color: var(--muted); }
.lineage-tag { margin-left: var(--space-3); color: var(--faint); font-size: var(--text-2xs); }
.lineage-note-heading { color: var(--ink); font-weight: 550; }
.lineage-node[data-kind="editorial_note"] .lineage-note-heading { color: var(--note); }

.lineage-inferred {
  margin-left: var(--space-3);
  padding: .02rem .3rem;
  border: 1px solid var(--note);
  border-radius: var(--radius-sm);
  background: var(--note-bg);
  color: var(--note);
  font-size: var(--text-3xs);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.lineage-node.is-inferred .lineage-actor { color: var(--muted); font-weight: 550; }

.lineage-summary { color: var(--muted); }

.lineage-diff {
  align-self: start;
  margin-top: .15rem;
  color: var(--accent);
  font-size: var(--text-2xs);
  font-weight: 550;
  text-decoration: none;
}
.lineage-diff:hover { text-decoration: underline; }

.lineage-run {
  display: inline-block;
  padding: .2rem .5rem;
  border: 1px dashed var(--rule);
  border-radius: var(--radius-md);
  color: var(--faint);
  font-size: var(--text-2xs);
  font-style: italic;
}
.lineage-node.is-current .lineage-when { color: var(--accent); }

/* -------------------------------------------------- drawer (sidebar) */

.sidebar-lineage .lineage-drawer > .eyebrow { margin: 0 0 var(--space-5); }
.lineage-drawer .lineage-node { font-size: var(--text-2xs); padding-bottom: var(--space-6); }
.lineage-drawer-foot {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule-soft, var(--rule));
}
.lineage-axis-note {
  margin: 0 0 var(--space-3);
  color: var(--faint);
  font-size: var(--text-2xs);
}
.lineage-axis-note a { color: var(--accent); }
.lineage-full-link {
  display: inline-block;
  margin-top: var(--space-2);
  color: var(--accent);
  font-weight: 600;
  font-size: var(--text-2xs);
  text-decoration: none;
}
.lineage-full-link:hover { text-decoration: underline; }

/* -------------------------------------------------- the page */

.lineage-page .lineage-lede,
.lineage-lede {
  max-width: 42rem;
  margin: 0 0 2rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--text-md);
  line-height: 1.55;
}

.lineage-full > section { margin-bottom: 2.5rem; }
.lineage-full > section:last-child { margin-bottom: 0; }
.lineage-full > section > .eyebrow {
  display: block;
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--rule);
  font-size: var(--text-2xs);
}
.lineage-axis-summary {
  margin: 0 0 var(--space-7);
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--text-sm);
}
.lineage-axis-summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.lineage-track-axis .lineage-node { padding-bottom: var(--space-6); }
.lineage-track-reg { display: grid; gap: var(--space-4); }
.lineage-track-reg::before { display: none; }
.lineage-track-reg .lineage-node { padding-bottom: 0; }

.lineage-more {
  display: inline-block;
  margin-top: var(--space-5);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 550;
  text-decoration: none;
}
.lineage-more:hover { text-decoration: underline; }

.lineage-toggle {
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--sans);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
}
.lineage-toggle:hover { border-color: var(--note); color: var(--note); }
.lineage-toggle[aria-expanded="true"] { border-color: var(--note); color: var(--note); }
.lineage-editorial .lineage-track { margin-top: var(--space-6); }
.lineage-editorial .lineage-node[data-kind="editorial_note"] .lineage-actor { color: var(--note); }

/* Reserved: a bill-stage lane opens to the left of the spine once bill
   ingestion lands. Nothing emits `:bill_stage` yet. */
.lineage-node[data-kind="bill_stage"] { opacity: .85; }
