/* ==========================================================================
   Blog styles. Loaded after site.css on blog pages only.
   Uses the site.css tokens, so light and dark mode follow automatically.
   ========================================================================== */

/* ---------- Draft badge ----------
   Add class "is-draft" to a .post-item (blog index) or to .post-article
   (article page) to show a "Draft" badge. Remove the class to publish. */
.is-draft .post-title::after,
.is-draft .post-head h1::after {
  content: "Draft";
  display: inline-block; vertical-align: middle;
  margin-left: 0.6rem; padding: 0.1em 0.5em;
  font-family: var(--font-sans); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.5;
  color: var(--ph-ink); background: var(--ph-bg);
  border: 1px dashed var(--ph-line); border-radius: 3px;
}
.is-draft .post-head h1::after { font-size: 0.8rem; position: relative; top: -0.2em; }

/* ---------- Blog index ---------- */
.post-list { list-style: none; margin: 0; padding: 0; max-width: 46rem; }
.post-item {
  max-width: none; padding-block: var(--space-3);
  border-top: 1px solid var(--line);
}
.post-item:last-child { border-bottom: 1px solid var(--line); }
.post-item .post-title {
  font-family: var(--font-serif); font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem);
  font-weight: 500; line-height: 1.25; margin: 0 0 0.35rem;
}
.post-item .post-title a { color: var(--ink); text-decoration: none; }
.post-item .post-title a:hover { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }
.post-item p { margin: 0 0 0.4rem; color: var(--ink-2); }
.post-meta {
  display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem;
  font-size: 0.88rem; color: var(--ink-2); margin: 0;
}
.post-meta > span + span::before {
  content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%;
  background: var(--line-strong); vertical-align: middle; margin-right: 0.9rem; position: relative; top: -1px;
}

/* ---------- Article ---------- */
.post-head { padding-block: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 3vw, 2rem); border-bottom: 1px solid var(--line); }
.post-head h1 { font-size: clamp(1.9rem, 1.2rem + 2.8vw, 2.9rem); max-width: 24ch; line-height: 1.12; }
.post-head .lede { margin-top: var(--space-2); margin-bottom: var(--space-2); }
.post-crumb { font-size: 0.9rem; margin-bottom: var(--space-2); }
.post-crumb a { text-decoration: none; }
.post-crumb a:hover { text-decoration: underline; }

.post-body { padding-block: clamp(2rem, 5vw, 3.5rem); }
.prose { max-width: 70ch; font-size: 1.0625rem; }
.prose > * + * { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.1rem; }
.prose li { margin-bottom: 0.4rem; max-width: none; }
.prose li > ul, .prose li > ol { margin-top: 0.4rem; margin-bottom: 0.4rem; }
.prose h2 {
  font-size: clamp(1.45rem, 1.15rem + 1.1vw, 1.8rem);
  margin: 2.6rem 0 0.9rem;
}
.prose h2::before {
  content: ""; display: block; width: 2.5rem; height: 3px; background: var(--accent); margin-bottom: 0.9rem;
}
.prose h3 { font-size: 1.15rem; margin: 1.9rem 0 0.6rem; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose blockquote {
  margin: 1.4rem 0; padding: 0.2rem 0 0.2rem 1.1rem; border-left: 3px solid var(--line-strong); color: var(--ink-2);
}
.prose hr { margin: 2.5rem 0; }

/* Code */
.prose pre {
  margin: 1.2rem 0 1.4rem; padding: 0.9rem 1rem; overflow-x: auto;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.55; tab-size: 2;
  max-width: 100%;
}
.prose pre code { background: none; padding: 0; font-size: inherit; border-radius: 0; white-space: pre; }
.code-label {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem;
  margin: 1.4rem 0 -0.9rem; font-size: 0.8rem; color: var(--ink-2);
}
.code-label + pre { margin-top: 1.1rem; }
.code-label .tag {
  font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem;
  border: 1px solid var(--accent); color: var(--accent); border-radius: 3px; padding: 0.05em 0.45em;
}

/* Tables */
.prose .table-wrap { margin: 1.4rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { font-size: 0.94rem; }
.prose th, .prose td { padding: 0.6rem 0.75rem; }
.prose thead th { background: var(--paper-2); }
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose td code, .prose th code { white-space: nowrap; }

/* Callouts */
.note {
  margin: 1.5rem 0; padding: 0.9rem 1.1rem; max-width: none;
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius);
  background: var(--paper-2);
}
.note > :last-child { margin-bottom: 0; }
.note-title {
  display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.35rem;
}
.note.caution { border-left-color: var(--ph-line); }
.note.caution .note-title { color: var(--ph-ink); }

/* Checklist */
.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 1.8rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 1rem; height: 1rem;
  border: 1.5px solid var(--line-strong); border-radius: 3px; background: var(--paper);
}

/* Sources, author, CTA */
.post-sources { margin-top: 2.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); max-width: 70ch; }
.post-sources h2 {
  font-family: var(--font-sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-2); margin-bottom: 0.7rem;
}
.post-sources ol { padding-left: 1.3rem; font-size: 0.93rem; color: var(--ink-2); }
.post-sources li { margin-bottom: 0.35rem; overflow-wrap: anywhere; }

.post-cta {
  margin-top: 2.5rem; padding: var(--space-3); max-width: 70ch;
  border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--paper);
}
.post-cta h2 { font-size: 1.35rem; margin-bottom: 0.5rem; }
.post-cta p { color: var(--ink-2); margin-bottom: var(--space-2); }
.post-author { margin-top: var(--space-3); font-size: 0.95rem; color: var(--ink-2); max-width: 70ch; }
.post-author strong { color: var(--ink); }

/* Phone widths: long words, URLs and code must never widen the page */
@media (max-width: 560px) {
  .prose { font-size: 1rem; }
  .prose pre { font-size: 0.8rem; padding: 0.75rem 0.8rem; }
  .prose th, .prose td { padding: 0.5rem 0.55rem; }
  .post-cta { padding: var(--space-2); }
}
.prose, .post-head { overflow-wrap: break-word; }
.prose a { overflow-wrap: anywhere; }

@media print {
  .post-cta { display: none; }
  .prose pre { white-space: pre-wrap; border-color: #999; }
  .is-draft .post-head h1::after { border-color: #000; background: none; color: #000; }
}
