/* ==========================================================================
   Articles (listing) — magazine grid of post cards + pagination
   Shared pieces (hero, search, chips, tags, byline) live in content-shared.css;
   pager, arrow link, avatar and card effects are canonical components.
   Index: section · grid · post card (base) · feature · photo · text · compact
   ========================================================================== */

/* ---- Section ------------------------------------------------------------ */
.posts { padding-block: var(--sp-12); background: var(--tint-warm); }
.posts .pager {
  margin-block-start: var(--sp-16);
  padding-block-start: var(--sp-8);
  border-block-start: 1px solid var(--line);
}
.posts .listing-empty { margin-block-start: var(--sp-8); }

/* ---- Grid: one column → two → the design's 12-column magazine layout ---- */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
.post-grid__item { display: flex; min-width: 0; }
.post-grid__item > .post { flex: 1; min-width: 0; }
/* items that wait for the next lazy batch stay out of the grid */

/* ---- Post card (base) ---------------------------------------------------- */
.post { border-color: var(--line); box-shadow: var(--sh-soft); }
.post__media { position: relative; }
.post__tags {
  position: absolute;
  inset-block-start: var(--sp-4);
  inset-inline-start: var(--sp-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.post__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.post__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-2);
  font-size: var(--fs-12);
  line-height: 1.35;
  color: var(--text-muted);
}
.post__meta--split { justify-content: space-between; }
.post__meta-item { display: inline-flex; align-items: center; gap: var(--sp-1); }
.post__meta-item .icon { font-size: .8125rem; }
.post__meta-item--accent { font-weight: 700; color: var(--burgundy); }
.post__meta-item--ink { color: var(--ink); }
.post__meta-item--ink .icon { color: var(--navy); }
.post__title {
  font-size: var(--fs-18);
  font-weight: 700;
  line-height: 1.5;
  color: var(--navy);
  text-wrap: pretty;
}
.post__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-block-start: auto;
  padding-block-start: var(--sp-4);
  border-block-start: 1px solid var(--sand-strong);
  font-size: var(--fs-12);
}
.post__flag { font-weight: 700; color: var(--navy); }
.post__flag--burgundy { color: var(--burgundy); }
/* the amber "featured" badge sits in the meta row at the size of the other pills */
.post__featured { padding: .125rem .625rem; background: color-mix(in srgb, var(--amber) 20%, transparent); }

/* ---- Feature card (photo beside the text from 60rem) -------------------- */
.post--feature .post__media { aspect-ratio: 16 / 9; }
.post--feature .post__body { gap: var(--sp-4); padding: var(--sp-6); }
.post--feature .post__meta { font-weight: 700; }
.post--feature .post__title { font-size: var(--fs-h3); }
.post--feature .card__excerpt { line-height: 1.7; }
.post--feature .post__footer { padding-block-start: var(--sp-6); }

/* ---- Photo card ---------------------------------------------------------- */
.post--photo .post__media { aspect-ratio: 610 / 256; }
.post--photo .post__body { gap: .6875rem; padding: var(--sp-6); }
.post--photo .card__excerpt { padding-block-end: var(--sp-3); }

/* ---- Text card ----------------------------------------------------------- */
.post--text { gap: .6875rem; padding: var(--sp-6); border-radius: var(--r-16); }
.post--text .post__title { line-height: 1.4; }
.post--text .card__excerpt { line-height: 1.45; padding-block-end: var(--sp-3); }

/* ---- Compact card (thumbnail + text) ------------------------------------- */
.post--compact {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border-radius: var(--r-16);
}
.post__thumb {
  flex: none;
  width: 6.5rem;
  aspect-ratio: 1;
  border-radius: var(--r-12);
}
.post__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post--compact .post__body { gap: var(--sp-2); }
.post--compact .post__title { font-size: var(--fs-16); line-height: 1.4; }
.post--compact .card__excerpt { line-height: 1.6; }

/* ---- ≥ 640px -------------------------------------------------------------- */
@media (min-width: 40rem) {
  .post--photo .post__body { padding: var(--sp-8); }
  .post--feature .post__body { padding: var(--sp-10); }
  .post--compact { gap: var(--sp-5); padding: var(--sp-5); }
  .post__thumb { width: 11rem; aspect-ratio: 176 / 144; }
  .post--compact .card__excerpt { font-size: var(--fs-12); }
}

/* ---- ≥ 768px: two columns (the small text cards stay in pairs) ------------ */
@media (min-width: 48rem) {
  .post-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .post-grid__item { grid-column: span 6; }
  .post-grid__item--third { grid-column: span 3; }
  /* the third text card of a run of three takes the whole row instead of standing alone */
  .post-grid__item--third + .post-grid__item--third + .post-grid__item--third { grid-column: span 6; }
}

/* ---- ≥ 900px: the three text cards share a row ---------------------------- */
@media (min-width: 56.25rem) {
  .post-grid__item--third,
  .post-grid__item--third + .post-grid__item--third + .post-grid__item--third {
    grid-column: span 2;
  }
}

/* ---- ≥ 960px: 12-column magazine grid ------------------------------------ */
@media (min-width: 60rem) {
  .post-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-8); }
  .post-grid__item--full { grid-column: span 12; }
  .post-grid__item--half { grid-column: span 6; }
  .post-grid__item--third,
  .post-grid__item--third + .post-grid__item--third + .post-grid__item--third {
    grid-column: span 4;
  }
  .post--feature { flex-direction: row; }
  .post--feature .post__media { flex: 732 1 0; aspect-ratio: auto; min-height: 26.25rem; }
  .post--feature .post__media img { position: absolute; inset: 0; }
  .post--feature .post__tags { inset-block-start: var(--sp-5); inset-inline-start: var(--sp-5); }
  .post--feature .post__body { flex: 523 1 0; }
  .post--feature .post__title { line-height: 1.5; }
}

/* ---- Motion ---------------------------------------------------------------------
   The cards fall in one after another (the shared "drop" reveal, staggered by app.js);
   the tilt they start with alternates, so the wave does not look mechanical. The cards of
   a lazy batch fall the same way when they are shown. */
.post-grid__item:nth-of-type(odd) { --drop-tilt: -2.5deg; }
.post-grid__item:nth-of-type(even) { --drop-tilt: 2.5deg; }

