/* ───────────────────────────────────────────────────────────────
   Local Test — changelog page

   Every release shipped on the same day, so a dated list would read
   as broken. The date is stated once in the facts rail at the top;
   each entry leads with the version number in the mono face and the
   one sentence that describes it. The 1.x line sits on raised cards,
   the 0.x beta history on a quieter rail beneath it.

   Only tokens from styles.css are used — no literal colors, so the
   page follows the light/dark theme without a second palette.

   1. Page head   2. Facts rail   3. Release lists
   4. Entry parts 5. Footnote     6. Responsive & motion
   ─────────────────────────────────────────────────────────────── */

/* ─── 1. Page head ──────────────────────────────────────────── */
.cl-head h1 {
  font-size: clamp(2.1rem, 5.5vw, 2.8rem);
  margin-bottom: .7rem;
}

.cl-lede {
  max-width: 36rem;
  color: var(--ink-2);
}
.cl-lede a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--rule); }
.cl-lede a:hover { border-bottom-color: var(--accent); }

/* ─── 2. Facts rail ─────────────────────────────────────────── */
/* The one place the date appears. Three plain facts, no decoration. */
.cl-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 1rem 1.4rem;
  margin: 1.7rem 0 0;
  padding: 1rem 1.2rem 1.05rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.cl-facts dt {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: .15rem;
}

.cl-facts dd {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--ink);
}

/* ─── 3. Release lists ──────────────────────────────────────── */
.releases {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 0;
}

/* Anchored entries clear the sticky header. */
.release {
  position: relative;
  scroll-margin-top: calc(var(--nav-h, 4.2rem) + 1.2rem);
}

.release p {
  margin: 0;
  color: var(--ink-2);
}

/* 1.x — raised cards, the part most visitors came for. */
.releases-stable {
  display: grid;
  gap: 1rem;
}

.releases-stable .release {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.05rem 1.3rem 1.2rem;
  box-shadow: var(--shadow);
}

.releases-stable .is-current {
  border-color: var(--accent);
}

/* 0.x — a quieter rail. Same information, less weight. */
.releases-beta {
  padding-left: 1.5rem;
  border-left: 1px solid var(--rule);
}

.releases-beta .release + .release { margin-top: 1.35rem; }

.releases-beta .release::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 4px);
  top: .58rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rule);
}

.releases-beta .release p { font-size: .95rem; }

/* ─── 4. Entry parts ────────────────────────────────────────── */
.release-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .5rem .7rem;
  margin-bottom: .35rem;
}

.release-head h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

/* The version number is the entry's title and its link. */
.v {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--ink);
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.releases-stable .v { font-size: 1.12rem; }

/* Current release, and whichever entry was deep-linked to. */
.is-current .v,
.release:target .v { color: var(--accent); }
.releases-beta .release:target::before { background: var(--accent); }

.chip {
  font-family: var(--mono);
  font-size: .64rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: .2rem .5rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink-3);
}

.chip-current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

/* Added by changelog.js only when the GitHub API confirms it. */
.chip-live {
  background: var(--sage);
  border-color: transparent;
  color: var(--ink);
}

/* Dates only appear on entries appended from the API, which no
   longer share the page-level publication date. */
.release-when {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .03em;
  color: var(--ink-3);
}

/* ─── 5. Footnote ───────────────────────────────────────────── */
.cl-beta { margin-top: .4rem; }

.cl-foot { padding-top: clamp(1.8rem, 5vw, 2.6rem); }

.cl-note {
  max-width: 34rem;
  font-size: .88rem;
  color: var(--ink-3);
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

/* ─── 6. Responsive & motion ────────────────────────────────── */
@media (max-width: 560px) {
  .cl-facts { grid-template-columns: 1fr 1fr; }
  .releases-beta { padding-left: 1.1rem; }
  .releases-beta .release::before { left: calc(-1.1rem - 4px); }
  .releases-stable .release { padding: .95rem 1.05rem 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  .v { transition: none; }
}
