/* ──────────────────────────────────────────────────────────────────────────
   _changes.css — additive styles for Plain AI's "What changed" wing.

   Reuses the existing tokens (--bg, --ivory, --hairline, --accent, --grad-*)
   and chrome classes (.masthead, .breadcrumb, .entry-hero, .entry-aside,
   .article-layout, .connected). Only adds .ch-* classes for new components.

   Mirrors the Museum register: dark-default, gradient highlights, hairlines,
   caps-mono labels.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Index page — masthead-adjacent intro ──────────────────────────────── */
.ch-index-intro {
  margin-top: 0.75rem;
  margin-bottom: 2.5rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ivory-soft);
  max-width: 56ch;
}

/* ── Filter bar (vendor + category) ────────────────────────────────────── */
.ch-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 2rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 0.5rem;
  background: var(--bg-elev);
  align-items: center;
}

.ch-filter-bar .ch-filter-label {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.5rem;
}

.ch-filter-chip {
  appearance: none;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--ivory-soft);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}

.ch-filter-chip:hover { border-color: var(--accent); color: var(--ivory); }
.ch-filter-chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent-deep);
  background: var(--accent-bg);
}

/* ── Timeline groupings ────────────────────────────────────────────────── */
.ch-timeline { margin: 0; padding: 0; list-style: none; }

.ch-month-group { margin-bottom: 3rem; }

.ch-month-header {
  display: flex;
  align-items: baseline;
  gap: 0.875rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--hairline-soft);
}

.ch-month-header h2 {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.ch-month-header .ch-month-count {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted-soft);
}

/* ── Entry card (in timeline) ──────────────────────────────────────────── */
.ch-month-list { margin: 0; padding: 0; list-style: none; }

.ch-entry-card {
  display: block;
  position: relative;
  padding: 1.125rem 1.25rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: 0.5rem;
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms, background 140ms, transform 140ms;
}

.ch-entry-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.ch-entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
  margin-bottom: 0.4rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ch-entry-meta .ch-date { color: var(--ivory-soft); font-weight: 500; }
.ch-entry-meta .ch-vendor { color: var(--accent-deep); font-weight: 500; }
.ch-entry-meta .ch-category { color: var(--muted); }

.ch-entry-card h3 {
  margin: 0.125rem 0 0.5rem;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ivory);
  line-height: 1.3;
}

.ch-entry-summary {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ivory-soft);
}

.ch-entry-summary strong { color: var(--ivory); font-weight: 600; }

.ch-recused-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  padding: 0.15rem 0.55rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
  background: transparent;
}

/* ── Entry page sections ───────────────────────────────────────────────── */
.ch-entry-headline {
  margin: 1rem 0 2rem;
  padding: 1rem 1.25rem;
  border-left: 3px solid;
  border-image: linear-gradient(180deg, var(--grad-a), var(--grad-b), var(--grad-c)) 1;
  background: var(--bg-elev);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ivory-soft);
}

.ch-entry-headline strong { color: var(--ivory); font-weight: 600; }

.ch-block {
  margin: 0 0 1.75rem;
  padding: 1.25rem 1.375rem;
  border: 1px solid var(--hairline);
  border-radius: 0.5rem;
  background: var(--bg-card);
}

.ch-block h2 {
  margin: 0 0 0.75rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.ch-block ul { margin: 0; padding-left: 1.25rem; }
.ch-block li { margin-bottom: 0.5rem; line-height: 1.55; color: var(--ivory-soft); }
.ch-block li:last-child { margin-bottom: 0; }
.ch-block li strong { color: var(--ivory); font-weight: 600; }
.ch-block p { margin: 0 0 0.5rem; line-height: 1.6; color: var(--ivory-soft); }
.ch-block p:last-child { margin-bottom: 0; }

/* Tone marker for the honest take — gradient hairline at top */
.ch-block.ch-block-take {
  border-top: 2px solid;
  border-image: linear-gradient(90deg, var(--grad-a), var(--grad-b), var(--grad-c)) 1;
}

/* ── Recused notice ────────────────────────────────────────────────────── */
.ch-recused-notice {
  margin: 0 0 1.75rem;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--hairline);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.ch-recused-notice strong { color: var(--ivory-soft); font-weight: 600; }

/* ── Sources list ──────────────────────────────────────────────────────── */
.ch-sources { margin-top: 2rem; }

.ch-sources h2 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.ch-sources ul { list-style: none; margin: 0; padding: 0; }

.ch-sources li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 0.9375rem;
}

.ch-sources li:last-child { border-bottom: 0; }

.ch-sources a { color: var(--ivory-soft); text-decoration: underline; text-underline-offset: 3px; }
.ch-sources a:hover { color: var(--accent-deep); }

.ch-source-type {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  flex-shrink: 0;
}

/* ── Verified footer ───────────────────────────────────────────────────── */
.ch-verified {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline-soft);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted-soft);
  letter-spacing: 0.04em;
}

.ch-verified a { color: var(--muted); text-decoration: underline; }
.ch-verified a:hover { color: var(--ivory-soft); }

/* ── Empty filter state ────────────────────────────────────────────────── */
.ch-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--hairline);
  border-radius: 0.5rem;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .ch-entry-card { padding: 1rem; }
  .ch-entry-card h3 { font-size: 1.125rem; }
  .ch-block { padding: 1rem 1.125rem; }
  .ch-filter-bar { padding: 0.75rem; }
  .ch-recused-badge { display: none; } /* keep card meta clean on mobile */
}

/* ── Light theme tweaks ────────────────────────────────────────────────── */
:root[data-theme="light"] .ch-entry-headline {
  background: rgba(255, 255, 255, 0.8);
}

:root[data-theme="light"] .ch-recused-notice {
  background: rgba(255, 255, 255, 0.6);
}

/* ──────────────────────────────────────────────────────────────────────────
   v2 (5 May 2026 18:03) — voice + presentation polish
   - Category coloured dots
   - Recused entries visually de-emphasised in timeline
   - Pinned (era-defining) star
   - Mobile-collapsible filter bar
   - Depth-on-demand details (matches Plain AI topic-page rhythm)
   - "What's next" rail at end of entry
   ────────────────────────────────────────────────────────────────────────── */

/* Category dot — small coloured circle prefix in entry meta */
.ch-cat-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: 0.06em;
  flex-shrink: 0;
}

/* Recused timeline card — dashed border + transparent bg signal "no editorial
   take here, just a link". (Was opacity 0.78 which dropped inner-text contrast
   below WCAG AA — removed 6 May 2026; the dashed border + recused badge already
   communicate the de-emphasis.) */
.ch-entry-card[data-recused="true"] {
  border-style: dashed;
  border-color: var(--hairline-soft);
  background: transparent;
}
.ch-entry-card[data-recused="true"]:hover {
  border-style: dashed;
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

/* Pinned (era-defining) — small star badge in the meta row */
.ch-pinned-star {
  color: var(--grad-c);
  margin-right: 0.4rem;
  font-size: 0.875rem;
  line-height: 1;
}

.ch-pinned-tag {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grad-c);
  margin-left: 0.25rem;
}

/* Reading-time tag in the entry kicker */
.ch-readtime {
  color: var(--muted-soft);
  margin-left: 0.5rem;
}

/* Mobile-collapsible filter bar — wraps the chips in a <details> on narrow screens */
.ch-filter-wrap > summary {
  cursor: pointer;
  display: none;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.625rem 0;
  list-style: none;
}
.ch-filter-wrap > summary::-webkit-details-marker { display: none; }
.ch-filter-wrap > summary::after {
  content: " ▾";
  color: var(--muted-soft);
}
.ch-filter-wrap[open] > summary::after { content: " ▴"; }

@media (max-width: 600px) {
  .ch-filter-wrap > summary { display: block; }
  .ch-filter-wrap:not([open]) .ch-filter-bar { display: none; }
  .ch-filter-bar { margin-top: 0.5rem; }
}

/* Depth-on-demand <details> blocks — matches Plain AI's existing .deeper pattern */
.ch-deeper { margin: 1.75rem 0 0; }

.ch-deeper > details {
  border: 1px solid var(--hairline);
  border-radius: 0.5rem;
  background: var(--bg-card);
  margin-bottom: 0.625rem;
  overflow: hidden;
}

.ch-deeper > details > summary {
  cursor: pointer;
  padding: 0.875rem 1.125rem;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ivory);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ch-deeper > details > summary::-webkit-details-marker { display: none; }
.ch-deeper > details > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1;
}
.ch-deeper > details[open] > summary::after { content: "−"; }

.ch-deeper > details:hover > summary { color: var(--accent-deep); }

.ch-deeper > details > summary .meta {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-soft);
}

.ch-deeper > details > div {
  padding: 0 1.125rem 1.125rem;
  color: var(--ivory-soft);
  line-height: 1.6;
}

.ch-deeper > details > div ul { margin: 0; padding-left: 1.25rem; }
.ch-deeper > details > div li { margin-bottom: 0.5rem; }
.ch-deeper > details > div li:last-child { margin-bottom: 0; }
.ch-deeper > details > div p { margin: 0 0 0.5rem; }
.ch-deeper > details > div p:last-child { margin-bottom: 0; }
.ch-deeper > details > div strong { color: var(--ivory); font-weight: 600; }

/* Honest-take details — subtle gradient tint to mark editorial voice */
.ch-deeper > details.ch-take-detail > summary {
  background: linear-gradient(90deg, rgba(103, 232, 249, 0.04), rgba(167, 139, 250, 0.04), rgba(244, 114, 182, 0.04));
}

/* "What's next" rail at end of entry */
.ch-next-rail {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline-soft);
}

.ch-next-rail h2 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.875rem;
}

.ch-next-rail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.625rem;
}

.ch-next-rail li a {
  display: block;
  padding: 0.875rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 0.5rem;
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms, background 140ms;
}

.ch-next-rail li a:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.ch-next-rail .ch-next-meta {
  display: flex;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.ch-next-rail .ch-next-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ivory);
  line-height: 1.35;
}

/* ──────────────────────────────────────────────────────────────────────────
   v3 (5 May 2026 18:21) — Phase 2 integration
   - Homepage "Latest changes" strip
   - Topic-page "Recent updates affecting this topic" back-links
   ────────────────────────────────────────────────────────────────────────── */

/* Homepage strip — slots between Reading paths and Category sections. */
.latest-changes-strip {
  margin: 3rem 0;
  padding: 0;
}

.latest-changes-strip .strip-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.875rem;
  margin: 0 0 1.25rem;
}

.latest-changes-strip h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--display);
  color: var(--ivory);
}

.latest-changes-strip .strip-strap {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

.latest-changes-strip .strip-see-all {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-deep);
  text-decoration: none;
  border: 1px solid var(--hairline);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 140ms, color 140ms;
}
.latest-changes-strip .strip-see-all:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.latest-changes-strip .strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.latest-changes-strip .strip-grid li a {
  display: block;
  padding: 1rem 1.125rem;
  border: 1px solid var(--hairline);
  border-radius: 0.5rem;
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms, background 140ms, transform 140ms;
}

.latest-changes-strip .strip-grid li a:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.latest-changes-strip .strip-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.latest-changes-strip .strip-meta .ch-date { color: var(--ivory-soft); font-weight: 500; }
.latest-changes-strip .strip-meta .ch-vendor { color: var(--accent-deep); font-weight: 500; }
.latest-changes-strip .strip-meta .ch-pinned-star { font-size: 0.75rem; }

.latest-changes-strip .strip-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ivory);
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.latest-changes-strip .strip-summary {
  font-size: 0.875rem;
  color: var(--ivory-soft);
  line-height: 1.5;
  margin: 0;
}

.latest-changes-strip .strip-summary strong { color: var(--ivory); font-weight: 600; }

/* Topic-page "Recent updates affecting this topic" — slots after Connected. */
.topic-recent-changes {
  margin: 2rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--hairline-soft);
}

.topic-recent-changes h2 {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.875rem;
}

.topic-recent-changes ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.topic-recent-changes li a {
  display: block;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--hairline);
  border-radius: 0.5rem;
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 140ms, background 140ms;
}

.topic-recent-changes li a:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.topic-recent-changes .topic-change-meta {
  display: flex;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.topic-recent-changes .topic-change-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ivory);
  line-height: 1.4;
}

/* "↓ Newest first" sort indicator above the timeline */
.ch-sort-indicator {
  margin: 0.5rem 0 1.25rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
