/* ------------------------------------------------------------------
   /changelog — daily timeline of shipped changes, a month per page

   Self-contained, `cl-` prefixed. Brand variables come from styles.css,
   loaded globally by root.tsx; the hero classes come from
   feature-page.css, which the route loads alongside this file.

   The card is the guides-index accent-stripe card, with one deliberate
   difference: here the stripe colour encodes the CHANGE TYPE (new /
   improved / fixed / performance), matching the pill on the card, so a
   scanning reader can pick out "the new stuff" by colour alone.
   ------------------------------------------------------------------ */

/* ---------- change-type colours ----------
   One custom property per card, set by data-type, consumed by both the
   stripe and the pill. New owns the brand green, Improved the purple,
   Performance the brand teal; Fixed stays deliberately neutral grey —
   fixes are housekeeping, not headlines. Yellow is reserved for the
   "since your last visit" marker so that signal is unmistakable. */

.cl-entry[data-type="new"],
.cl-entry-row[data-type="new"],
.cl-pill[data-type="new"],
.cl-filter-pill[data-type="new"] {
  --cl-type: var(--green);
  --cl-type-tint: rgba(162, 185, 100, 0.22);
  --cl-type-text: #5a6b23;
}

.cl-entry[data-type="improved"],
.cl-entry-row[data-type="improved"],
.cl-pill[data-type="improved"],
.cl-filter-pill[data-type="improved"] {
  --cl-type: var(--purple);
  --cl-type-tint: rgba(181, 164, 203, 0.28);
  --cl-type-text: #5d4b78;
}

.cl-entry[data-type="fixed"],
.cl-entry-row[data-type="fixed"],
.cl-pill[data-type="fixed"],
.cl-filter-pill[data-type="fixed"] {
  --cl-type: rgba(108, 117, 125, 0.45);
  --cl-type-tint: rgba(108, 117, 125, 0.14);
  --cl-type-text: #565e64;
}

.cl-entry[data-type="performance"],
.cl-entry-row[data-type="performance"],
.cl-pill[data-type="performance"],
.cl-filter-pill[data-type="performance"] {
  /* A lighter, more saturated step off --primary. --primary itself is
     too close in value to the --gray used for Fixed to read as its own
     colour at pill/stripe scale — this keeps the teal family without
     the two badges collapsing into each other. */
  --cl-type: #2f7a90;
  --cl-type-tint: rgba(47, 122, 144, 0.22);
  --cl-type-text: #1f5866;
}

/* ---------- hero addition ---------- */

/* The "since your last visit" line only exists after hydration for a
   returning visitor, so it must not shift the hero when it appears in
   a jarring way — it slots in under the intro as a compact chip. */
.cl-new-since {
  display: inline-block;
  margin: 18px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(245, 204, 75, 0.4);
  color: #7a5c00;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------- page body ---------- */

.cl-body {
  padding: 48px 0 80px;
}

/* ---------- filters ---------- */

.cl-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: 10px;
  /* Sticks just below the fixed site header so the filters stay to hand
     on a page that is mostly scrolling. */
  position: sticky;
  top: 84px;
  z-index: 5;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid rgba(47, 72, 80, 0.1);
}

.cl-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cl-filter-pill {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(47, 72, 80, 0.75);
  background: white;
  border: 1px solid rgba(47, 72, 80, 0.18);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cl-filter-pill:hover {
  border-color: rgba(47, 72, 80, 0.4);
}

.cl-filter-pill[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* A pressed type pill keeps a sliver of its own colour so the active
   filter still says which type it is. */
.cl-filter-pill[data-type][aria-pressed="true"] {
  box-shadow: inset 0 -3px 0 var(--cl-type);
}

.cl-filter-count {
  font-weight: 400;
  opacity: 0.65;
  margin-left: 2px;
}

.cl-filter-selects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.cl-filter-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(47, 72, 80, 0.6);
}

.cl-filter-select select {
  font: inherit;
  font-size: 0.88rem;
  color: var(--primary);
  background: white;
  border: 1px solid rgba(47, 72, 80, 0.18);
  border-radius: 8px;
  padding: 6px 10px;
  max-width: 200px;
}

.cl-filter-reset {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px;
}

/* Pinned to the far end of the filter row, same weight as Reset filters
   but never conditional — the feed exists whether or not you're filtering. */
.cl-rss-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(47, 72, 80, 0.6);
  text-decoration: none;
  padding: 4px;
}

.cl-rss-link:hover,
.cl-rss-link:focus-visible {
  color: var(--primary);
}

.cl-results {
  margin: 0 0 20px;
  font-size: 0.88rem;
  color: rgba(47, 72, 80, 0.55);
}

/* ---------- empty state ---------- */

.cl-empty {
  margin-top: 48px;
  padding: 40px;
  text-align: center;
  border-radius: 12px;
  background: rgba(47, 72, 80, 0.04);
  color: rgba(47, 72, 80, 0.75);
}

.cl-empty p {
  margin: 0 0 12px;
}

/* ---------- feedback line ---------- */

.cl-feedback {
  margin: 0 0 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(47, 72, 80, 0.7);
}

.cl-feedback a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cl-feedback a:hover {
  text-decoration-thickness: 2px;
}

/* ---------- month rail ----------
   Every month that shipped something, linked from every changelog page,
   so one month is always one click from another (and one crawl step
   from another). One row per year; the count sits in the chip so the
   rail also reads as a shape-of-the-year summary. */

.cl-months {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px 28px;
  padding: 16px 18px;
  margin-bottom: 24px;
  border-radius: 12px;
  background: rgba(47, 72, 80, 0.04);
  border: 1px solid rgba(47, 72, 80, 0.08);
}

.cl-months-rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.cl-months-year {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.cl-months-year-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(47, 72, 80, 0.45);
}

.cl-months-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.cl-month-link {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  background: white;
  border: 1px solid rgba(47, 72, 80, 0.16);
  border-radius: 999px;
  padding: 5px 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.cl-month-link:hover,
.cl-month-link:focus-visible {
  border-color: rgba(47, 72, 80, 0.45);
}

.cl-month-link[aria-current="page"] {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.cl-month-link-count {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.6;
}

/* The same navigation as a jump menu — a select is quicker than a rail
   once there are years of archive, and it is what the page had before. */
.cl-months-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(47, 72, 80, 0.6);
}

.cl-months-select select {
  font: inherit;
  font-size: 0.88rem;
  color: var(--primary);
  background: white;
  border: 1px solid rgba(47, 72, 80, 0.18);
  border-radius: 8px;
  padding: 6px 10px;
}

/* ---------- month heading ---------- */

/* ---------- month pager ---------- */

.cl-month-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(47, 72, 80, 0.12);
}

.cl-month-pager-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.cl-month-pager-next {
  text-align: right;
}

.cl-month-pager-link span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(47, 72, 80, 0.45);
}

.cl-month-pager-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- daily timeline ----------
   One continuous spine down the month, with a large node at each day
   and a small one at each change. The two sizes are the point: a day
   that shipped nine things looks different from one that shipped one,
   before a word has been read. The small node takes the change type's
   colour, so it agrees with the card's stripe beside it. */

.cl-days {
  list-style: none;
  margin: 28px 0 0;
  padding: 0 0 0 30px;
  border-left: 2px solid rgba(47, 72, 80, 0.12);
  display: flex;
  flex-direction: column;
  gap: 38px;
}

.cl-day {
  position: relative;
  /* An anchor jump must clear the sticky header and filter bar. */
  scroll-margin-top: 170px;
}

.cl-day-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

/* Ringed in the page ground so the spine appears to pass behind it. */
.cl-day-head::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 0.3em;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--bg);
}

.cl-day-title {
  font-size: 1.02rem;
  line-height: 1.35;
  color: var(--primary);
  margin: 0;
}

/* Permalinks: a small link icon after each day heading, for copying a
   direct link to one day's changes. Low-opacity by default rather than
   hover-revealed, so it's discoverable on touch devices too, not just
   with a mouse. The icon is Lucide's Link2 and inherits its stroke
   colour from `color` via currentColor. */
.cl-permalink {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: rgba(47, 72, 80, 0.35);
  vertical-align: -1px;
}

.cl-permalink:hover,
.cl-permalink:focus-visible {
  color: var(--primary);
}

.cl-day-count {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(47, 72, 80, 0.4);
}

.cl-day-entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cl-entry-row {
  position: relative;
}

.cl-entry-row::before {
  content: "";
  position: absolute;
  left: -34px;
  /* Centred on the card rather than pinned to a line inside it, so a
     one-line entry and a three-line one both look anchored. */
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cl-type);
  box-shadow: 0 0 0 3px var(--bg);
}

/* A marker pushes its card down the page; the node would otherwise sit
   against the marker instead of the card it belongs to. */
.cl-entry-row:has(.cl-visit-marker)::before {
  display: none;
}

/* ---------- entry cards ---------- */

/* Same DNA as .gd-card: square left edge so the 4px stripe stays a
   clean vertical bar, rounded on the right. */
.cl-entry {
  display: block;
  padding: 18px 22px;
  border-radius: 0 12px 12px 0;
  background: white;
  border: 1px solid rgba(47, 72, 80, 0.13);
  border-left: 4px solid var(--cl-type);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  /* Anchor jumps from the ItemList structured data must clear the
     sticky header and filter bar. */
  scroll-margin-top: 170px;
}

.cl-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(47, 72, 80, 0.1);
}

.cl-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.78rem;
}

.cl-pill {
  display: inline-block;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--cl-type-tint);
  color: var(--cl-type-text);
}

.cl-area {
  color: rgba(47, 72, 80, 0.55);
  font-weight: 600;
  text-decoration: none;
}

a.cl-area:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cl-entry-title {
  font-size: 1.08rem;
  line-height: 1.35;
  color: var(--primary);
  margin: 0 0 6px;
}

.cl-entry-summary {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: rgba(47, 72, 80, 0.68);
}

/* Marquee releases: tinted ground and a larger title, mirroring the
   featured treatment on the guides index. */
.cl-entry-highlight {
  background: rgba(162, 185, 100, 0.06);
  padding: 24px 26px;
}

.cl-entry-highlight .cl-entry-title {
  font-size: 1.3rem;
}

/* ---------- "you were here" marker ----------
   The one loud element on the page: a dashed rule with a yellow chip,
   inserted where the visitor's last visit ends. Everything above it is
   new to them. */

.cl-visit-marker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 24px;
}

.cl-visit-marker::before,
.cl-visit-marker::after {
  content: "";
  flex: 1;
  border-top: 2px dashed rgba(47, 72, 80, 0.3);
}

.cl-visit-marker span {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a5c00;
  background: rgba(245, 204, 75, 0.4);
  border-radius: 999px;
  padding: 5px 14px;
}

/* ---------- focus & motion ---------- */

.cl-filter-pill:focus-visible,
.cl-filter-reset:focus-visible,
.cl-filter-select select:focus-visible,
.cl-months-select select:focus-visible,
a.cl-area:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .cl-entry,
  .cl-filter-pill {
    transition: none;
  }

  .cl-entry:hover {
    transform: none;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  /* The spine costs more width than a phone has. */
  .cl-days {
    padding-left: 0;
    border-left: none;
    gap: 32px;
  }

  .cl-day-head::before,
  .cl-entry-row::before {
    display: none;
  }

  /* The rail becomes a single scrolling row; the jump menu is the
     primary control at this width. */
  .cl-months {
    flex-direction: column;
    align-items: stretch;
  }

  .cl-months-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  /* The card keeps its square left edge at every width. The 4px stripe
     is a colour bar, and a colour bar is never rounded on this site —
     dropping the spine doesn't change that. */

  .cl-filters {
    position: static;
    background: white;
  }

}
