/* ============================================================================
   post.css — Post / reading view (overrides Apollo page.html)
   Loaded after redesign.css; drives all color off tokens for light/dark.
   Narrow centered reading column (720), Public Sans body prose.
   Scoped under .post-wrap / .post-* to avoid collisions.
   ========================================================================== */

.post-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px 56px;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .post-wrap { padding: 40px 22px 44px; }
}

/* ---- back link ---------------------------------------------------------- */
.post-back {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--posts-chip);
}
.post-back:hover { text-decoration: underline; }

/* ---- tag pills ---------------------------------------------------------- */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0 18px;
}
.post-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--posts-chip);
  background: var(--posts-wash);
  padding: 5px 11px;
  border-radius: 7px;
  line-height: 1;
  transition: background-color .15s ease, color .15s ease;
}
.post-tag:hover {
  text-decoration: none;
  background: var(--posts);
  color: #fff;
}

/* ---- title + meta ------------------------------------------------------- */
.post-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 48px;
  line-height: 1.04;
  letter-spacing: -.025em;
  color: var(--ink);
  margin: 0 0 16px;
}

@media (max-width: 720px) {
  .post-title { font-size: 34px; }
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--faint);
  padding-bottom: 28px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--hairline);
}
.post-draft {
  color: var(--code-chip);
  font-weight: 600;
}

/* ---- tl;dr -------------------------------------------------------------- */
.post-tldr {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--ink-prose);
  background: var(--posts-wash);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 0 0 32px;
}
.post-tldr strong { color: var(--ink); }

/* ============================================================ Body prose == */
.post-body {
  font-family: var(--font-body);
  font-size: 18.5px;
  line-height: 1.7;
  color: var(--ink-prose);
}

.post-body > *:first-child { margin-top: 0; }
.post-body > *:last-child { margin-bottom: 0; }

.post-body p {
  margin: 0 0 22px;
}

/* Headings — Bricolage. h3 spec drives the scale; map markdown levels. */
.post-body h1,
.post-body h2 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  font-size: 31px;
  line-height: 1.12;
  margin: 44px 0 16px;
}
.post-body h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 27px;
  letter-spacing: -.01em;
  line-height: 1.15;
  margin: 38px 0 16px;
}
.post-body h4,
.post-body h5,
.post-body h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  font-size: 21px;
  letter-spacing: -.01em;
  margin: 30px 0 12px;
}

/* Links — coral with soft underline */
.post-body a {
  color: var(--code-chip);
  text-decoration: none;
  border-bottom: 1px solid var(--code-wash);
  transition: border-color .15s ease, color .15s ease;
}
.post-body a:hover {
  text-decoration: none;
  border-bottom-color: var(--code-chip);
}

/* Heading anchors — a small copy-link button beside the heading, not a link.
   Hidden until the heading (or the button itself) is hovered/focused. */
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 { position: relative; }
.post-body a.heading-anchor {
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
  margin-left: .35em;
  color: var(--faint);
  border-bottom: none;
  opacity: 0;
  cursor: pointer;
  transition: opacity .15s ease, color .15s ease;
}
.post-body h2:hover a.heading-anchor,
.post-body h3:hover a.heading-anchor,
.post-body h4:hover a.heading-anchor,
.post-body h5:hover a.heading-anchor,
.post-body h6:hover a.heading-anchor,
.post-body a.heading-anchor:focus-visible { opacity: 1; }
.post-body a.heading-anchor:hover { color: var(--code-chip); border-bottom: none; }
.post-body a.heading-anchor.copied { color: var(--music); opacity: 1; }

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

/* Blockquote — sage left border, Bricolage italic */
.post-body blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 26px;
  border-left: 3px solid var(--music);
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 23px;
  line-height: 1.4;
  color: var(--ink);
}
.post-body blockquote p { margin: 0 0 12px; }
.post-body blockquote p:last-child { margin: 0; }

/* Lists */
.post-body ul,
.post-body ol {
  margin: 0 0 22px;
  padding-left: 1.4em;
}
.post-body li { margin: 0 0 8px; }
.post-body li::marker { color: var(--faint); }

/* Images */
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 28px 0;
}

/* Horizontal rule */
.post-body hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 40px 0;
}

/* Inline code + code blocks */
.post-body :not(pre) > code {
  font-family: var(--font-mono);
  font-size: .82em;
  background: var(--skill-chip-bg);
  color: var(--ink-prose);
  padding: 2px 6px;
  border-radius: 6px;
}
.post-body pre {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  padding: 20px 22px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--card-border);
}
.post-body pre code {
  font-family: var(--font-mono);
  background: none;
  padding: 0;
  font-size: inherit;
  color: inherit;
}

/* Tables */
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 16px;
}
.post-body th,
.post-body td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline);
}
.post-body th {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted-2);
}

/* Footnotes (markdown) */
.post-body .footnote-definition {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  display: flex;
  gap: 8px;
  margin: 8px 0;
}
.post-body .footnote-definition p { margin: 0; }
.post-body sup a,
.post-body .footnote-definition-label {
  color: var(--posts-chip);
  border-bottom: none;
}

/* Embeds (Bandcamp / YouTube / Bluesky shortcodes) render themselves.
   Just give iframes room and rounded corners; don't suppress. */
.post-body iframe {
  max-width: 100%;
  border: none;
  border-radius: 12px;
  margin: 28px 0;
}

/* ---- giscus comments (rendered by base.html after the article) ---------- */
.giscus {
  max-width: 720px;
  margin: 8px auto 0;
  padding: 0 24px 56px;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .giscus { padding: 0 22px 44px; }
}
