/*
 * Blog-specific styles.
 * Everything is scoped under .post-body so it cannot bleed into the rest of
 * the site. All colors and fonts read from the existing design tokens, so
 * light + party themes work automatically.
 */

/* Back link in the post header */
.post-back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 0.2s;
}
.post-back .marker {
  color: var(--teal);
  margin-right: 0.4rem;
  text-shadow: var(--glow-teal-soft);
}
.post-back:hover { color: var(--teal); }

.post-meta--single { margin-top: 1.25rem; }

/* --- Post body typography ----------------------------------------------- */
.post-body { color: var(--ink-soft); font-size: 1.02rem; line-height: 1.8; max-width: 780px; }

.post-body > * + * { margin-top: 1.1rem; }

.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.03em;
  color: var(--ink);
  line-height: 1.15;
  margin-top: 2.4rem;
}
.post-body h2 { font-size: 1.8rem; }
.post-body h3 { font-size: 1.4rem; color: var(--ink); }
.post-body h4 { font-size: 1.15rem; color: var(--ink-soft); }
.post-body h2 + *, .post-body h3 + *, .post-body h4 + * { margin-top: 0.9rem; }

.post-body strong { color: var(--ink); font-weight: 500; }
.post-body em { color: var(--ink); font-style: italic; }

.post-body a {
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid rgba(74,181,183,0.35);
  transition: color 0.2s, border-color 0.2s;
}
.post-body a:hover { color: var(--teal-bright); border-bottom-color: var(--teal-bright); }

.post-body ul,
.post-body ol { padding-left: 1.4rem; }
.post-body li + li { margin-top: 0.4rem; }
.post-body li::marker { color: var(--teal); }

.post-body blockquote {
  border-left: 2px solid var(--teal);
  padding: 0.2rem 0 0.2rem 1.25rem;
  color: var(--ink);
  font-style: italic;
}

.post-body hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 2.5rem 0;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

/* --- Tables ------------------------------------------------------------- */
.post-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 1.75rem 0;
  -webkit-overflow-scrolling: touch;
}

.post-body table thead {
  background: var(--charcoal-2);
}

.post-body table th,
.post-body table td {
  padding: 0.7rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.post-body table th {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}

.post-body table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.post-body table tbody tr:last-child td {
  border-bottom: 0;
}

.post-body table tbody td:first-child {
  color: var(--ink);
  font-weight: 500;
}

.post-body table code {
  font-size: 0.85em;
}

/* --- Code --------------------------------------------------------------- */
.post-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88em;
  background: var(--charcoal-2);
  border: 1px solid var(--border);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  color: var(--ink);
}

.post-body pre {
  background: var(--charcoal-2);
  border: 1px solid var(--border);
  padding: 1rem 1.1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  margin: 1.5rem 0;
}
.post-body pre code {
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: var(--ink);
}

/* --- Prism syntax highlight (token-driven, theme-aware) ----------------- */
.post-body .token.comment,
.post-body .token.prolog,
.post-body .token.doctype,
.post-body .token.cdata { color: var(--ink-mute); font-style: italic; }
.post-body .token.punctuation { color: var(--ink-soft); }
.post-body .token.property,
.post-body .token.tag,
.post-body .token.boolean,
.post-body .token.number,
.post-body .token.constant,
.post-body .token.symbol,
.post-body .token.deleted { color: var(--spark-bright); }
.post-body .token.selector,
.post-body .token.attr-name,
.post-body .token.string,
.post-body .token.char,
.post-body .token.builtin,
.post-body .token.inserted { color: var(--purple); }
.post-body .token.operator,
.post-body .token.entity,
.post-body .token.url,
.post-body .language-css .token.string,
.post-body .style .token.string { color: var(--ink-soft); }
.post-body .token.atrule,
.post-body .token.attr-value,
.post-body .token.keyword { color: var(--teal-bright); }
.post-body .token.function,
.post-body .token.class-name { color: var(--teal); }
.post-body .token.regex,
.post-body .token.important,
.post-body .token.variable { color: var(--spark); }
.post-body .token.important,
.post-body .token.bold { font-weight: 600; }
.post-body .token.italic { font-style: italic; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 640px) {
  .post-body { font-size: 1rem; }
  .post-body h2 { font-size: 1.6rem; }
  .post-body h3 { font-size: 1.25rem; }
  .post-body pre { font-size: 0.8rem; padding: 0.85rem 0.9rem; }
  .post-body table { font-size: 0.88rem; }
  .post-body table th,
  .post-body table td { padding: 0.55rem 0.75rem; }
}
