/* ============================================================
   Actualization AI — field-notes index and post pages.
   Pairs with css/site.css. Same square-cornered, hairline
   vocabulary as the homepage.
   ============================================================ */

/* ---------- Index ---------- */

.blog-hero {
  background: var(--ink);
  color: var(--cream);
  padding: clamp(46px, 5.6vw, 82px) var(--gut) clamp(40px, 4.6vw, 62px);
  border-bottom: 1px solid var(--ink);
}
.blog-hero__inner { max-width: 900px; margin: 0 auto; }
.blog-hero h1 {
  margin: 22px 0 20px;
  font-family: var(--display);
  font-size: clamp(34px, 5.4vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 500;
  text-wrap: pretty;
}
.blog-hero p {
  margin: 0;
  max-width: 660px;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.5;
  color: var(--dim-soft);
  text-wrap: pretty;
}

.blog-index { padding: clamp(38px, 4.4vw, 62px) var(--gut) clamp(52px, 6vw, 86px); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: var(--wrap);
  margin: 0 auto;
}

/* The hairline lives on each card as an outline (no layout cost) and the 1px
   gap lets neighbours share it, so empty grid tracks paint nothing. */
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  outline: 1px solid var(--line);
  transition: background .16s ease;
}
.blog-card:hover { background: var(--band); }
.blog-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--band); }
.blog-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Posts saved without a photo fall back to the wordmark; contain it on ink. */
.blog-card__media--logo { background: var(--ink); display: flex; align-items: center; justify-content: center; }
.blog-card__media--logo img { object-fit: contain; padding: 20%; }
.blog-card__body { display: flex; flex-direction: column; flex: 1; gap: 12px; padding: 24px; }
.blog-card__meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.blog-card__title {
  margin: 0;
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.025em;
  font-weight: 500;
}
.blog-card__title a { color: var(--ink); }
.blog-card__title a:hover { color: var(--accent-deep); }
.blog-card__author { margin: 0; font-size: 14.5px; color: var(--muted); }
.blog-card__excerpt { margin: 0; font-size: 16px; line-height: 1.55; color: var(--body); text-wrap: pretty; }
.blog-card__link {
  margin-top: auto;
  padding-top: 4px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--accent);
}

.blog-empty {
  display: none;
  max-width: 620px;
  margin: 0 auto;
  padding: 34px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--body);
}
.blog-grid:not(:has(.blog-card)) { display: none; }
.blog-grid:not(:has(.blog-card)) + .blog-empty { display: block; }

@media (max-width: 1080px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .blog-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Post ---------- */

.post-page { padding: clamp(34px, 4vw, 58px) var(--gut) clamp(56px, 6vw, 92px); }
.post-article { max-width: 760px; margin: 0 auto; }

.post-back {
  display: inline-block;
  margin-bottom: 26px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.post-back::before { content: "\2190"; margin-right: 8px; }

.post-header { border-bottom: 1px solid var(--ink); padding-bottom: 28px; margin-bottom: 38px; }
.post-meta {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.post-title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(31px, 4.4vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.042em;
  font-weight: 500;
  text-wrap: pretty;
}

.post-content { font-size: 18.5px; line-height: 1.72; color: #2b333c; }
.post-content p { margin: 0 0 22px; }
.post-content h2,
.post-content h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.post-content h2 { font-size: 30px; line-height: 1.14; margin: 44px 0 16px; }
.post-content h3 { font-size: 23px; line-height: 1.22; margin: 34px 0 12px; }
.post-content ul,
.post-content ol { margin: 0 0 26px; padding-left: 22px; }
.post-content li { margin: 0 0 10px; }
.post-content li p { margin-bottom: 8px; }
.post-content strong { font-weight: 700; color: var(--ink); }
.post-content blockquote {
  margin: 32px 0;
  padding: 2px 0 2px 20px;
  border-left: 2px solid var(--accent);
  color: var(--ink);
}
.post-content blockquote p { font-size: 20px; line-height: 1.5; }
.post-content code {
  font: 500 0.88em var(--mono);
  background: var(--band);
  border: 1px solid var(--line);
  padding: 0.08em 0.32em;
}
.post-content pre {
  margin: 0 0 26px;
  padding: 18px 20px;
  overflow-x: auto;
  background: var(--ink);
  color: var(--cream);
  font-size: 14.5px;
  line-height: 1.6;
}
.post-content pre code { display: block; padding: 0; background: transparent; border: 0; color: inherit; }
.post-content hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.post-content a { color: var(--accent); border-bottom: 1px solid rgba(23,162,148,.4); overflow-wrap: anywhere; }
.post-content a:hover { color: var(--accent-deep); border-bottom-color: currentColor; }
.post-content figure { margin: 0 0 34px; }
.post-content figcaption { margin-top: 10px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.post-content img { width: 100%; height: auto; display: block; }

/* ---------- Prompt block: a long instruction meant to be copied ---------- */

.prompt-block {
  margin: 34px 0 38px;
  border: 1px solid var(--ink);
  background: var(--white);
}
.prompt-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--ink);
  color: var(--cream);
  padding: 13px 18px;
}
.prompt-block__bar span {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-bright);
}
.prompt-block__copy {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--accent-bright);
  color: #05201d;
  border: 0;
  padding: 8px 14px;
  cursor: pointer;
}
.prompt-block__body { padding: 26px 24px 28px; font-size: 16.5px; line-height: 1.62; }
.prompt-block__body h3 { font-size: 19px; margin: 26px 0 10px; }
.prompt-block__body h3:first-child { margin-top: 0; }
.prompt-block__body p { margin: 0 0 16px; }
.prompt-block__body ul { margin: 0 0 18px; padding-left: 20px; }
.prompt-block__body ul ul { margin: 8px 0 0; }
.prompt-block__body li { margin: 0 0 8px; }
.prompt-block__rule {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 18px;
}
.prompt-eg {
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.6;
  border-left: 2px solid var(--line);
  padding: 2px 0 2px 14px;
  margin: 0 0 16px;
  color: var(--body);
}
.prompt-eg--good { border-left-color: var(--accent); color: #2b333c; }

/* ---------- Slot for a screenshot the author still has to drop in ---------- */

.post-slot {
  margin: 0 0 34px;
  border: 1px dashed var(--line);
  background: var(--band);
  padding: 34px 24px;
  text-align: center;
}
.post-slot__label {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}
.post-slot p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--body); }

/* ---------- Continue-reading gate (built at runtime by js/site.js) ---------- */

.post-gate { position: relative; }
.post-content.is-gated { max-height: 1100px; overflow: hidden; }
.post-gate__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 210px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(247,249,250,0) 0%, rgba(247,249,250,.88) 58%, var(--paper) 100%);
}
.post-gate__cta { display: flex; justify-content: center; margin: 22px 0 8px; }
.post-gate__cta .btn, .post-next .btn { flex: none; }

.post-next {
  max-width: 760px;
  margin: 52px auto 0;
  padding-top: 26px;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  align-items: center;
  justify-content: space-between;
}
.post-next__pitch { max-width: 430px; display: flex; flex-direction: column; gap: 6px; }
.post-next__pitch strong {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.post-next__pitch span { font-size: 15.5px; line-height: 1.5; color: var(--body); text-wrap: pretty; }

@media (max-width: 760px) {
  .post-content { font-size: 17px; }
  .post-content h2 { font-size: 26px; }
  .post-content h3 { font-size: 21px; }
  .post-content blockquote p { font-size: 18px; }
}
