/* ── Changelog (/changelog) ────────────────────────────────────────────────
   Loaded ON TOP of legal.css, which already provides the page frame this
   shares with About / Privacy / Terms: the document column, the hero, the
   sidebar table of contents and its scrollspy. Everything here is the release
   timeline and nothing else — putting the frame in a fourth file is how the
   legal pages would start drifting apart.

   All colours are theme.css tokens, so the page is written once and reads
   correctly in both palettes. Note --hi-rgb below: it flips MEANING rather than
   value between themes (white on dark, near-black on light), which is what
   makes one hairline rule work in both. */

/* ── Version index (sidebar) ──
   legal.css sizes .legal-toc-num for a two-digit section number ("01"). A
   version prefix ("1.34") is wider, so the chip has to grow or the release
   titles beside it are ragged. */
.cl-toc .legal-toc-num {
  min-width: 32px;
  font-variant-numeric: tabular-nums;
}

/* ── Timeline ──
   One vertical rail down the left with a node per release. The rail is drawn
   on the .cl-rail column rather than as a ::before on the section, so the LAST
   release can stop the line cleanly instead of trailing into the footer. */
.cl-timeline {
  display: flex;
  flex-direction: column;
}

.cl-release {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 18px;
  /* Anchored navigation from the sidebar lands here; without the offset the
     heading sits under the sticky app header. */
  scroll-margin-top: 96px;
}

.cl-rail {
  position: relative;
  display: flex;
  justify-content: center;
}
.cl-rail::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg,
    rgba(var(--accent-rgb), .28),
    rgba(var(--hi-rgb), .07));
}
/* The rail must not continue past the final release into the page footer. */
.cl-release:last-child .cl-rail::before { bottom: auto; height: 100%; }

.cl-node {
  position: relative;
  z-index: 1;
  margin-top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid rgba(var(--accent-rgb), .45);
}
/* The newest release is the one the reader came for — it gets a filled node
   and a halo, so the top of the list is obvious at a glance even mid-scroll. */
.cl-release.is-latest .cl-node {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14);
}

.cl-body {
  padding-bottom: 34px;
  min-width: 0;
}
.cl-release:last-child .cl-body { padding-bottom: 8px; }

/* ── Release header ── */
.cl-head { margin-bottom: 14px; }

.cl-head-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 7px;
}

.cl-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-tint-12);
  border: 1px solid var(--accent-tint-30);
}

.cl-chip {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(var(--hi-rgb), .05);
  border: 1px solid var(--glass-border);
}
.cl-chip-latest {
  color: var(--success);
  background: var(--success-tint);
  border-color: rgba(var(--success-rgb), .28);
}

.cl-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.25;
  margin: 0 0 5px;
}

.cl-date {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: .03em;
}

/* ── Highlights ──
   A label column rather than an icon, because the label is the information:
   "Security" and "Fixed" mean different things to somebody scanning for
   whether they need to act, and a coloured dot makes them guess. */
.cl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cl-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: baseline;
}

.cl-kind {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: right;
  padding-top: 2px;
  /* Neutral by default, so a hand-edited entry with an unrecognised `type`
     renders as a plain labelled change instead of an unstyled one. */
  color: var(--text-muted);
}
.cl-item-new .cl-kind { color: var(--accent); }
.cl-item-improved .cl-kind { color: var(--success); }
.cl-item-fixed .cl-kind { color: var(--warning-deep); }
.cl-item-security .cl-kind { color: var(--danger); }

.cl-text {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}

/* ── Footer note + empty state ── */
.cl-foot {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}
.cl-foot p {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 6px;
}
.cl-foot p:last-child { margin-bottom: 0; }
.cl-foot code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--well);
  color: var(--text);
}
.cl-foot a { color: var(--accent); text-decoration: none; }
.cl-foot a:hover { text-decoration: underline; }

.cl-empty {
  text-align: center;
  padding: 56px 20px;
}
.cl-empty svg {
  width: 40px;
  height: 40px;
  color: var(--text-muted);
  opacity: .5;
  margin-bottom: 12px;
}
.cl-empty h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  color: var(--heading);
  margin: 0 0 6px;
}
.cl-empty p {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Phone ──
   The 72px label column costs a fifth of a phone's width for one word, so the
   label moves above its text and the timeline rail narrows. */
@media (max-width: 640px) {
  .cl-release { grid-template-columns: 18px 1fr; gap: 0 12px; }
  .cl-title { font-size: 17px; }
  .cl-item { grid-template-columns: 1fr; gap: 2px; }
  .cl-kind { text-align: left; padding-top: 0; }
  .cl-text { font-size: 12.5px; }
}
