/* ============================================================
   crabcc blog · article + index typography
   Built entirely on the design-system custom properties from
   _ds/.../tokens/{colors,typography,spacing,fonts,elevation}.css.
   No hardcoded hexes that duplicate a token; literals only where
   the DS has no token (noted inline).
   ============================================================ */

/* ---- Layout ------------------------------------------------ */
/* Readable measure. The DS ships --container-prose (68ch); the
   brief asks for ~70ch, so we use a 70ch cap directly (literal:
   no exact-70ch token exists). */
.post,
.index {
  max-width: 70ch;
  margin: 0 auto;
  padding: var(--space-12) var(--space-5) var(--space-20);
}

/* ---- Index ------------------------------------------------- */
.index-head {
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-6);
  border-bottom: var(--border-hair) solid var(--border-subtle);
}
.index-head h1 {
  margin: var(--space-1) 0 var(--space-3);
}
.lede {
  color: var(--text-muted);
  font-size: var(--text-md);
  line-height: var(--lh-md);
  margin: 0;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.entry {
  padding: var(--space-6) 0;
  border-bottom: var(--border-hair) solid var(--border-subtle);
}
.entry:last-child {
  border-bottom: 0;
}
.entry-title {
  font-size: var(--text-xl);
  line-height: var(--lh-xl);
  margin: 0 0 var(--space-1);
}
.entry-title a {
  color: var(--text-strong);
}
.entry-title a:hover {
  color: var(--text-accent);
}
.entry-desc {
  color: var(--text-body);
  margin: var(--space-2) 0 var(--space-3);
}

/* ---- Post header ------------------------------------------- */
.back {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-8);
}
.post-head {
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-6);
  border-bottom: var(--border-hair) solid var(--border-subtle);
}
.post-head h1 {
  margin: 0 0 var(--space-3);
}

/* ---- Meta + tags ------------------------------------------- */
.meta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: 0;
}
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0;
}
.tag {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  background: var(--surface-sunken);
  border: var(--border-hair) solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: var(--space-0_5) var(--space-2);
}

/* ---- Prose (rendered Markdown body) ------------------------ */
.prose {
  font-size: var(--text-md);
  line-height: var(--lh-base);
  color: var(--text-body);
}
.prose h2 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  padding-top: var(--space-2);
}
.prose h3 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}
.prose p {
  margin: 0 0 var(--space-5);
}
.prose ul,
.prose ol {
  margin: 0 0 var(--space-5);
  padding-left: var(--space-6);
}
.prose li {
  margin-bottom: var(--space-2);
}
.prose strong {
  color: var(--text-strong);
  font-weight: var(--fw-bold);
}
.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Blockquotes (the posts use them for the "honest note" asides). */
.prose blockquote {
  margin: 0 0 var(--space-5);
  padding: var(--space-2) var(--space-5);
  border-left: var(--border-thick) solid var(--border-accent);
  background: var(--accent-wash);
  color: var(--text-body);
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}

/* ---- Code -------------------------------------------------- */
/* Fenced code blocks and the ASCII-art <pre> blocks in the posts.
   Inline <code> styling is already provided by the DS base layer;
   we only own the block-level container here. */
.prose pre {
  background: var(--surface-sunken);
  border: var(--border-hair) solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: 0 0 var(--space-5);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  /* ASCII-art diagrams rely on exact spacing; never collapse it. */
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}
.prose pre code {
  /* DS already zeroes bg/border/padding on `pre code`; keep the
     mono family explicit and let it inherit block sizing. */
  font-family: var(--font-mono);
  font-size: inherit;
}

/* ---- Tables ------------------------------------------------ */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}
.prose th,
.prose td {
  border: var(--border-hair) solid var(--border-subtle);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--surface-sunken);
  color: var(--text-strong);
  font-weight: var(--fw-bold);
}
.prose tbody tr:nth-child(even) td {
  background: var(--surface-card);
}

/* ---- Horizontal rule (DS base styles <hr> already; nothing extra) --- */
