/* ════════════════════════════════════════════════════════════════
   blog.css — the blog index and every post. Loads after fieldnotes.css.
   Post bodies are hand-converted markdown; supported elements are
   p, a, strong, em, h2, code, pre, blockquote, hr, ul/ol, and
   .post-sig. Add new element styles under `.post-body` below.
   ════════════════════════════════════════════════════════════════ */

/* ── Blog index ─────────────────────────────────── */

.blog-index { padding-top: clamp(150px, 16vw, 200px); }
.blog-index-head { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px clamp(32px, 5vw, 80px); align-items: end; }
.blog-index-head > div:first-child { display: grid; gap: 28px; }
.blog-index-head h1 { font-size: clamp(48px, 7vw, 108px); }
.blog-index-head h1 em { color: var(--rust); }
.blog-index-head .side { display: grid; gap: 22px; justify-items: start; padding-bottom: 10px; }
.feed-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--hair-2); transition: background-color .5s var(--ease), color .5s var(--ease); }
.feed-pill svg { width: 15px; height: 15px; color: var(--rust); }
.feed-pill:hover { background: rgba(135, 110, 70, .08); color: var(--ink); }

.post-list { list-style: none; margin: clamp(64px, 8vw, 110px) 0 0; padding: 0; }
.post-list-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 56px;
  gap: 8px clamp(24px, 4vw, 64px);
  align-items: start;
  padding: 40px 0;
  border-top: 1px solid var(--hair-2);
}
.post-list-item:last-child { border-bottom: 1px solid var(--hair-2); }
.post-list-date { grid-row: 1 / span 2; padding-top: 10px; font: 400 12.5px/1.4 var(--mono); letter-spacing: .06em; color: var(--kraft-dk); text-transform: uppercase; }
.post-list-item h2 { grid-column: 2; margin: 0; font-family: var(--sans); font-weight: 600; font-size: clamp(24px, 2.6vw, 36px); line-height: 1.12; letter-spacing: -.025em; text-wrap: balance; }
.post-list-item h2 a { transition: color .6s var(--ease); }
.post-list-item h2 a::after { content: ""; position: absolute; inset: 0; } /* whole row is the link */
.post-list-item p { grid-column: 2; max-width: 62ch; font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.post-list-item::after {
  content: "";
  grid-column: 3; grid-row: 1;
  width: 48px; height: 48px; margin-top: 4px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--hair-2);
  background: no-repeat center / 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 11.5l7-7M5.5 4.5h6v6' fill='none' stroke='%232B2620' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform .7s var(--ease-spring), background-color .5s var(--ease), box-shadow .5s var(--ease);
}
.post-list-item:hover h2 a { color: var(--rust); }
.post-list-item:hover::after { transform: translate(3px, -3px); background-color: var(--surface-hi); box-shadow: inset 0 0 0 1px var(--hair-2), 0 10px 20px -12px rgba(60, 40, 20, .4); }

/* Newest post leads, framed — new posts go at the top of the list and inherit this */
.post-list-item:first-child {
  grid-template-columns: minmax(0, 1fr) 56px;
  padding: clamp(32px, 4.5vw, 60px);
  margin-bottom: 24px;
  border: 0;
  border-radius: 34px;
  background: var(--forest);
  color: var(--surface);
  box-shadow: 0 0 0 8px rgba(135, 110, 70, .08), 0 0 0 9px var(--hair), var(--shadow-soft);
}
.post-list-item:first-child .post-list-date { grid-row: auto; grid-column: 1; padding: 0 0 10px; color: var(--kraft); }
.post-list-item:first-child h2 { grid-column: 1; font-size: clamp(30px, 4vw, 56px); max-width: 20ch; }
.post-list-item:first-child p { grid-column: 1; color: rgba(248, 242, 229, .78); font-size: 17px; margin-top: 10px; }
.post-list-item:first-child::after { grid-column: 2; grid-row: 1 / span 3; align-self: end; width: 56px; height: 56px; background-color: var(--surface); box-shadow: none; }
.post-list-item:first-child:hover h2 a { color: #F3D9A6; }
.post-list-item:first-child:hover::after { background-color: #fff; }

/* ── Post ───────────────────────────────────────── */

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 31; background: var(--rust); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
@supports (animation-timeline: scroll()) {
  .progress { animation: read linear both; animation-timeline: scroll(root); }
  @keyframes read { to { transform: scaleX(1); } }
}

main.post { width: 100%; max-width: 820px; margin: 0 auto; padding: clamp(140px, 15vw, 190px) var(--gutter) 0; }
.post-back, .post article > footer a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 12px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--hair-2);
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
.post-back::before, .post article > footer a::before {
  content: ""; width: 14px; height: 14px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13 8H3M7.5 3.5L3 8l4.5 4.5' fill='none' stroke='%234A4238' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform .6s var(--ease-spring);
}
.post-back:hover, .post article > footer a:hover { background: rgba(135, 110, 70, .08); color: var(--ink); }
.post-back:hover::before, .post article > footer a:hover::before { transform: translateX(-3px); }

.post article > header { margin: 40px 0 clamp(48px, 6vw, 72px); display: grid; gap: 26px; }
.post h1 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.06;
  letter-spacing: -.032em;
  text-wrap: balance;
}
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; font: 400 13px/1.5 var(--mono); letter-spacing: .02em; color: var(--muted); padding-top: 22px; border-top: 1px solid var(--hair-2); }

.post-body { font-size: 18px; line-height: 1.78; color: var(--ink-2); }
.post-body > * + * { margin-top: 1.35em; }
.post-body > p:first-child { font-weight: 450; font-size: clamp(20px, 1.8vw, 22px); line-height: 1.6; color: var(--ink); letter-spacing: -.008em; }
.post-body > p:first-child::first-letter {
  float: left;
  font-family: var(--serif); font-style: italic; font-weight: 480; font-variation-settings: var(--accent-axes);
  font-size: 3.4em; line-height: .82;
  margin: .08em .1em 0 -.02em;
  color: var(--rust);
}
.post-body h2 {
  margin-top: 2.6em;
  font-family: var(--sans); font-weight: 600;
  font-size: clamp(24px, 2.3vw, 30px); line-height: 1.2; letter-spacing: -.022em;
  color: var(--ink);
}
.post-body h2 + * { margin-top: .8em; }
.post-body h2 code { font-size: .62em; vertical-align: .14em; padding: .1em .4em; }
.post-body a { color: var(--forest); text-decoration: underline; text-decoration-color: rgba(63, 92, 66, .35); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color .4s var(--ease); }
.post-body a:hover { text-decoration-color: var(--forest); }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li + li { margin-top: .5em; }
.post-body li::marker { color: var(--kraft-dk); }
.post-body blockquote {
  margin: 1.8em 0;
  padding: 4px 0 4px 28px;
  border-left: 2px solid var(--rust);
  font-weight: 500;
  font-size: clamp(19px, 1.7vw, 21px); line-height: 1.6;
  color: var(--ink);
}
.post-body blockquote p + p { margin-top: .8em; }
.post-body pre {
  margin: 1.8em 0;
  padding: 22px 24px;
  border-radius: 20px;
  background: var(--espresso);
  color: rgba(248, 242, 229, .88);
  font: 400 13.5px/1.7 var(--mono);
  overflow-x: auto;
  box-shadow: 0 0 0 7px rgba(135, 110, 70, .08), 0 0 0 8px var(--hair), var(--shadow-soft);
}
.post-body pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
/* Section break: a tiny sun over two hills */
.post-body hr {
  border: 0; height: 26px; margin: 3.2em 0;
  background: no-repeat center / 64px 26px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 26'%3E%3Ccircle cx='17' cy='8' r='4' fill='%23B5532A'/%3E%3Crect x='24' y='8' width='10' height='30' rx='5' fill='%235B6272'/%3E%3Crect x='36' y='3' width='11' height='30' rx='5.5' fill='%235B6272'/%3E%3Crect x='0' y='22' width='64' height='4' rx='2' fill='%233F5C42'/%3E%3C/svg%3E");
}
.post-sig { font-family: var(--serif); font-style: italic; font-weight: 480; font-variation-settings: var(--accent-axes); font-size: 24px; color: var(--rust); }
.post article > footer { margin-top: clamp(56px, 7vw, 88px); padding-top: 32px; border-top: 1px solid var(--hair-2); }

/* End-of-post card */
.post-cta { max-width: 980px; margin: clamp(80px, 10vw, 140px) auto 0; padding: 0 var(--gutter); }
.post-cta .core { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 28px 48px; align-items: end; padding: clamp(28px, 4vw, 52px); background: var(--forest); color: var(--surface); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.post-cta .h3 { font-size: clamp(28px, 3vw, 42px); letter-spacing: -.03em; line-height: 1.08; margin-top: 18px; }
.post-cta .h3 em { color: #F3D9A6; }
.post-cta p { margin-top: 14px; font-size: 14.5px; color: rgba(248, 242, 229, .72); }
.post-cta p.h3 { margin-top: 18px; font-size: clamp(24px, 2.6vw, 34px); color: var(--surface); }
.post-cta .actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.post-cta .btn { justify-content: space-between; }
.post-cta .btn-ghost { --fg: var(--surface); --ic: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(248, 242, 229, .25); }
.post-cta .btn-ghost:hover { --bg: rgba(255, 255, 255, .06); }

@media (max-width: 860px) {
  .blog-index-head { grid-template-columns: minmax(0, 1fr); }
  .post-list-item { grid-template-columns: minmax(0, 1fr) 48px; padding: 32px 0; }
  .post-list-date { grid-row: auto; grid-column: 1; padding-top: 0; }
  .post-list-item h2, .post-list-item p { grid-column: 1; }
  .post-list-item::after { grid-column: 2; grid-row: 1 / span 2; }
  .post-list-item:first-child { padding: 28px 24px; border-radius: 28px; }
  .post-cta .core { grid-template-columns: minmax(0, 1fr); }
  .post-body { font-size: 17px; }
}
