/* ==========================================================================
   11 Plus Blocks: the blog
   --------------------------------------------------------------------------
   468 imported articles. The reading experience is the product here, so the
   post body is set for actual reading: one column, 42rem, generous leading,
   and nothing in the margin competing for attention.
   ========================================================================== */

/* --- Search --------------------------------------------------------------- */
.blog-search {
  display: flex;
  gap: var(--space-2xs);
  max-width: 30rem;
  margin-bottom: var(--space-m);
}
.blog-search input {
  flex: 1;
  min-width: 0;
  padding: 0.7em 1em;
  border: 1px solid var(--hairline-2);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--step-0);
}
.blog-search input::placeholder { color: var(--ink-faint); }
.blog-search input:focus-visible { border-color: var(--purple); }

/* --- Topic chips ---------------------------------------------------------- */
.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs);
  list-style: none;
  margin: 0;
  padding: 0;
}
.topic-chips li { margin: 0; }
.topic-chips a { text-decoration: none; transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.topic-chips a:hover { background: var(--purple); color: var(--on-accent); }
.topic-chips__n { opacity: 0.55; font-variant-numeric: tabular-nums; }

/* --- Post grid ------------------------------------------------------------ */
.post-grid {
  display: grid;
  gap: var(--space-m);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  overflow: hidden;
  transition: transform var(--dur) var(--ease-spring),
              box-shadow var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out);
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--hairline-2);
}
.post-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.post-card__link:hover { color: inherit; }

.post-card__media {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--wash);
}
.post-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.post-card:hover .post-card__media img { transform: scale(1.03); }

.post-card__body {
  padding: var(--space-s);
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  flex: 1;
}
.post-card__title {
  font-size: var(--step-1);
  line-height: 1.28;
  margin: 0;
  color: var(--deep);
}
.post-card:hover .post-card__title { color: var(--purple); }
.post-card__excerpt {
  margin: 0;
  font-size: 0.94rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.post-card__meta {
  margin: auto 0 0;
  padding-top: 0.5em;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-faint);
  display: flex;
  gap: 0.45em;
  align-items: center;
}

/* --- Pagination ----------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin-top: var(--space-xl);
}
.pager__list {
  display: flex;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}
.pager__list li { margin: 0; }
.pager__page, .pager__step {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.7em;
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.pager__page:hover, .pager__step:hover { background: var(--wash-strong); color: var(--deep); }
.pager__page.is-current { background: var(--chrome); color: var(--on-accent); }
.pager__gap { display: grid; place-items: center; min-width: 24px; color: var(--ink-faint); }

/* --- Post header ---------------------------------------------------------- */
.post-head { margin-bottom: var(--space-m); }
.post-head h1 { font-size: var(--step-4); margin-bottom: var(--space-xs); }
.post-head__meta {
  font-family: var(--font-label);
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink-soft);
  display: flex;
  gap: 0.45em;
  align-items: center;
  margin: 0 0 var(--space-s);
}
.post-head__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs);
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-head__tags li { margin: 0; }
.post-head__tags a { text-decoration: none; }

.post-hero {
  margin: 0 0 var(--space-l);
  border-radius: var(--radius-tile);
  overflow: hidden;
  max-height: 460px;
  box-shadow: var(--shadow-md);
}
.post-hero img { width: 100%; height: 100%; object-fit: cover; }

/* --- Post body ------------------------------------------------------------
   Set for reading, not for looking at. */
.post-body {
  font-size: 1.06rem;
  line-height: 1.72;
}

/* The article runs to the same rail as its hero image.
   `.prose` caps itself at 42rem, which is the right measure for a page of
   running text sitting on its own but left the post looking half-built beside
   a full-width hero. The two-class selector beats `.prose` on specificity
   rather than relying on this file loading later than layout.css. */
.prose.post-body { max-width: none; }
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 {
  font-size: var(--step-2);
  margin-top: 2em;
  margin-bottom: 0.5em;
  padding-top: 0.6em;
  border-top: 1px solid var(--hairline);
}
.post-body h3 { font-size: var(--step-1); margin-top: 1.7em; margin-bottom: 0.4em; }
.post-body h4 { font-size: var(--step-0); margin-top: 1.4em; margin-bottom: 0.3em; color: var(--purple); }
.post-body ul, .post-body ol { padding-left: 1.3em; }
.post-body li { margin-bottom: 0.5em; }
.post-body li::marker { color: var(--lilac); }
.post-body figure { margin: var(--space-l) 0; }
.post-body img { border-radius: var(--radius-card); width: 100%; }
.post-body figcaption {
  margin-top: 0.6em;
  font-size: 0.86rem;
  color: var(--ink-faint);
  text-align: center;
}
/* Wide content scrolls inside its OWN box. The page must never scroll
   sideways: a four-column table of prepositions is 470px wide at its narrowest
   and the reading column on a 390px phone is 342px, so without this the whole
   article is clipped and the headline loses its last two words.

   display:block is what makes a table scrollable. Its children keep their
   table display, so the layout inside is unaffected. */
.post-body table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  margin: var(--space-m) 0;
  font-size: 0.95rem;
  -webkit-overflow-scrolling: touch;
}

.post-body .table-scroll,
.post-body pre { overflow-x: auto; max-width: 100%; }

/* Imported copy contains the odd unbroken URL or run-on word. */
.post-body { overflow-wrap: break-word; }

.post-body .faq { margin-top: var(--space-2xs); }
.post-body .faq > summary { font-size: var(--step-0); }

/* --- The install unit inside a post ---------------------------------------
   The 468 posts are the whole organic footprint and none of them asked for
   anything. One unit three paragraphs in, one at the end. */
.post-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-s);
  margin: var(--space-l) 0;
  padding: var(--space-m);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--purple) 12%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--hairline-2);
}
.post-cta__copy { flex: 1 1 16rem; }
.post-cta__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--deep);
  margin: 0 0 0.25em;
}
.post-cta__body {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.post-cta .store-badge img { height: 48px; width: auto; }

/* Inside the prose column the unit should break out of the reading measure
   slightly, so it reads as an aside rather than as a paragraph. */
@media (min-width: 720px) {
  .post-body .post-cta { margin-inline: -2rem; }
}
