/* prose.css — long-read layout for the shared _default templates.
   Loaded ONLY by layouts/_default/single.html and list.html (research,
   dispatches, newsletter, glossary, bibliography, about, corroboration,
   tags). Additive and scoped: nothing here restyles profiles/books/tech,
   which carry their own layouts. Tokens come from main.css :root. */

/* ── Breadcrumbs ──
   main.css styles the bare `nav` element as the sticky chrome bar, so a
   semantic <nav class="crumbs"> must zero all of that out first. */
nav.crumbs {
  background: none;
  border-bottom: none;
  box-shadow: none;
  position: static;
  padding: 0;
  z-index: auto;
}
.crumbs {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0.25rem 0 2rem;
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}
.crumbs a { color: var(--text-muted); font-size: inherit; font-weight: 400; letter-spacing: inherit; }
.crumbs a:hover { color: var(--accent); text-shadow: none; }
.crumb-sep { margin: 0 0.45em; color: var(--chrome); }
.crumb-here { color: var(--text); }

/* ── Page header: title / lede / meta ── */
.prose-header {
  max-width: 46rem;
  margin: 0 auto 2.25rem;
  padding-bottom: 1.4rem;
  border-bottom: 1px solid var(--border-chrome);
  position: relative;
}
.prose-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--accent);
}
.prose-title {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.12;
  margin: 0 0 0.8rem;
  letter-spacing: -0.03em;
}
.term-hash { color: var(--accent); margin-right: 0.1em; }
.lede {
  font-size: 1.13rem;
  line-height: 1.65;
  color: var(--text-bright);
  margin: 0 0 1.1rem;
}
.prose-meta {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4em 0.55em;
}
.pm-item + .pm-item::before {
  content: '\00B7';
  color: var(--accent);
  margin-right: 0.55em;
}

/* ── Auto table of contents ──
   Hugo emits <nav id="TableOfContents"> — zero the global nav chrome. */
.prose-toc {
  max-width: 46rem;
  margin: 0 auto 2.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-chrome);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 var(--chrome-highlight);
}
.prose-toc summary {
  cursor: pointer;
  padding: 0.7rem 1.1rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  list-style: none;
  user-select: none;
}
.prose-toc summary::-webkit-details-marker { display: none; }
.prose-toc summary::before { content: '\25B8'; display: inline-block; margin-right: 0.6em; }
.prose-toc[open] summary::before { content: '\25BE'; }
.prose-toc #TableOfContents {
  background: none;
  border: none;
  box-shadow: none;
  position: static;
  padding: 0 1.25rem 1.1rem;
  z-index: auto;
}
.prose-toc ul { list-style: none; margin: 0; padding: 0; }
.prose-toc ul ul {
  padding-left: 1.1rem;
  margin: 0.15rem 0 0.15rem 0.2rem;
  border-left: 1px solid var(--border);
}
.prose-toc li { margin: 0.35rem 0; font-size: 0.85rem; line-height: 1.45; }
.prose-toc a { color: var(--text); font-size: inherit; font-weight: 400; letter-spacing: normal; text-transform: none; }
.prose-toc a:hover { color: var(--accent); text-shadow: none; }

/* ── Body copy: comfortable measure ── */
.prose {
  max-width: 46rem;
  margin: 0 auto;
  overflow-wrap: break-word;
}
.prose > p:first-child { margin-top: 0; }

/* Markdown pipe tables wider than the measure scroll in place
   instead of blowing out the column. */
.prose table {
  display: block;
  max-width: 100%;
  width: max-content;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Long raw source URLs (## Sources lists) must never overflow. */
.prose a { overflow-wrap: anywhere; }

/* Section dividers */
.prose hr {
  border: none;
  height: 1px;
  margin: 2.6rem auto;
  background: linear-gradient(90deg, transparent, var(--chrome-light), transparent);
}

/* Footnotes recede */
.prose .footnotes { font-size: 0.85rem; color: var(--text-muted); }
.prose .footnotes hr { margin: 2rem auto 1rem; }

/* Definition lists (glossary) get breathing room inside the measure */
.prose dl dd { line-height: 1.65; }

/* ── Tag chips ── */
.tag-row {
  max-width: 46rem;
  margin: 2.75rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tag-chip {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--chrome);
  border-radius: 2px;
  padding: 0.2em 0.6em;
  transition: color 0.2s, border-color 0.2s;
}
.tag-chip::before { content: '#'; color: var(--accent); margin-right: 0.35em; }
.tag-chip:hover { color: var(--accent); border-color: var(--accent); text-shadow: none; }

/* ── Related files (by shared tag) ── */
.related {
  max-width: 46rem;
  margin: 2.5rem auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-chrome);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 var(--chrome-highlight);
  padding: 1.25rem 1.5rem;
}
.related-title {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}
.related-list { list-style: none; margin: 0; padding: 0; }
.related-list li { padding: 0.65rem 0; border-bottom: 1px solid var(--border); }
.related-list li:last-child { border-bottom: none; padding-bottom: 0.2rem; }
.related-section {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.12em 0.5em;
  margin-right: 0.6em;
  vertical-align: 0.1em;
  white-space: nowrap;
}
.related-list a { color: var(--text-bright); font-weight: 600; }
.related-list a:hover { color: var(--accent); text-shadow: none; }
.related-list p { margin: 0.3rem 0 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* ── Older / newer pager ── */
.pager {
  max-width: 46rem;
  margin: 2rem auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.pager a {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border-chrome);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 var(--chrome-highlight);
  padding: 0.8rem 1rem;
  color: var(--text-bright);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.pager a:hover { border-color: var(--accent); color: var(--text-bright); text-shadow: none; }
.pager-label {
  display: block;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.pager a:hover .pager-label { color: var(--accent); }
.pager-prev { grid-column: 1; text-align: left; }
.pager-next { grid-column: 2; text-align: right; }

/* ── Section index list (list.html) ── */
.index-block { max-width: 46rem; margin: 2.75rem auto 0; }
.index-rule {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
  white-space: nowrap;
}
.index-rule::after { content: ''; flex: 1; min-width: 2rem; height: 1px; background: var(--border-chrome); }
.index-list .title { display: inline-block; line-height: 1.35; }
.index-list .meta { letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.68rem; }
.index-list .description { font-size: 0.92rem; line-height: 1.55; }

/* ── Mobile ── */
@media (max-width: 768px) {
  .prose-title { font-size: 1.6rem; }
  .crumbs { margin-bottom: 1.25rem; }
  .crumb-here { display: inline-block; max-width: 100%; }
  .pager { grid-template-columns: 1fr; }
  .pager-prev, .pager-next { grid-column: auto; text-align: left; }
}
