/* ──────────────────────────────────────────────────────────────────────────
   denmetra.com blog

   These pages are built by scripts/prerender.mjs and ship no JavaScript at all.
   Everything here rides on top of the tokens the main stylesheet defines
   (--bone, --ink, --pine and the three font families), so the blog is the
   same publication as the landing page rather than a bolted-on subdomain
   look.

   The measure is deliberately narrow. These posts are read on a phone in a
   clinic corridor between two patients, and a 40rem column is the difference
   between reading and scanning.
   ────────────────────────────────────────────────────────────────────────── */

/* ── breadcrumbs ────────────────────────────────────────────────────────── */

.crumbs {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--pine-deep); text-decoration: underline; }

/* ── the index ──────────────────────────────────────────────────────────── */

.blog-index { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3.5rem, 7vw, 6rem); }
.blog-index h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  counter-reset: none;
}
.post-card { border-bottom: 1px solid var(--line); }
.post-card > a {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 2rem 0.2rem 2.2rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.16s;
}
.post-card > a:hover { background: var(--surface); }
.post-card h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.15;
  max-width: 34ch;
  text-wrap: pretty;
}
.post-card p {
  color: var(--ink-soft);
  max-width: var(--read);
  font-size: 1rem;
  line-height: 1.55;
}
.post-card-more {
  font-family: var(--display);
  font-variation-settings: "opsz" 18;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--pine-deep);
  margin-top: 0.3rem;
}
.post-card > a:hover .post-card-more { color: var(--apricot); }

/* ── a post ─────────────────────────────────────────────────────────────── */

.post { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3.5rem, 7vw, 6rem); }

.post-head {
  max-width: var(--read);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}
.post-head h1 {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.post-meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* The short answer, printed before the argument that supports it.
   Somebody who came from a search result for one question gets it answered in
   the first screen, and a retrieval system gets a clean self-contained
   paragraph to lift instead of a summary it has to invent. */
.post-answer {
  border-left: 3px solid var(--pine);
  background: var(--pine-tint);
  padding: 1rem 1.15rem;
  border-radius: 0 6px 6px 0;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink);
}
.post-answer strong { color: var(--pine-deep); }

/* ── contents ───────────────────────────────────────────────────────────── */

.toc {
  max-width: var(--read);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 1.1rem 1.3rem 1.2rem;
  margin-bottom: clamp(2rem, 4vw, 2.8rem);
}
.toc ol {
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.toc li { font-size: 0.95rem; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--pine-deep); text-decoration: underline; }

/* ── prose ──────────────────────────────────────────────────────────────── */

.prose { max-width: var(--read); }
.prose > * + * { margin-top: 1.15rem; }

.prose h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 2.8rem;
  scroll-margin-top: 5rem;
  position: relative;
}
.prose h3 {
  font-size: 1.14rem;
  margin-top: 2rem;
  scroll-margin-top: 5rem;
}
.prose p { line-height: 1.68; }
.prose li { line-height: 1.62; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.4rem; }

/* The anchor sits in the margin on a wide screen and disappears on a narrow
   one, where there is no margin to sit in and a stray # in the heading reads
   as a typo. */
.prose .anchor {
  position: absolute;
  left: -1.25rem;
  color: var(--line);
  text-decoration: none;
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.14s, color 0.14s;
}
.prose h2:hover .anchor { opacity: 1; color: var(--pine-soft); }
.prose .anchor:hover, .prose .anchor:focus-visible { opacity: 1; color: var(--pine); }
@media (max-width: 60rem) { .prose .anchor { display: none; } }
.prose h3 .anchor { display: none; }

.prose blockquote {
  margin: 1.6rem 0;
  padding: 0.2rem 0 0.2rem 1.1rem;
  border-left: 3px solid var(--pine-soft);
  color: var(--ink-soft);
  font-size: 1.02rem;
}
.prose blockquote p + p { margin-top: 0.8rem; }

.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bone-deep);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}
.prose pre {
  background: var(--pine-dark);
  color: #e9f2f0;
  padding: 1rem 1.15rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.5;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: 1em; }

.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4rem 0; }

/* ── tables ─────────────────────────────────────────────────────────────── */
/* Wide tables scroll inside their own box. Letting one push the page sideways
   breaks every other paragraph on the page, and these posts are mostly read on
   a phone. */

.table-scroll {
  overflow-x: auto;
  margin: 1.6rem 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.94rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.prose thead th {
  font-family: var(--display);
  font-variation-settings: "opsz" 16;
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: -0.01em;
  background: var(--bone-deep);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.prose tbody tr:last-child td { border-bottom: 0; }
/* Numbers line up under each other or the column is decoration. */
.prose td { font-variant-numeric: tabular-nums; }

/* ── related and closing offer ──────────────────────────────────────────── */

.related {
  max-width: var(--read);
  margin-top: clamp(3rem, 6vw, 4.5rem);
  border-top: 1px solid var(--line);
  padding-top: 1.4rem;
}
.related ul {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.related a {
  font-family: var(--display);
  font-variation-settings: "opsz" 18;
  font-weight: 600;
  font-size: 1.02rem;
  text-decoration: none;
  color: var(--ink);
  text-wrap: pretty;
}
.related a:hover { color: var(--pine-deep); text-decoration: underline; }

.post-cta {
  background: var(--pine-dark);
  color: #e9f2f0;
  padding: clamp(3rem, 6vw, 4.5rem) clamp(1.15rem, 4vw, 2.5rem);
}
.post-cta h2 { color: #fff; max-width: 24ch; margin: 0 auto; }
.post-cta p {
  max-width: var(--read);
  margin: 1rem auto 0;
  color: rgba(233, 242, 240, 0.78);
  line-height: 1.6;
}
.post-cta > h2, .post-cta > p { max-width: var(--read); margin-left: auto; margin-right: auto; }
.post-cta .btn-primary { background: var(--bone); color: var(--pine-dark); border-color: var(--bone); }
.post-cta .btn-ghost { background: transparent; border-color: rgba(255, 255, 255, 0.28); color: #fff; }
