/* ==========================================================================
   Congress tracker: a bill's journey up the Capitol steps and the sponsor
   tiles (src/features/congress/journey.js). The drawing itself is styled by
   congress-capitol.css; this adds the climb and the sponsor tiles.
   The climb only animates once congress-journey.js adds .is-live; without
   it (or with reduced motion) the final frame is shown.
   ========================================================================== */

.cgj .cgd-h2 em { font-style: italic; color: var(--cgd-hi); }
.cgj .cgd-sub { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Steps by state */
.cgj-step.is-done .cgj-riser { fill: #4A3373; stroke: rgba(255, 255, 255, 0.85); }
.cgj-step.is-skipped .cgj-riser { fill: #2E1F4B; stroke-dasharray: 4 4; }
.cgj-step.is-todo .cgj-riser { fill: #241638; }
.cgj-step.is-na .cgj-riser { fill: transparent; stroke: rgba(255, 255, 255, 0.3); stroke-dasharray: 2 5; }
.cgj-step.is-todo .cgj-label, .cgj-step.is-na .cgj-label, .cgj-step.is-skipped .cgj-label { fill: rgba(255, 255, 255, 0.62); }
.cgj-date { font: 500 19px var(--font-serif); font-variant-numeric: lining-nums tabular-nums; fill: #fff; }
.cgj-step.is-na .cgj-date, .cgj-step.is-skipped .cgj-date { font: 500 13px var(--font); fill: rgba(255, 255, 255, 0.62); letter-spacing: 0.04em; }
.cgj-note { font: italic 400 14px var(--font-serif); fill: #DCCFEE; }

.cgj-trail { fill: none; stroke: #DCCFEE; stroke-width: 2.2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.cgj-lamp { fill: #fff; }
.cgj-orb { fill: #fff; }
.cgj-halo { transform-box: fill-box; transform-origin: center; }

/* The climb (only once the script says the figure is on screen). */
.cgj.is-live .cgj-trail { stroke-dasharray: var(--len) var(--len); animation: cgj-draw var(--t) cubic-bezier(0.55, 0.1, 0.4, 1) both; }
.cgj.is-live .cgj-climber { animation: cgj-rise var(--t) cubic-bezier(0.55, 0.1, 0.4, 1) both; }
.cgj.is-live .cgj-lamp, .cgj.is-live .cgj-step.is-done .cgj-date, .cgj.is-live .cgj-note { animation: cgj-in 0.5s ease-out both; animation-delay: var(--d); }
.cgj.is-live .cgj-step.is-done .cgj-date, .cgj.is-live .cgj-note { animation-delay: calc(var(--d) + 0.55s); }
.cgj.is-live .cgj-step.is-done .cgj-riser { animation: cgj-lit 0.6s ease-out both; animation-delay: calc(var(--d) + 0.45s); }
.cgj .cgj-halo { animation: cgj-pulse 3.6s ease-in-out infinite; }
.cgj.is-paused .cgj-trail, .cgj.is-paused .cgj-climber, .cgj.is-paused .cgj-lamp, .cgj.is-paused .cgj-halo,
.cgj.is-paused .cgj-date, .cgj.is-paused .cgj-note, .cgj.is-paused .cgj-riser { animation-play-state: paused; }
@keyframes cgj-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@keyframes cgj-rise { from { transform: translateY(var(--rise)); } to { transform: translateY(0); } }
@keyframes cgj-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cgj-lit { from { fill: #2E1F4B; } to { fill: #4A3373; } }
@keyframes cgj-pulse { 0%, 100% { opacity: 0.6; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) {
  .cgj.is-live .cgj-trail, .cgj.is-live .cgj-climber, .cgj.is-live .cgj-lamp, .cgj .cgj-halo,
  .cgj.is-live .cgj-date, .cgj.is-live .cgj-note, .cgj.is-live .cgj-riser { animation: none; }
}

/* Ledger (the text version) and the sponsor's card */
.cgj-below { display: grid; gap: clamp(1.2rem, 3vw, 2.4rem); max-width: 64rem; margin: clamp(1.2rem, 3vw, 2rem) auto 0; align-items: start; }
.cgj-below.has-card { grid-template-columns: minmax(0, 1fr) 17.5rem; }
.cgj-ledger { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; border-top: 1px solid rgba(255, 255, 255, 0.3); }
.cgj-row { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: baseline; padding: 0.7rem 0.2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.16); }
.cgj-row-num { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; color: var(--cgd-hi); }
.cgj-row-name { font-family: var(--font-serif); font-size: 1.08rem; color: #fff; }
.cgj-row-name small { display: block; font-family: var(--font); font-size: 0.74rem; color: #DCCFEE; }
.cgj-row-date { font-size: 0.86rem; text-align: right; color: #DCCFEE; }
.cgj-row.is-done .cgj-row-date { font-family: var(--font-serif); font-size: 1.02rem; color: #fff; font-variant-numeric: lining-nums; }
.cgj-row.is-todo .cgj-row-name, .cgj-row.is-na .cgj-row-name, .cgj-row.is-skipped .cgj-row-name { color: rgba(255, 255, 255, 0.68); }
.cgj-row.is-na .cgj-row-date { font-size: 0.76rem; max-width: 16rem; }
.cgj-latest { max-width: 64rem; margin: 1.2rem auto 0; font-size: 0.86rem; line-height: 1.5; color: #fff; }
.cgj-latest span { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cgd-hi); }
@media (max-width: 760px) {
  .cgj-below.has-card { grid-template-columns: 1fr; }
  .cgm-solo { justify-self: center; width: min(100%, 17.5rem); }
  .cgj .cgj-label, .cgj .cgj-date, .cgj .cgj-note { display: none; } /* too small at this width: the ledger below carries the text */
}

/* ------------------------------------------------------- Sponsor rows */
/* Plain tiles on white: name, role and seat, the number of tracked measures,
   the furthest step reached, and up to four measures as links. */

.cgm { margin: 0 0 var(--s-4); }
.cgm-head { margin-bottom: 0.9rem; }
.cgm-deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 0.9rem; }

.cgm-card {
  --cgm-band: #6E42A6;
  display: flex; flex-direction: column; min-width: 0; padding: 0.95rem 1.1rem 0.85rem;
  background: var(--paper); color: var(--text); border: 1px solid var(--line); border-left: 3px solid var(--cgm-band); border-radius: 6px;
}
.cgm-p-d { --cgm-band: #2F5D9E; }
.cgm-p-r { --cgm-band: #A83E3A; }
.cgm-p-i, .cgm-p-id { --cgm-band: #6E42A6; }
.cgm-top { margin: 0 0 0.15rem; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cgm-name { margin: 0; font-family: var(--font-serif); font-weight: 500; font-size: 1.2rem; line-height: 1.2; color: var(--ink); }
.cgm-party { margin: 0.15rem 0 0.6rem; font-size: 0.85rem; color: var(--muted); }
.cgm-stats { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 1.4rem; margin: 0 0 0.6rem; padding: 0.55rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cgm-stats div { min-width: 0; }
.cgm-stats dt { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.cgm-stats dd { margin: 0.1rem 0 0; font: 600 1.25rem/1.15 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.cgm-stats dd.cgm-small { font-size: 0.9rem; font-weight: 600; line-height: 1.3; }
.cgm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.cgm-list a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.86rem; line-height: 1.4; color: var(--text); text-decoration: none; }
.cgm-list a:hover, .cgm-list a:focus-visible { color: var(--accent-text); text-decoration: underline; }
.cgm-list b { color: var(--ink); }
.cgm-list small { display: block; font-size: 0.74rem; color: var(--muted); }
.cgm-more { margin: 0.55rem 0 0; font-size: 0.84rem; font-weight: 600; }
.cgm-more a { color: var(--accent-text); }
.cgm-src { margin: auto 0 0; padding-top: 0.6rem; font-size: 0.72rem; color: var(--muted); }

/* Sponsors on the docket (owner review, round 5): white cards with purple text, in light and dark mode.
   The party band on the left stays. Contrast on white: #2A1B45 14:1, #5A3689 8.6:1, #6E42A6 6.4:1. */
:root:root .cgm .cgm-card { background: #FFFFFF; color: #2A1B45; border-color: #E2D9EE; border-left-color: var(--cgm-band); }
:root:root .cgm .cgm-name, :root:root .cgm .cgm-stats dd, :root:root .cgm .cgm-list b { color: #2A1B45; }
:root:root .cgm :is(.cgm-top, .cgm-party, .cgm-stats dt, .cgm-list small, .cgm-src) { color: #6E42A6; }
:root:root .cgm .cgm-list a { color: #5A3689; }
:root:root .cgm .cgm-list a:is(:hover, :focus-visible), :root:root .cgm .cgm-more a { color: #2A1B45; }
:root:root .cgm .cgm-stats { border-top-color: #E2D9EE; border-bottom-color: #E2D9EE; }
