/* ════════════════════════════════════════════════════════════════
   Continual Learning Bench · subpage.css
   ════════════════════════════════════════════════════════════════ */

.subpage { padding-top: 56px; }

/* ════════════════════════════════════════════════════════════════
   DOCS LAYOUT
   ════════════════════════════════════════════════════════════════ */
.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - 56px - 80px);
  border-top: 1px solid var(--c-border);
}

.docs-sidebar {
  padding: 2.75rem 2rem 3rem 3rem;
  border-right: 1px solid var(--c-border);
  background: var(--c-surface);
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.sidebar-section { margin-bottom: 2rem; }

.sidebar-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--c-dim);
  margin-bottom: 0.55rem;
  display: block;
}

.sidebar-nav { list-style: none; display: flex; flex-direction: column; }

.sidebar-nav a {
  display: block;
  font-size: 0.95rem;
  color: var(--c-muted);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.sidebar-nav a:hover { color: var(--c-text); background: var(--c-border); }
.sidebar-nav a[aria-current="page"] {
  color: var(--c-accent);
  background: var(--c-accent-lo);
}

/* Content fills the remaining column — no inner max-width cap */
.docs-content {
  padding: 3rem 4rem 5rem 5rem;
  min-width: 0;
}

/* Stateful vs stateless fork diagram (home + metrics Gain section) — uses theme CSS vars */
.docs-content .hiw-wrap {
  margin: 1.15rem auto 1.5rem;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-bg);
  padding: 1.25rem 1.5rem 1.25rem;
  max-width: min(36rem, 100%);
}
.docs-content .hiw-svg {
  width: 100%;
  height: auto;
  display: block;
}
.docs-content .hiw-svg .row-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
}
.docs-content .hiw-svg .row-label-stateful { fill: var(--c-accent); }
.docs-content .hiw-svg .row-label-stateless { fill: var(--c-dim); }
.docs-content .hiw-svg .box-stateful {
  fill: var(--c-bg);
  stroke: var(--c-accent);
  stroke-width: 1.5;
}
.docs-content .hiw-svg .box-stateless {
  fill: var(--c-bg);
  stroke: var(--c-border-hi);
  stroke-width: 1.5;
}
.docs-content .hiw-svg .box-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 17px;
  fill: var(--c-text);
}
.docs-content .hiw-svg .box-text-muted {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 17px;
  fill: var(--c-muted);
}
.docs-content .hiw-svg .arrow { stroke: var(--c-accent); stroke-width: 2; fill: none; }
.docs-content .hiw-svg .arrow-head { fill: var(--c-accent); }
.docs-content .hiw-svg .reset-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  fill: var(--c-dim);
  letter-spacing: 0.04em;
}
.docs-content .hiw-svg .task-pill {
  fill: var(--c-surface);
  stroke: var(--c-border-hi);
  stroke-width: 1.5;
}
.docs-content .hiw-svg .task-pill-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  fill: var(--c-text);
}
.docs-content .hiw-svg .fork-arrow {
  stroke: var(--c-border-hi);
  stroke-width: 1.5;
  fill: none;
}
.docs-content .hiw-svg .fork-arrow-head { fill: var(--c-border-hi); }
.docs-content .hiw-svg .end-label-reward {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  fill: var(--c-accent);
}
.docs-content .hiw-svg .end-label-baseline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  fill: var(--c-dim);
}
.docs-content .hiw-svg .arrow-muted {
  stroke: var(--c-border-hi);
  stroke-width: 2;
  fill: none;
}
.docs-content .hiw-svg .gain-bracket {
  fill: none;
  stroke: #be7c27;
  stroke-width: 1.5;
}
.docs-content .hiw-svg .gain-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  fill: #be7c27;
}
[data-theme='dark'] .docs-content .hiw-svg .gain-bracket {
  stroke: #f0a458;
}
[data-theme='dark'] .docs-content .hiw-svg .gain-label {
  fill: #f0a458;
}

/* ════════════════════════════════════════════════════════════════
   PROSE TYPOGRAPHY  (docs content + blog posts)
   ════════════════════════════════════════════════════════════════ */
.prose h1, .docs-content h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.85rem, 3.5vw, 2.5rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin-bottom: 1.4rem;
  color: var(--c-text);
}

.prose h2, .docs-content h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.04em;
  margin: 2.75rem 0 0.85rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--c-border);
  color: var(--c-text);
  scroll-margin-top: 70px;
}

.prose h1, .docs-content h1,
.prose h3, .docs-content h3 { scroll-margin-top: 70px; }

.prose h2:first-of-type, .docs-content h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.prose h3, .docs-content h3 {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  margin: 1.9rem 0 0.5rem;
  color: var(--c-text);
}

/* Main prose text uses --c-text for full contrast */
.prose p, .docs-content p {
  font-size: 1.05rem;
  color: var(--c-text);
  line-height: 1.85;
  margin-bottom: 1.1rem;
  opacity: 0.88;
}

.prose ul, .prose ol,
.docs-content ul, .docs-content ol {
  font-size: 1.05rem;
  color: var(--c-text);
  line-height: 1.85;
  margin-bottom: 1.1rem;
  padding-left: 1.6rem;
  opacity: 0.88;
}

.prose li, .docs-content li { margin-bottom: 0.3rem; }

/* Inline code */
.prose code, .docs-content code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82em;
  background: var(--c-code-bg);
  color: var(--c-code-text);
  padding: 0.12em 0.38em;
  border-radius: 3px;
}

/* Code blocks — white in light mode, dark in dark mode */
.prose pre, .docs-content pre {
  background: #ffffff;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 1.1rem 1.4rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.prose pre code, .docs-content pre code {
  background: none;
  color: var(--c-text);
  font-size: 0.8rem;
  padding: 0;
  border-radius: 0;
  line-height: 1.85;
  opacity: 1;
}

[data-theme="dark"] .prose pre,
[data-theme="dark"] .docs-content pre {
  background: #1a2435;
  border-color: #2e4060;
}

[data-theme="dark"] .prose pre code,
[data-theme="dark"] .docs-content pre code {
  color: #c2d4e6;
}

.prose a, .docs-content a {
  color: var(--c-accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.prose a:hover, .docs-content a:hover { border-bottom-color: var(--c-accent); }

.prose hr, .docs-content hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 2.5rem 0;
}

.prose strong, .docs-content strong { color: var(--c-text); font-weight: 500; opacity: 1; }
.prose em, .docs-content em { font-style: italic; }

/* ════════════════════════════════════════════════════════════════
   DOCS HERO LOGO + DEFINITION BLOCKS
   ════════════════════════════════════════════════════════════════ */
.docs-hero-logo {
  display: flex;
  justify-content: center;
  margin: 0.5rem 0 2.25rem;
}

.docs-hero-logo img {
  max-width: 320px;
  width: 100%;
  height: auto;
}

.def-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 0;
}

.def-block {
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  background: var(--c-surface);
}

.def-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-accent);
  display: block;
  margin-bottom: 0.55rem;
  font-weight: 500;
}

.def-block p {
  margin-bottom: 0;
  font-size: 0.98rem;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .def-grid { grid-template-columns: 1fr; }
}

.content-error {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.18);
  border-radius: 6px;
  padding: 0.8rem 1rem;
}

/* ════════════════════════════════════════════════════════════════
   CONTRIBUTORS
   ════════════════════════════════════════════════════════════════ */
.contributors-wrap { padding: 4rem 0 6rem; }

.contributors-header {
  padding-bottom: 2.25rem;
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--c-border);
}

.contributors-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.65rem, 3.5vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 0.8rem;
  color: var(--c-text);
}

.contributors-lead {
  max-width: 640px;
  color: var(--c-muted);
  font-size: 0.95rem;
  line-height: 1.75;
}

.contributors-lead a {
  color: var(--c-accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.contributors-lead a:hover { border-bottom-color: var(--c-accent); }

.contributors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.contributor-card {
  padding: 0.85rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-bg);
  transition: border-color 0.15s, background 0.15s;
}
.contributor-card:hover { background: var(--c-surface); border-color: var(--c-border-hi); }

.contributor-name {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--c-text);
}

.contributor-affil {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.82rem;
  color: var(--c-text-dim, var(--c-dim));
}

.supported-by {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--c-border);
  text-align: center;
}
.supported-by-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--c-text);
  margin: 0 0 0.5rem;
}
.supported-by-lead {
  max-width: 38rem;
  margin: 0 auto 1.25rem;
  font-size: 0.95rem;
  color: var(--c-dim);
}
.supported-by-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 3rem;
}
.supporter-logo {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.supporter-logo:hover { opacity: 1; }
[data-theme="dark"] .supporter-logo { filter: brightness(0.95); }

.contributor-role {
  display: block;
  margin-top: 0.25rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-dim);
}

/* Breadcrumb */
.breadcrumb {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.71rem;
  color: var(--c-dim);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.breadcrumb a { color: var(--c-muted); }
.breadcrumb a:hover { color: var(--c-text); }

/* ════════════════════════════════════════════════════════════════
   CALLOUT BOXES
   ════════════════════════════════════════════════════════════════ */
.callout {
  border-left: 3px solid var(--c-border);
  padding: 0.7rem 1.2rem;
  background: var(--c-surface);
  border-radius: 0 6px 6px 0;
  margin: 1.5rem 0;
}

.callout-todo  { border-left-color: #c4892a; background: rgba(196,137,42,0.06); }
.callout-note  { border-left-color: var(--c-accent); background: var(--c-accent-lo); }

.callout-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 500;
  margin-bottom: 0.3rem;
  display: block;
}
.callout-todo .callout-label { color: #c4892a; }
.callout-note .callout-label { color: var(--c-accent); }

.callout p {
  font-size: 0.875rem;
  margin-bottom: 0;
  line-height: 1.65;
  opacity: 1;
}

/* ════════════════════════════════════════════════════════════════
   NEWS — listing
   ════════════════════════════════════════════════════════════════ */
.news-header {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--c-border);
}

.news-page-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  margin-bottom: 0.45rem;
  color: var(--c-text);
}

.news-page-sub { font-size: 0.9rem; color: var(--c-muted); }

.news-list { padding: 2.5rem 0; }

.news-item {
  padding: 2rem 0;
  border-bottom: 1px solid var(--c-border);
}
.news-item:first-child { padding-top: 0; }
.news-item:last-child { border-bottom: none; }

.news-item-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--c-dim);
  margin-bottom: 0.5rem;
}

.news-item-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.news-item-title a { color: var(--c-text); }
.news-item-title a:hover { color: var(--c-accent); }

.news-item-excerpt {
  font-size: 0.9rem;
  color: var(--c-muted);
  line-height: 1.72;
  max-width: 600px;
  margin-bottom: 0.8rem;
}

.news-read-link {
  font-size: 0.855rem;
  color: var(--c-accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s;
}
.news-read-link:hover { border-bottom-color: var(--c-accent); }

/* ════════════════════════════════════════════════════════════════
   NEWS — blog post
   ════════════════════════════════════════════════════════════════ */
.post-wrap { padding: 4rem 0 6rem; }
.post-inner { max-width: 1100px; }

.post-layout {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 42rem);
  grid-template-areas:
    'toc head'
    'toc prose';
  gap: 2rem 3rem;
  align-items: start;
}

.post-toc {
  grid-area: toc;
  position: sticky;
  top: 72px;
  align-self: start;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.post-main-top { grid-area: head; }

.post-prose { grid-area: prose; min-width: 0; }

.post-toc-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-dim);
  font-weight: 500;
  margin: 0 0 0.75rem;
}

.post-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.post-toc-list a {
  display: block;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--c-muted);
  padding: 0.3rem 0.45rem;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.post-toc-list a:hover {
  color: var(--c-text);
  background: var(--c-accent-lo);
}

.post-toc-list a[aria-current="true"] {
  color: var(--c-accent);
  border-left-color: var(--c-accent);
  background: var(--c-accent-lo);
}

.post-toc--empty { display: none; }

/* Post body: section titles read as nav anchors; body emphasis stays quieter */
.post-prose h2 {
  color: var(--c-accent);
  border-top: none;
  padding-top: 0;
  padding-left: 0.85rem;
  margin-left: -0.85rem;
  border-left: 3px solid var(--c-accent);
  scroll-margin-top: 70px;
}

.post-prose h2:first-of-type {
  margin-top: 0;
}

.post-prose h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--c-muted);
  margin-top: 1.75rem;
  scroll-margin-top: 70px;
}

.post-prose strong {
  font-weight: 600;
  color: inherit;
  opacity: 1;
}

.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--c-border);
}

.post-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--c-accent);
  margin-bottom: 0.7rem;
  display: block;
}

.post-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.65rem, 3.5vw, 2.3rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--c-text);
}

.post-byline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--c-dim);
}

.post-figure {
  margin: 2rem 0;
}

.post-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-card);
}

.post-figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--c-dim);
}

/* ════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: 1fr; }

  .docs-sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--c-border);
    padding: 1.5rem 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .sidebar-section { margin-bottom: 0; }
  .docs-content { padding: 2.25rem 2rem 4rem; }
}

@media (max-width: 900px) {
  .post-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      'head'
      'toc'
      'prose';
    gap: 0 0;
  }

  .post-toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 1rem 1.1rem;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    margin: 0 0 1.25rem;
  }

  .post-toc-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .post-toc-list li { margin: 0; }

  .post-toc-list a {
    font-size: 0.78rem;
    padding: 0.35rem 0.55rem;
    border-left: none;
    border: 1px solid var(--c-border);
    background: var(--c-bg);
  }

  .post-toc-list a[aria-current="true"] {
    border-color: var(--c-accent);
  }
}

@media (max-width: 480px) {
  .docs-content { padding: 1.75rem 1.25rem 3rem; }
  .post-wrap { padding: 2.5rem 0 4rem; }
}
