/* ══════════════════════════════════════════════════════════
   prose.css — long-read + archive layer for the shared
   _default/single.html and _default/list.html templates.
   Loaded AFTER main.css (linked from those two layouts only),
   so it may refine .content-body / .page-header / .archive-list
   without touching main.css itself. Uses main.css custom
   properties throughout. Delete this file + the two <link>s
   to revert to the plain layouts.
   ══════════════════════════════════════════════════════════ */

/* ── Breadcrumb eyebrow (case-file register) ── */
.crumbs {
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.crumbs a {
  color: var(--text-muted);
  border-bottom: none;
}
.crumbs a:hover { color: var(--accent); }
.crumb-sep {
  margin: 0 0.5em;
  color: var(--text-faint);
}

/* ── Title + meta line ── */
.prose-header h1 {
  font-size: clamp(2rem, 5vw, 2.6rem);
  line-height: 1.15;
  text-wrap: balance;
  margin-bottom: 0.85rem;
}
.page-meta {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.page-meta > * + *::before {
  content: "\00B7";
  margin: 0 0.7em;
  color: var(--text-faint);
}
.page-header .book-ref a { border-bottom: none; }
.page-header .book-ref a:hover { color: var(--accent-hover); }

/* ── Table of contents — the rubric list ── */
.page-toc {
  max-width: 720px;
  margin: 0 auto 2rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}
.page-toc summary {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.85rem 1.25rem;
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  list-style: none;
}
.page-toc summary::-webkit-details-marker { display: none; }
.page-toc summary::before {
  content: "\25B8";
  font-size: 0.9em;
}
.page-toc[open] summary::before { content: "\25BE"; }
.page-toc summary:hover { color: var(--accent-hover); }
.page-toc summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.page-toc-count {
  margin-left: auto;
  font-weight: normal;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}
.page-toc nav {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
}
.page-toc nav > ul {
  columns: 2 18rem;
  column-gap: 2.5rem;
}
.page-toc ul {
  list-style: none;
  margin: 0;
}
.page-toc ul ul {
  margin: 0.35rem 0 0.2rem 1rem;
}
.page-toc li {
  break-inside: avoid;
  margin: 0 0 0.45rem;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.95rem;
  line-height: 1.4;
}
.page-toc a {
  color: var(--text-secondary);
}
.page-toc a:hover { color: var(--accent); }

/* ── Reading measure + rhythm ── */
.content-body {
  font-size: 1.0625rem;
  padding: 2.5rem 2.75rem 2.75rem;
}
.content-body p { line-height: 1.75; }
/* Long raw URLs (research receipts) must never blow the column */
.content-body a { overflow-wrap: anywhere; }

/* Kept in-body <h1>s. Exact-duplicate leading h1s are stripped by
   the layout; what remains is either a subtitle-like opener (e.g.
   "… — Research Compilation") or a mid-document PART divider. */
.content-body h1 {
  font-size: 1.75rem;
  line-height: 1.3;
  margin: 3rem 0 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}
.content-body > h1:first-child {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 1.5rem;
  padding-top: 0;
  border-top: none;
}

/* Section rubric: short ember segment burning off into the hairline */
.content-body h2 {
  font-size: 1.5rem;
  margin: 2.75rem 0 1.1rem;
  padding-bottom: 0.5rem;
  background: linear-gradient(90deg,
    var(--accent) 0,
    var(--accent-dark) 3.5rem,
    var(--border-subtle) 3.5rem,
    var(--border-subtle) 100%) bottom / 100% 1px no-repeat;
}
.content-body h3 {
  font-style: italic;
  font-size: 1.2rem;
  margin: 2.25rem 0 0.75rem;
}
.content-body h4 {
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 2rem 0 0.6rem;
}

/* Essay kicker ("*Lurk More Newsletter*" as sole-emphasis first
   paragraph): masthead line, and no drop cap on it. */
.content-body > p:first-of-type:has(> em:only-child) {
  text-align: center;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.content-body.drop-cap > p:first-of-type:has(> em:only-child)::first-letter {
  float: none;
  font-size: 1em;
  padding: 0;
  color: inherit;
  font-weight: inherit;
  initial-letter: normal;
}

/* ── Tables (research corpus) — dossier panels, essay register ── */
.content-body table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-surface);
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.content-body table thead th {
  font-family: "Courier New", monospace;
  font-weight: normal;
  font-size: 0.8em;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  color: var(--accent);
  background: var(--bg-primary);
  border-bottom: 2px solid var(--accent);
  padding: 0.55rem 0.85rem;
}
.content-body table tbody td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--text-body-alt);
}
.content-body table tbody td:first-child { color: var(--text-primary); }
.content-body table tbody tr:last-child td { border-bottom: none; }
.content-body table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
.content-body table tbody tr:hover { background: var(--accent-faint); }

/* ── Definition lists (glossary) ── */
.content-body dl { margin: 1.5rem 0; }
.content-body dt {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.1rem;
  color: var(--text-heading);
  margin-top: 1.4rem;
}
.content-body dd {
  margin: 0.45rem 0 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--border);
  color: var(--text-body-alt);
}

/* ── Source lists — the receipts register ── */
.content-body h2#source-urls,
.content-body h2#sources,
.content-body h2#source-list {
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.content-body #source-urls ~ ol,
.content-body #source-urls ~ ul,
.content-body #sources ~ ol,
.content-body #sources ~ ul,
.content-body #source-list ~ ol,
.content-body #source-list ~ ul {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.content-body #source-urls ~ ol li,
.content-body #source-urls ~ ul li,
.content-body #sources ~ ol li,
.content-body #sources ~ ul li,
.content-body #source-list ~ ol li,
.content-body #source-list ~ ul li {
  margin-bottom: 0.45rem;
}

/* ── Topic chips ── */
.page-tags {
  max-width: 720px;
  margin: 2rem auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}
.tag-chip {
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  padding: 0.25em 0.75em;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-secondary);
}
.tag-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
  border-bottom-color: var(--accent);
}
.tag-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tag-chip--cat { border-left: 3px solid var(--accent); }

/* ── Related reading ── */
.related {
  max-width: 720px;
  margin: 2.5rem auto 0;
}
.related-title {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin: 0 0 1.1rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.related-card {
  display: block;
  padding: 1rem 1.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: inherit;
  transition: border-color 0.2s;
}
.related-card:hover {
  border-color: var(--accent);
  border-bottom-color: var(--accent);
}
.related-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.related-kicker {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.related-name {
  display: block;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--text-heading);
  margin-bottom: 0.35rem;
}
.related-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ── Earlier / later in section ── */
.pager {
  max-width: 720px;
  margin: 1.5rem auto 0;
  display: flex;
  gap: 1rem;
}
.pager-link {
  flex: 1;
  display: block;
  padding: 0.9rem 1.1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  transition: border-color 0.2s;
}
.pager-link:hover {
  border-color: var(--accent);
  border-bottom-color: var(--accent);
}
.pager-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.pager-next { text-align: right; }
.pager-spacer { flex: 1; }
.pager-dir {
  display: block;
  font-family: "Courier New", monospace;
  font-size: 0.65rem;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.pager-name {
  display: block;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 0.98rem;
  line-height: 1.35;
  color: var(--text-secondary);
}
.pager-link:hover .pager-name { color: var(--accent); }

/* ── List pages ── */
.list-tagline {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: #999;
  max-width: 620px;
  margin: 0 auto 0.6rem;
}
.list-count {
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  font-weight: bold;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.list-intro {
  max-width: 720px;
  margin: 0 auto 2rem;
  color: var(--text-body-alt);
}
.list-filter {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.list-filter input {
  flex: 1;
  padding: 0.55rem 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.list-filter input:focus {
  outline: none;
  border-color: var(--accent);
}
.list-filter-count {
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Archive rows: ember tick on hover */
.archive-list li {
  border-left: 2px solid transparent;
  padding-left: 0.85rem;
}
.archive-list li:hover { border-left-color: var(--accent); }
.archive-list a { line-height: 1.4; }

/* ── Responsive ── */
@media (max-width: 768px) {
  /* main.css sets its mobile .content-body padding earlier in the
     cascade; restate it here since our base rule above would win. */
  .content-body {
    padding: 1.75rem 1.25rem;
    font-size: 1rem;
  }
  .crumbs { font-size: 0.65rem; letter-spacing: 0.18em; }
  .page-toc nav > ul { columns: 1; }
  .pager { flex-direction: column; }
  .pager-next { text-align: left; }
  .pager-spacer { display: none; }
  .content-body h2 { font-size: 1.3rem; }
}
