/* Bench page palette — adapted from euchre_server/src/bench.rs:899-916,
   re-tuned for a four-tier hierarchy on blog post pages:
     1. site title  (header h1)            — small chrome bar
     2. post title  (article > h1)         — page anchor, largest
     3. section     (article h2 = `#`)     — major section break
     4. subsection  (article h3 = `##`)    — minor section
   Body markdown headings are shifted +1 by the renderer so post body
   content never produces an <h1>. */

body {
  font-family: monospace;
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
  background: #fafafa;
  color: #111;
  line-height: 1.5;
}

a { color: #1452a3; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── Site chrome ──────────────────────────────────────────────────────── */

body > header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 0.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid #ccc;
}
.site-title {
  font-size: 1rem;
  font-weight: bold;
  margin: 0;
  border: none;
  letter-spacing: 0.02em;
}
.site-title a { color: inherit; }
.site-title a:hover { text-decoration: none; color: #1452a3; }
.site-tagline {
  margin: 0;
  color: #777;
  font-size: 0.85rem;
}

/* ─── Post page ────────────────────────────────────────────────────────── */

article > h1 {
  font-size: 1.9rem;
  font-weight: bold;
  line-height: 1.2;
  margin: 0 0 0.35rem 0;
  border: none;
  color: #111;
}
article > .post-meta {
  color: #888;
  font-size: 0.85rem;
  margin: 0 0 2.5rem 0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

article h2 {
  font-size: 1.3rem;
  font-weight: bold;
  margin: 2.5rem 0 0.6rem 0;
  padding-bottom: 0.2rem;
  border-bottom: 1px solid #ddd;
  color: #1a1a1a;
}
article h3 {
  font-size: 1.05rem;
  font-weight: bold;
  margin: 1.75rem 0 0.4rem 0;
  color: #333;
  border: none;
}
article h4, article h5, article h6 {
  font-size: 0.95rem;
  font-weight: bold;
  margin: 1.25rem 0 0.3rem 0;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

article p { margin: 0.6rem 0; }

/* ─── Index page ──────────────────────────────────────────────────────── */

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dotted #ddd;
}
.post-list .post-meta {
  color: #888;
  font-size: 0.85rem;
  white-space: nowrap;
  letter-spacing: 0.03em;
}

/* ─── Inline elements ─────────────────────────────────────────────────── */

code { background: #f0f0f0; padding: 0.05rem 0.3rem; border-radius: 2px; font-size: 0.95em; }
pre { background: #f4f4f4; padding: 1rem; border: 1px solid #ddd; overflow-x: auto; line-height: 1.4; }
pre code { background: transparent; padding: 0; font-size: 0.9rem; }

blockquote {
  border-left: 3px solid #ccc;
  margin: 1rem 0;
  padding: 0.2rem 1rem;
  color: #555;
}

ul, ol { line-height: 1.7; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.5rem; }
th, td { border: 1px solid #ccc; padding: 0.4rem 0.8rem; text-align: left; }
th { background: #f0f0f0; }

img { max-width: 100%; height: auto; }

hr { border: none; border-top: 1px solid #ddd; margin: 2rem 0; }

/* ─── Footer / nav ─────────────────────────────────────────────────────── */

.post-nav {
  margin: 3rem 0 0 0;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
  font-size: 0.9rem;
}
footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid #ccc;
  color: #888;
  font-size: 0.85rem;
}

/* ─── Trajectories ─────────────────────────────────────────────────────── */

.trajectory-table th.num, .trajectory-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.trajectory-table td.total { color: #1a1a1a; }   /* slightly darker, no bold */
.trajectory-table tr.clickable { cursor: pointer; }
.trajectory-table tr.clickable:hover { background: #f0f0f0; }

.trajectory-summary {
  margin: 0.4rem 0;
  color: #555;
  font-size: 0.9rem;
}
.trajectory-links {
  margin: 1rem 0 2rem 0;
  color: #888;
  font-size: 0.85rem;
}

.trajectory-prompt { margin-bottom: 2rem; }
.trajectory-prompt summary { cursor: pointer; color: #1452a3; font-size: 0.9rem; }
.trajectory-prompt pre { max-height: 400px; overflow: auto; font-size: 0.85rem; margin-top: 0.5rem; }

.trajectory-filters {
  margin: 0.5rem 0 1rem 0;
  color: #888;
  font-size: 0.85rem;
}
.trajectory-filters label { margin-left: 0.6rem; color: #555; }
.trajectory-count { margin-left: 0.6rem; color: #888; float: right; }

.trajectory-events { display: flex; flex-direction: column; gap: 0.4rem; }
.trajectory-events.hide-tool .event-tool_use { display: none; }
.trajectory-events.hide-text .event-text { display: none; }
.trajectory-events.hide-step .event-boundary { display: none; }

.event { font-size: 0.9rem; }
.step-sep {
  padding-top: 0.8rem;
  margin-top: 0.8rem;
  border-top: 1px dotted #ddd;
  color: #999;
  font-size: 0.8rem;
}
.step-finish { color: #999; font-size: 0.8rem; }

.tool-use { padding: 0.1rem 0; }
.tool-use summary { cursor: pointer; outline: none; color: #444; }
.tool-use summary::marker { color: #bbb; }
.tool-name { color: #1452a3; margin-right: 0.5rem; }
.tool-summary { color: #555; }
.tool-section { margin: 0.4rem 0 0.4rem 1.2rem; }
.tool-label {
  color: #999; font-size: 0.75rem; margin-bottom: 0.15rem;
}
.tool-use pre { max-height: 400px; overflow: auto; font-size: 0.85rem; margin: 0; }

.assistant-text {
  white-space: pre-wrap;
  margin-left: 0.8rem;
  padding-left: 0.8rem;
  border-left: 2px solid #ddd;
  color: #333;
}
