/* ==========================================================================
   post.css — single article / blog post page
   Loaded after base.css. Contains the reading column and prose typography.
   ========================================================================== */

.wrap-narrow { max-width: 664px; margin: 0 auto; padding: 0 24px; }

/* Article */
.post {
  padding: clamp(56px, 7vw, 88px) 0 clamp(72px, 10vw, 120px);
}
.post-header {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--rule);
}
/* Meta line: date + tags grouped tight, generous gap before the title */
.post-date {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-2xs);
}
.post-tags {
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: var(--space-sm);
}
.post-tags:empty { display: none; }
.post-header h1 {
  color: var(--green);
  font-family: var(--sans);
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  text-wrap: pretty;
}

.post-body {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.72;
  color: var(--body);
  font-optical-sizing: auto;
  font-kerning: normal;
  hanging-punctuation: first last;
}
.post-body > * + * { margin-top: 1.2em; }
/* Justified prose with hyphenation to avoid rivers (html[lang=en] enables it).
   Only paragraphs and list items justify — headings and code stay ragged/left. */
.post-body p,
.post-body li {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.post-body h2 {
  font-family: var(--sans);
  color: var(--green);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.22;
  margin-top: 2.6em;
  margin-bottom: 0.5em;
  text-wrap: pretty;
}
.post-body h3 {
  font-family: var(--sans);
  color: var(--green);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-top: 2em;
  margin-bottom: 0.45em;
  text-wrap: pretty;
}
/* Opening deck / subtitle: lighter and larger than a section head */
.post-body > h3:first-child {
  font-size: clamp(1.2rem, 2.6vw, 1.4rem);
  font-weight: 500;
  color: var(--green-soft);
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin-top: 0;
  margin-bottom: 0.2em;
}
.post-body p { margin: 0; text-wrap: pretty; }
.post-body ul, .post-body ol { padding-left: 1.4em; margin: 0; }
.post-body li + li { margin-top: 0.4em; }
.post-body blockquote {
  border-left: 3px solid var(--orange);
  padding: 4px 0 4px 18px;
  margin: 0;
  color: var(--green-soft);
  font-style: italic;
}
.post-body code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--cream-tint);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--green);
}
.post-body pre {
  background: var(--green-deep);
  color: #d4cdb8;
  padding: 22px 24px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.92rem;
  line-height: 1.7;
  margin: 1.6em 0;
  border: 1px solid #2a3a30;
}
.post-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}
.post-body hr {
  border: 0;
  height: 1px;
  background: var(--rule);
  margin: 2em 0;
}
.post-body strong { color: var(--green); font-weight: 700; }

/* Figures & images */
.post-body figure { margin: 1.6em 0; }
.post-body picture { display: block; }
.post-body img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--rule);
}
.post-body figcaption {
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
  margin-top: 0.7em;
}
/* Wide diagrams break out beyond the reading column, centered in the viewport */
.post-body figure.diagram {
  width: min(92vw, 960px);
  margin-left: 50%;
  transform: translateX(-50%);
}

.post-footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.post-footer a { text-decoration: none; color: var(--green); font-weight: 600; font-size: 0.95rem; }
.post-footer a:hover { color: var(--orange); }
.post-footer .back::before { content: "← "; }
