/*
 * THE BLOG, ON THE SAME SYSTEM AS EVERYTHING ELSE.
 *
 * Loads after site.css and inherits its tokens, nav, buttons and footer, so a
 * reader moving from the homepage into a post does not change products. What
 * is here is only the part a post needs: a readable measure, a type scale for
 * long form, and the two blocks every post ends with.
 *
 * The old posts were built for a product that sold a resume check at
 * /resume-check. That page does not exist, and the check is now one metered
 * action inside the dashboard, so every call to action here points at the
 * dashboard instead.
 */

/* ==========================================================================
 * THE PAGE
 * ========================================================================== */

.post,
.index {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-top: clamp(5.5rem, 9vh, 6.5rem);
  padding-bottom: clamp(3rem, 6vh, 4.5rem);
}

/* 66ch is the readable measure. Everything in a post sits inside it except
   the blocks that deliberately break out. */
.post > * {
  max-width: 66ch;
}

.breadcrumb {
  margin-bottom: 1rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.breadcrumb a {
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 1px;
}

.breadcrumb a:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

.post__title {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  text-wrap: balance;
}

.post__meta {
  margin-top: 1rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post__lead {
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, 1.7vw, 1.25rem);
  line-height: 1.6;
  color: var(--ink-2);
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

/* --- long form ----------------------------------------------------------- */

.post h2 {
  margin-top: 2.25rem;
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.post h3 {
  margin-top: 1.6rem;
  font-size: clamp(1.1rem, 1.7vw, 1.28rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.post p,
.post li {
  margin-top: 0.9rem;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--ink-2);
}

.post h2 + p,
.post h3 + p {
  margin-top: 0.7rem;
}

.post strong {
  color: var(--ink);
  font-weight: 600;
}

.post a {
  color: var(--green);
  border-bottom: 1px solid rgba(0, 108, 73, 0.3);
  padding-bottom: 1px;
  transition: border-color 0.2s;
}

.post a:hover {
  border-bottom-color: var(--green);
}

.post ul,
.post ol {
  margin-top: 1.1rem;
  padding-left: 1.2rem;
}

.post li {
  margin-top: 0.55rem;
}

.post li::marker {
  color: var(--green);
}

.post blockquote {
  margin: 2rem 0 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 2px solid var(--mint-2);
}

.post blockquote p {
  color: var(--ink);
}

.post code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.875em;
  background: var(--mid);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--ink);
}

.post pre {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  background: var(--night);
  color: var(--on-night);
  border-radius: var(--r-md);
  overflow-x: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
}

.post pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.post table {
  margin-top: 1.5rem;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.post th,
.post td {
  text-align: left;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--line);
}

.post th {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post img {
  margin-top: 1.5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

/* --- the two blocks every post ends with --------------------------------- */

/* The call to action, kept out of the reading rather than interrupting it. */
.post__cta {
  margin-top: 2.5rem;
  padding: 1.35rem 1.4rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

.post__cta h3 {
  margin-top: 0;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}

.post__cta p {
  margin-top: 0.6rem;
  max-width: 54ch;
}

.post__cta .btn {
  margin-top: 1.25rem;
}

.post__cta a.btn {
  color: var(--paper);
  border-bottom: 0;
}

.post__faq {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.post__faq h2 {
  margin-top: 0;
}

.post__related {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.post__related a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.7rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.post__related a:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--white);
}

/* ==========================================================================
 * THE INDEX. Has to work at ten posts and at two hundred.
 * ========================================================================== */

.index__head {
  max-width: 44ch;
  padding-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}

.index__title {
  margin-top: 1rem;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.index__sub {
  margin-top: 1.1rem;
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  line-height: 1.65;
  color: var(--ink-2);
}

/* A list, not a grid of cards. At two hundred posts a card wall is unreadable
   and a list is still scannable. */
.posts {
  list-style: none;
  margin: 0;
  padding: 0;
}

.posts li {
  border-bottom: 1px solid var(--line);
}

.posts a {
  display: grid;
  gap: 0.3rem 1.5rem;
  grid-template-columns: 1fr;
  padding: 1.15rem 0.75rem 1.15rem 0;
  border-radius: var(--r-md);
  transition: background 0.25s var(--ease), padding-left 0.25s var(--ease);
}

.posts a:hover {
  background: var(--white);
  padding-left: 0.9rem;
}

.posts__title {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  text-wrap: balance;
}

.posts__blurb {
  font-size: 0.97rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
}

.posts__read {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  align-self: start;
}

@media (min-width: 820px) {
  .posts a {
    grid-template-columns: minmax(0, 1fr) 7rem;
    align-items: baseline;
  }

  .posts__title {
    grid-column: 1;
  }

  .posts__blurb {
    grid-column: 1;
  }

  .posts__read {
    grid-column: 2;
    grid-row: 1 / span 2;
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .posts a:hover {
    padding-left: 0;
  }
}

/* ==========================================================================
 * THE SAME VISUAL LANGUAGE AS THE HOMEPAGE.
 *
 * A post used to be type on a flat ground, which read as a different product
 * from the page that sent the reader here. It now carries the three things
 * that make the homepage what it is: the field of points the ledger is built
 * on, the quoted span with its character offsets, and the emerald reserved for
 * evidence.
 * ========================================================================== */

.index,
.post {
  position: relative;
}

/* How far through the piece the reader is. One element, transform only. */
.progress {
  position: fixed;
  inset: 0 0 auto;
  height: 2px;
  z-index: 70;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.post__title em,
.index__title em {
  font-style: normal;
  color: var(--green);
}

/* --- the closing block, which is the hero machine in miniature ------------ */

.post__cta {
  position: relative;
  overflow: hidden;
}

.post__cta::before {
  content: "";
  position: absolute;
  right: -30%;
  top: -60%;
  width: 60%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(111, 251, 190, 0.22), transparent 62%);
  pointer-events: none;
}

.post__cta > * {
  position: relative;
}

.cta__demo {
  margin-top: 1.1rem;
  padding: 0.9rem 1rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.85;
  color: var(--ink-2);
}

.cta__demo mark {
  background: var(--mint);
  color: var(--on-mint);
  border-radius: 3px;
  padding: 1px 0;
}

.cta__anchor {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line-2);
}

.cta__anchor .anchor {
  color: var(--green);
}

.cta__anchor span:last-child {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* --- the band dropped in mid piece, where a stale link used to sit -------- */

.midcta {
  margin: 2rem 0;
  padding: 1.15rem 1.25rem;
  border-left: 2px solid var(--green);
  background: var(--white);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
}

.midcta p {
  margin: 0;
  max-width: 42ch;
  font-size: 0.97rem;
  line-height: 1.55;
  color: var(--ink);
}

.midcta .btn {
  color: var(--paper);
  border-bottom: 0;
  min-height: 44px;
  flex: none;
}

.index__head {
  position: relative;
}

@media (prefers-reduced-motion: reduce) {
  .progress {
    display: none;
  }
}
