/* Changelog page — built on the reader's theme tokens (lib/css/themes/themes.css). */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* --- Skip link ------------------------------------------------------------ */

.cl-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-accent);
  color: var(--text-accent);
  text-decoration: none;
}

.cl-skip:focus {
  left: 12px;
  top: 12px;
}

/* --- Header --------------------------------------------------------------- */

.cl-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-secondary);
}

.cl-header__inner,
.cl-main,
.cl-footer__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.cl-header__inner {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}

/* Brand + breadcrumb on one baseline. The brand is one link (to the repository); the page name is a label. */
.cl-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 14px;
  white-space: nowrap;
}

.cl-brand__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 150ms ease;
}

.cl-brand__link:hover { color: var(--text-accent); }

.cl-brand__mark {
  width: 24px;
  height: 24px;
  display: block;
  flex: none;
}

.cl-brand__name {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.cl-brand__github {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--text-secondary);
  transition: color 150ms ease;
}

.cl-brand__link:hover .cl-brand__github { color: var(--text-accent); }

.cl-brand__sep,
.cl-brand__page {
  color: var(--text-secondary);
}

.cl-brand__sep { opacity: 0.6; }

/* The one action in the header: accent text, no fill, full touch height. */
.cl-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 44px;
  padding: 0 4px;
  color: var(--text-accent);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 4px;
  transition: color 150ms ease;
}

.cl-back:hover { color: var(--text-primary); }
.cl-back__short { display: none; }

@media (max-width: 480px) {
  .cl-brand__page,
  .cl-brand__sep { display: none; }
  .cl-back__label { display: none; }
  .cl-back__short { display: inline; }
}

/* Version eyebrow above the title; hidden until the changelog has loaded. */
.cl-eyebrow {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.cl-eyebrow:has(> .cl-eyebrow__version:empty) { display: none; }

.cl-eyebrow__label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cl-eyebrow__version {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* --- Page frame ----------------------------------------------------------- */

.cl-main {
  padding-top: 40px;
  padding-bottom: 64px;
}

.cl-intro {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-secondary);
}

.cl-title {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cl-lede {
  margin: 0;
  max-width: 62ch;
  color: var(--text-secondary);
  font-size: 14px;
}

/* Reading measure: the release stream never runs wider than a comfortable line. */
.cl-stream {
  max-width: 72ch;
}

.cl-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding-top: 28px;
}

/* --- Version index -------------------------------------------------------- */

.cl-aside__title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.cl-index-nav {
  display: none;
}

.cl-select {
  display: block;
}

.cl-select__label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.cl-select select {
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border-primary);
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
}

.cl-index {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border-secondary);
}

.cl-index__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease;
}

.cl-index__link:hover {
  color: var(--text-primary);
  border-left-color: var(--border-accent);
}

.cl-index__version {
  font-family: var(--font-mono);
  font-size: 13px;
}

.cl-index__date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

/* --- Release timeline ----------------------------------------------------- */

.cl-state {
  margin: 0 0 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.cl-state--error {
  color: var(--text-error);
}

.cl-releases {
  display: flex;
  flex-direction: column;
}

.cl-release {
  padding: 0 0 32px 20px;
  border-left: 1px solid var(--border-secondary);
  position: relative;
}

.cl-release::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-primary);
}

.cl-release:first-child::before {
  background: var(--text-accent);
}

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

.cl-release__head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  scroll-margin-top: 80px;
}

.cl-release__version {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cl-release__date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
}

.cl-release__summary {
  margin: 10px 0 0;
  max-width: 68ch;
  color: var(--text-secondary);
  font-size: 14px;
}

.cl-release__empty {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.cl-group {
  margin-top: 22px;
}

.cl-group__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.cl-group__label--added,
.cl-group__label--fixed,
.cl-group__label--security {
  color: var(--text-accent);
}

.cl-group__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cl-entry {
  position: relative;
  max-width: 72ch;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-secondary);
}

.cl-entry::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  width: 5px;
  height: 1px;
  background: var(--border-primary);
}

.cl-strong {
  font-weight: 600;
  color: var(--text-primary);
}

.cl-code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 1px 5px;
  border: 1px solid var(--border-secondary);
  border-radius: 3px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  word-break: break-word;
}

.cl-link {
  color: var(--text-accent);
  text-decoration: none;
  border-bottom: 1px solid var(--border-accent);
}

.cl-link:hover {
  border-bottom-color: var(--text-accent);
}

/* --- Footer --------------------------------------------------------------- */

.cl-footer {
  border-top: 1px solid var(--border-secondary);
}

.cl-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 24px;
  padding-bottom: 40px;
  color: var(--text-secondary);
  font-size: 13px;
}

.cl-footer p {
  margin: 0;
}

/* --- Focus ---------------------------------------------------------------- */

a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 2px;
}

/* --- Desktop -------------------------------------------------------------- */

@media (min-width: 900px) {
  .cl-layout {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 48px;
  }

  .cl-aside {
    order: 2;
    position: sticky;
    top: 84px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
  }

  .cl-stream {
    order: 1;
  }

  .cl-select {
    display: none;
  }

  .cl-index-nav {
    display: block;
  }

  .cl-main {
    padding-top: 56px;
  }

  .cl-title {
    font-size: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0ms !important;
  }
}
