/* Page-specific tweaks */
.cb-section { padding: 24px 0 8px; }
.cb-section h2 { margin-top: 0; }
.cb-section > p { max-width: 70ch; }

.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: 10px;
  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: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  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: 6px;
  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 > 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; }

/* Code blocks */
.cb-prose pre {
  border: 1px solid var(--cb-rule);
  border-radius: var(--cb-radius);
  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;
}

/* 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: 10px;
  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: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  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: 6px;
  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; }

/* ---------- 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; }
