/* ==========================================================================
   CO Climate Tracker
   climate/climate.css

   Section identity first, then the components unique to the tracker. This is
   the most data-dense section of the site, so it leans hardest on the mono
   voice: cold alpine accent, tabular figures, tight rules.

   The .stages component defined here is the one every bill page will reuse.
   ========================================================================== */

[data-section="climate"] {
  --brand: #3d7fa3;            /* alpine — cold high country */
  --brand-soft: #7fa8c4;
  --brand-text-light: #2a6d90; /* 5.1:1 on bone */
  --brand-text-dark: #a6cbe0;  /* 11:1 on ink */
}

/* Legislative numbers read as data, not as prose. */
[data-section="climate"] .mono,
[data-section="climate"] .stage__name {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   HOW IT WORKS
   -------------------------------------------------------------------------- */

.how {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.how h2 {
  font-size: var(--step-3);
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1;
  line-height: 1.32;
  max-width: 24ch;
  margin-top: var(--sp-5);
}

.how__body {
  display: grid;
  gap: var(--sp-5);
  max-width: 54ch;
  color: var(--text-muted);
}

@media (max-width: 52rem) {
  .how { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   STAGES — the tracker's signature component
   A bill's path through the legislature. Reused verbatim on every bill page,
   with .stage--done / .stage--current moved along the line.
   -------------------------------------------------------------------------- */

.legend {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* Same voice as the shared .block-title, with more room beneath it because
   the stages line needs breathing space. */
.legend__title {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: var(--sp-6);
}

.stages {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--sp-3);
  padding-inline: var(--sp-2);
  text-align: center;
}

/* The connector runs behind the node, from the previous stage to this one. */
.stage::before {
  content: "";
  position: absolute;
  top: 0.3125rem;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--line-strong);
  opacity: 0.5;
}

.stage:first-child::before { display: none; }

.stage--done::before,
.stage--current::before { background: var(--accent); opacity: 1; }

.stage__node {
  position: relative;
  z-index: 1;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 2px solid var(--line-strong);
}

.stage--done .stage__node {
  background: var(--accent);
  border-color: var(--accent);
}

.stage--current .stage__node {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.stage__name {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-wrap: balance;
}

.stage--done .stage__name,
.stage--current .stage__name {
  color: var(--accent-text);
  font-weight: 500;
}

.stage__note {
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--text-faint);
  text-wrap: balance;
}

.legend__note {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--text-muted);
  max-width: 56ch;
}

/* Six stages will not fit across a phone. Turn the line vertical: the
   connector becomes the spine, and each stage keeps its own row. */
@media (max-width: 46rem) {
  .stages {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }

  .stage {
    grid-template-columns: auto 1fr;
    grid-template-areas: "node name" "node note";
    justify-items: start;
    gap: 0 var(--sp-4);
    text-align: left;
    padding-inline: 0;
  }

  .stage__node { grid-area: node; align-self: center; }
  .stage__name { grid-area: name; }
  .stage__note { grid-area: note; }

  .stage::before {
    top: auto;
    bottom: 100%;
    left: 0.3125rem;
    right: auto;
    width: 2px;
    height: var(--sp-4);
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   BILL PAGE
   One page per bill, and there will eventually be thousands. Structure is
   fixed so the pages are comparable at a glance: identifier and status, the
   plain-language summary, the structured facts, the dated action log, then
   the sources everything came from.
   -------------------------------------------------------------------------- */

/* The identifier line above the title: bill number, chamber, session. */
.bill-id {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.bill-id__number {
  font-weight: 500;
  color: var(--accent-text);
}

.bill-id__sep {
  width: 1px;
  height: 0.9em;
  background: var(--line-strong);
}

.bill-id__session { color: var(--text-faint); }

/* The status line gets its own framed block: it is the thing most readers
   came for, and it is the one part that changes week to week. */
.bill-status {
  margin: clamp(2rem, 5vw, 3rem) 0;
  padding: clamp(1.5rem, 3.5vw, 2.25rem);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.bill-status__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.bill-status__label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--text-faint);
}

.bill-status__updated {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   ACTION LOG
   Every action taken on the bill, most recent first. Meticulous by design:
   a date, what happened, and where that is recorded.
   -------------------------------------------------------------------------- */

.log {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  max-width: 52rem;
}

.log > li {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.25rem var(--sp-5);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--line);
}

.log time {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.06em;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  padding-top: 0.15em;
}

.log__what {
  font-size: var(--step--1);
  line-height: 1.6;
}

.log__where {
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  color: var(--text-faint);
}

/* The newest action is the live one. */
.log > li:first-child .log__what {
  font-weight: 500;
  color: var(--accent-text);
}

@media (max-width: 40rem) {
  .log > li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
  .log time { padding-top: 0; }
  .log__where { grid-column: 1; }
}

/* --------------------------------------------------------------------------
   FILTERS
   The bill index will need narrowing long before it needs searching. These
   are plain links, so they work without JavaScript and each combination can
   have its own address later.
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.filters__label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: var(--tracking-micro);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: var(--sp-2);
}

.filters a {
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
}

.filters a:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

/* --------------------------------------------------------------------------
   EMPTY STATE placement
   -------------------------------------------------------------------------- */

.empty { margin-top: clamp(3rem, 7vw, 5rem); }

.empty code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  background: rgba(11, 19, 26, 0.06);
}
