/* Page-specific tweaks */
.cb-section { padding: 24px 0 8px; }
.cb-section h2 { margin-top: 0; }
.cb-section > p { max-width: 70ch; }
.cb-discussion { margin-top: var(--cb-size-160); }
.cb-discussion__mount {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.cb-discussion .giscus,
.cb-discussion .giscus-frame {
  display: block;
  width: 100%;
  max-width: 100%;
}

.cb-eyebrow {
  display: inline-block;
  font-family: var(--cb-font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cb-accent);
  margin-bottom: 6px;
}

:target { scroll-margin-top: 96px; }
h2[id], h3[id] { scroll-margin-top: 96px; }

/* ---------- Tables ---------- */
.cb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  margin: 1.2rem 0 1.5rem;
  border: 1px solid var(--cb-rule);
  border-radius: var(--cb-radius-xl);
  overflow: hidden;
  background: color-mix(in srgb, var(--cb-surface) 60%, transparent);
}
.cb-table thead {
  background: color-mix(in srgb, var(--cb-ink) 5%, transparent);
  border-bottom: 1px solid var(--cb-rule);
}
.cb-table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: var(--cb-font-size-caption);
  line-height: var(--cb-line-height-caption);
  letter-spacing: 0;
  text-transform: none;
  color: var(--cb-ink-soft);
  white-space: nowrap;
}
.cb-table td {
  padding: 14px 16px;
  color: var(--cb-ink-soft);
  vertical-align: top;
  border-bottom: 1px solid var(--cb-rule);
  line-height: 1.6;
}
.cb-table tbody tr:last-child td {
  border-bottom: none;
}
.cb-table tbody tr:hover {
  background: color-mix(in srgb, var(--cb-accent) 4%, transparent);
}

/* Inline code inside scenario cells — softer */
.cb-table td code {
  font-size: 0.88em;
  background: color-mix(in srgb, var(--cb-ink) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--cb-ink) 10%, transparent);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--cb-ink);
}

/* Package links styled as clean accent tags */
.cb-table td a {
  display: inline-block;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.cb-table td a:hover {
  text-decoration: underline;
}
.cb-table td a code {
  display: inline-block;
  background: color-mix(in srgb, var(--cb-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cb-accent) 25%, transparent);
  color: var(--cb-accent);
  padding: 3px 8px;
  border-radius: var(--cb-radius);
  font-size: 0.85em;
}

/* Decision table: give package column more room */
.cb-table.cb-table--decision th:first-child,
.cb-table.cb-table--decision td:first-child {
  width: 60%;
}
.cb-table.cb-table--decision th:last-child,
.cb-table.cb-table--decision td:last-child {
  width: 40%;
  text-align: right;
}

/* ---------- Markdown prose wrapper ---------- */
/* Applied to family overview pages that render content from .md files via MarkdownRenderer. */
.cb-prose { padding-bottom: 8px; }
.cb-prose h2 { margin-top: 2rem; margin-bottom: 0.5rem; }
.cb-prose h3 { margin-top: 1.25rem; margin-bottom: 0.35rem; font-size: 1rem; }
.cb-prose > h1:first-child,
.cb-prose > h2:first-child { margin-top: 0; }
.cb-prose p { max-width: 70ch; margin: 0.6rem 0; }
.cb-prose ul { max-width: 70ch; padding-left: 1.4rem; margin: 0.5rem 0 1rem; }
.cb-prose li { margin-bottom: 0.35rem; line-height: 1.65; }

.cb-prose .markdown-alert {
  --markdown-alert-accent: var(--cb-alert-note);
  margin: 1rem 0 1.35rem;
  padding: 1rem 1rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--markdown-alert-accent) 24%, var(--cb-rule));
  border-radius: var(--cb-radius-xl);
  background: color-mix(in srgb, var(--markdown-alert-accent) 12%, var(--cb-bg-soft));
}

.cb-prose .markdown-alert > :first-child { margin-top: 0; }
.cb-prose .markdown-alert > :last-child { margin-bottom: 0; }

.cb-prose .markdown-alert-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.75rem;
  max-width: none;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--markdown-alert-accent);
}

.cb-prose .markdown-alert-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
}

.cb-prose .markdown-alert-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.cb-prose .markdown-alert-note { --markdown-alert-accent: var(--cb-alert-note); }
.cb-prose .markdown-alert-tip { --markdown-alert-accent: var(--cb-alert-tip); }
.cb-prose .markdown-alert-important { --markdown-alert-accent: var(--cb-alert-important); }
.cb-prose .markdown-alert-warning { --markdown-alert-accent: var(--cb-alert-warning); }
.cb-prose .markdown-alert-caution { --markdown-alert-accent: var(--cb-alert-caution); }

/* Code blocks */
.cb-prose pre {
  border: 1px solid var(--cb-rule);
  border-radius: var(--cb-radius-xl);
  padding: 2px 2px;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  line-height: 1.6;
}
.cb-prose pre code {
  font-family: var(--cb-font-mono);
  font-size: 0.85rem;
  color: var(--cb-code-ink);
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}
.cb-prose .cb-code pre {
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0;
}
.cb-prose .cb-code pre code {
  display: block;
}

/* Tables: mirror .cb-table and .cb-table--decision */
.cb-prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
  margin: 1.2rem 0 1.5rem;
  border: 1px solid var(--cb-rule);
  border-radius: var(--cb-radius-xl);
  overflow: hidden;
}
.cb-prose table thead {
  background: color-mix(in srgb, var(--cb-ink) 5%, transparent);
  border-bottom: 1px solid var(--cb-rule);
}
.cb-prose table th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  font-size: var(--cb-font-size-caption);
  line-height: var(--cb-line-height-caption);
  letter-spacing: 0;
  text-transform: none;
  color: var(--cb-ink-soft);
  white-space: nowrap;
}
.cb-prose table td {
  padding: 14px 16px;
  color: var(--cb-ink-soft);
  vertical-align: top;
  border-bottom: 1px solid var(--cb-rule);
  line-height: 1.6;
}
.cb-prose table tbody tr:last-child td { border-bottom: none; }
.cb-prose table tbody tr:hover { background: color-mix(in srgb, var(--cb-accent) 4%, transparent); }
.cb-prose table td code {
  font-size: 0.88em;
  background: color-mix(in srgb, var(--cb-ink) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--cb-ink) 10%, transparent);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--cb-ink);
}
.cb-prose table td a { display: inline-block; text-decoration: none; font-weight: 500; white-space: nowrap; }
.cb-prose table td a:hover { text-decoration: underline; }
.cb-prose table td a code {
  display: inline-block;
  background: color-mix(in srgb, var(--cb-accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--cb-accent) 25%, transparent);
  color: var(--cb-accent);
  padding: 3px 8px;
  border-radius: var(--cb-radius);
  font-size: 0.85em;
}
/* First column = scenario (wider), second column = package name (right-aligned) */
.cb-prose table th:first-child,
.cb-prose table td:first-child { width: 60%; }
.cb-prose table th:last-child,
.cb-prose table td:last-child { width: 40%; text-align: right; }

/* ---------- Evidence timelines ---------- */
/*
   A Timeline heading followed by one lead paragraph and an ordered list is rendered as a
   semantic vertical timeline. The first paragraph in each item is the sticky release marker;
   the remaining paragraphs stay in normal reading order as the evidence record.
*/
.cb-prose h2#timeline + p + ol {
  --cb-timeline-meta-width: 11rem;
  --cb-timeline-marker-width: 1.5rem;
  position: relative;
  max-width: none;
  margin: 1.5rem 0 2rem;
  padding: 1rem 0 0;
  list-style: none;
}
.cb-prose h2#timeline + p + ol::before {
  content: "";
  position: absolute;
  top: 1.7rem;
  bottom: 2.6rem;
  left: calc(var(--cb-timeline-meta-width) + 1rem + 0.75rem - 0.5px);
  width: 1px;
  background: var(--cb-rule);
}
.cb-prose h2#timeline + p + ol > li {
  position: relative;
  display: grid;
  grid-template-columns: var(--cb-timeline-meta-width) var(--cb-timeline-marker-width) minmax(0, 1fr);
  column-gap: 1rem;
  padding: 0 0 3.5rem;
}
.cb-prose h2#timeline + p + ol > li:last-child { padding-bottom: 0.5rem; }
.cb-prose h2#timeline + p + ol > li::before {
  content: "";
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  justify-self: center;
  width: 0.75rem;
  height: 0.75rem;
  margin-top: 0.25rem;
  border: 3px solid var(--cb-bg);
  outline: 1px solid var(--cb-rule);
  border-radius: 50%;
  background: var(--cb-accent);
  z-index: 1;
}
.cb-prose h2#timeline + p + ol > li:hover::before {
  background: var(--cb-ink);
}
.cb-prose h2#timeline + p + ol > li > p {
  max-width: none;
}
.cb-prose h2#timeline + p + ol > li > p:first-child {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 7rem;
  align-self: start;
  margin: 0;
  padding-top: 0.05rem;
  text-align: right;
  color: var(--cb-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.cb-prose h2#timeline + p + ol > li > p:first-child > strong:first-child > a {
  display: inline;
  max-width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--cb-ink);
  font-family: var(--cb-font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  text-underline-offset: 0.18em;
  white-space: nowrap;
}
.cb-prose h2#timeline + p + ol > li > p:first-child > strong:first-child > a > code {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
}
.cb-prose h2#timeline + p + ol > li > p:first-child > strong:first-child > a:hover,
.cb-prose h2#timeline + p + ol > li > p:first-child > strong:first-child > a:focus-visible {
  color: var(--cb-accent);
  text-decoration: underline;
}
.cb-prose h2#timeline + p + ol > li > p:first-child > code {
  display: block;
  margin-top: 0.45rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cb-muted);
  font-size: 0.8rem;
}
.cb-prose h2#timeline + p + ol > li > p:nth-child(2) {
  grid-column: 3;
  grid-row: 1;
  margin: 0 0 0.65rem;
  color: var(--cb-ink);
  font-size: 1.1rem;
  line-height: 1.35;
}
.cb-prose h2#timeline + p + ol > li > p:nth-child(n + 3) {
  grid-column: 3;
  margin: 0.65rem 0;
  color: var(--cb-ink-soft);
  line-height: 1.65;
}
.cb-prose h2#timeline + p + ol > li > ul {
  grid-column: 3;
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  color: var(--cb-ink-soft);
  line-height: 1.5;
  list-style: disc;
}
.cb-prose h2#timeline + p + ol > li > ul > li {
  display: list-item;
  margin: 0.25rem 0;
  padding-left: 0.15rem;
}
.cb-prose h2#timeline + p + ol > li > ul > li::marker {
  color: var(--cb-accent);
  font-size: 0.8em;
}
.cb-prose h2#timeline + p + ol > li > p:last-child { margin-bottom: 0; }
.cb-prose h2#timeline + p + ol > li > p a,
.cb-prose h2#timeline + p + ol > li > ul a {
  white-space: normal;
  text-underline-offset: 0.18em;
}

@media (max-width: 760px) {
  .cb-prose h2#timeline + p + ol {
    --cb-timeline-marker-width: 1.5rem;
    margin-top: 1.25rem;
    padding-left: 0;
  }
  .cb-prose h2#timeline + p + ol::before {
    left: 0.75rem;
  }
  .cb-prose h2#timeline + p + ol > li {
    grid-template-columns: var(--cb-timeline-marker-width) minmax(0, 1fr);
    column-gap: 1rem;
    padding-bottom: 2.75rem;
  }
  .cb-prose h2#timeline + p + ol > li::before {
    grid-column: 1;
  }
  .cb-prose h2#timeline + p + ol > li > p:first-child {
    grid-column: 2;
    grid-row: 1;
    position: static;
    padding-top: 0;
    text-align: left;
  }
  .cb-prose h2#timeline + p + ol > li > p:nth-child(2) {
    grid-column: 2;
    grid-row: 2;
  }
  .cb-prose h2#timeline + p + ol > li > p:nth-child(n + 3) {
    grid-column: 2;
  }
  .cb-prose h2#timeline + p + ol > li > ul {
    grid-column: 2;
  }
}

/* ---------- 404 theme-aware illustration ---------- */
.cb-404-figure {
  position: relative;
  display: flex;
  justify-content: center;
}
.cb-404-figure::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: radial-gradient(
    ellipse 82% 78% at 50% 50%,
    transparent 55%,
    color-mix(in srgb, var(--cb-bg) 30%, transparent) 72%,
    color-mix(in srgb, var(--cb-bg) 70%, transparent) 86%,
    var(--cb-bg) 98%
  );
  pointer-events: none;
}
.cb-404-img {
  display: block;
  max-width: 100%;
  border-radius: 28px;
  opacity: 0.97;
}
.cb-404-img--dark { display: none; }

:root[data-theme="dark"] .cb-404-img--dark { display: block; }
:root[data-theme="dark"] .cb-404-img--light { display: none; }
