/* ==========================================================================
   Blog / category archive
   --------------------------------------------------------------------------
   Loaded only on archives, the blog home and search (see wpat_assets()), for
   the same reason product.css is gated to single products: this file styles
   one family of templates and would be dead weight on the homepage.

   The listing used to inherit theme.json's `contentSize` (760px), which left
   the grid at 760px on a 1440px screen — 53% of the viewport — and squeezed
   cards to 237px. The template now marks the query `alignwide`, so the grid
   picks up `wideSize` (1240px), matching --container-max and the homepage.

   Columns are sized by `minimumColumnWidth` rather than a fixed count, so the
   grid reflows 3 -> 2 -> 1 on its own. That is deliberate: a hard-coded
   columnCount:3 was still forcing three 237px columns at 834px wide.
   ========================================================================== */

.blog-archive__head {
  text-align: center;
  margin-block: var(--space-10) var(--space-8);
}

.blog-archive__head h1 {
  margin: 0 0 var(--space-4);
}

.blog-archive__head p {
  margin: 0 auto;
  max-width: 62ch;
  color: var(--color-ink-soft);
}

/* --- Grid ---------------------------------------------------------------- */

.blog-grid {
  gap: var(--space-6);
  padding: 0;
  margin-block: 0;
  list-style: none;
}

/* Cards are the <li> the post-template block emits. */
.blog-grid > li {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
}

.blog-grid > li:hover,
.blog-grid > li:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

/* --- Media --------------------------------------------------------------- */

.blog-card__media {
  margin: 0;
  background: var(--color-surface-alt);
}

.blog-card__media a,
.blog-card__media img {
  display: block;
  width: 100%;
}

.blog-card__media img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* --- Body ---------------------------------------------------------------- */

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  flex: 1;
}

.blog-card__terms {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.3;
}

.blog-card__terms a {
  color: var(--color-accent);
  text-decoration: none;
}

.blog-card__terms a:hover {
  text-decoration: underline;
}

.blog-card__title {
  margin: 0;
  font-size: var(--fs-md);
  line-height: var(--lh-tight);
  font-weight: 700;
}

.blog-card__title a {
  color: var(--color-primary);
  text-decoration: none;
}

.blog-card__title a:hover {
  color: var(--color-accent);
}

/* Server-side excerptLength already trims the copy; this only evens out the
   last line so card heights stay regular. The text stays in the DOM, so
   nothing is hidden from crawlers or screen readers. */
.blog-card__excerpt {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--color-ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__excerpt a {
  color: var(--color-accent);
}

/* margin-top:auto pins the date to the bottom, so a short excerpt does not
   leave the meta row floating mid-card. */
.blog-card__date {
  margin: auto 0 0;
  padding-top: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--color-ink-faint);
  border-top: 1px solid var(--color-border);
}

/* --- Pagination ---------------------------------------------------------- */

.blog-pagination {
  margin-block: var(--space-10);
  gap: var(--space-2);
  flex-wrap: wrap;
}

.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  text-decoration: none;
  transition: background var(--transition), color var(--transition),
    border-color var(--transition);
}

.blog-pagination .page-numbers:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
}

.blog-pagination .page-numbers.current {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 700;
}

.blog-pagination .page-numbers.dots {
  border-color: transparent;
}

/* --- Narrow screens ------------------------------------------------------ */

@media (max-width: 600px) {
  .blog-archive__head {
    margin-block: var(--space-8) var(--space-6);
  }

  .blog-card__body {
    padding: var(--space-4);
  }
}
