/*
 * The changelog (`changelog.html` → /changelog/): home.css's system and page.css's opening, plus the
 * release timeline. `scripts/release-notes.js` and `scripts/build-site.js` write each release as
 *   li.release > .rail (h2 > a, time) + .notes (p, h3.<kind>, ul > li > strong + .detail, details.more, a.dmg)
 * and this file is the only thing that draws it.
 */

/* ─── The opening: the newest build's screen on a painting ────────────── */
.log-shot {
  left: 56px;
  top: 72px;
  width: 1040px;
}

.log-card {
  --depth: 18px;

  left: 24px;
  top: 380px;
}

/* ─── The releases: a line down the page, each one hanging off it. Not `.timeline`, which is the home page Recap's bars ─── */
.releases {
  padding-top: var(--s9);
}

.spine {
  max-width: 960px;
}

.release {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--s7);
  scroll-margin-top: var(--s9);
}

.rail {
  align-self: start;
}

.rail h2 {
  font-size: var(--h3);
  line-height: var(--h3-lh);
}

.rail h2 a {
  text-decoration: none;
}

.rail h2 a:hover {
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 6px;
}

.rail time {
  display: block;
  margin-top: var(--s2);
  font: 560 var(--label) / var(--label-lh) var(--font-sans);
  color: var(--text-3);
}

/* The newest release says so, in the margin where somebody arriving looks first */
.release:first-child .rail time::after {
  content: 'Latest';
  display: inline-block;
  margin-left: var(--s2);
  padding: 2px var(--s2);
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--white);
}

.notes {
  position: relative;
  max-width: 680px;
  padding: 0 0 var(--s8) var(--s7);
  border-left: 1px solid var(--line-2);
}

.release:last-child .notes {
  padding-bottom: 0;
  border-left-color: transparent;
}

/* A stop on the line: hollow, and filled for the newest */
.notes::before {
  content: '';
  position: absolute;
  top: var(--s3);
  left: -6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: inset 0 0 0 1.5px var(--text-3);
}

.release:first-child .notes::before {
  background: var(--ink);
  box-shadow: 0 0 0 4px var(--white);
}

.notes > p {
  font-size: 20px;
  line-height: 30px;
  color: var(--text);
}

.notes > p + * {
  margin-top: var(--s5);
}

.notes p.detail {
  margin-top: var(--s4);
  font-size: var(--body);
  line-height: var(--body-lh);
  color: var(--text-2);
}

/* The two kinds of section, as quiet labels: no colour of their own */
.notes h3 {
  display: inline-block;
  margin-top: var(--s6);
  margin-bottom: var(--s3);
  padding: var(--s1) var(--s3);
  border-radius: var(--r-pill);
  font: 560 var(--label) / var(--label-lh) var(--font-sans);
  background: var(--paper);
  color: var(--text-2);
}

.notes h3.whatsnew {
  background: var(--ink);
  color: var(--white);
}

.notes > h3:first-child {
  margin-top: 0;
}

.notes ul {
  display: grid;
  gap: var(--s3);
}

.notes li {
  position: relative;
  padding-left: var(--s5);
  font-size: var(--body);
  line-height: var(--body-lh);
  color: var(--text-2);
}

.notes li::before {
  content: '';
  position: absolute;
  top: 11px;
  left: var(--s1);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-3);
}

.notes li strong {
  font-weight: 560;
  color: var(--text);
}

.notes code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--paper);
  font: 0.88em var(--font-mono);
  color: var(--text);
}

/* Folded until somebody asks. Written as `:not(:has(…))` so a browser without `:has()` shows
   every release in full rather than hiding text it then cannot reveal. */
.notes:not(:has(.more[open])) .detail {
  display: none;
}

.more {
  margin-top: var(--s5);
}

.more summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  height: 40px;
  padding: 0 var(--s4);
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-size: 14px;
  font-weight: 560;
  cursor: pointer;
  list-style: none;
  transition: box-shadow 160ms var(--ease);
}

.more summary::-webkit-details-marker {
  display: none;
}

.more summary:hover {
  box-shadow: inset 0 0 0 1px var(--text-3);
}

.more summary::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentcolor;
  border-bottom: 1.5px solid currentcolor;
  transform: translateY(-2px) rotate(45deg);
}

.more[open] summary::after {
  transform: translateY(1px) rotate(-135deg);
}

.more[open] .expand,
.more:not([open]) .collapse {
  display: none;
}

.dmg {
  display: inline-block;
  margin-top: var(--s4);
  font-size: 14px;
  font-weight: 560;
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 4px;
}

.dmg:hover {
  text-decoration-color: currentcolor;
}

@media (width <= 1100px) {
  .log-shot {
    width: 880px;
  }

  .log-card {
    top: 330px;
  }
}

@media (width <= 720px) {
  .log-shot {
    left: var(--s4);
    top: var(--s5);
    width: 1000px;
  }

  .release {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s4);
  }

  .rail {
    display: flex;
    align-items: baseline;
    gap: var(--s4);
  }

  .rail h2 {
    font-size: var(--h4);
    line-height: var(--h4-lh);
  }

  .rail time {
    margin-top: 0;
  }

  .notes {
    padding: 0 0 var(--s8);
    border-left: 0;
  }

  .notes::before {
    display: none;
  }

  .release + .release {
    padding-top: var(--s7);
    border-top: 1px solid var(--line);
  }

  .notes > p {
    font-size: var(--body);
    line-height: var(--body-lh);
  }
}
