/* Post feed cards: All Things Pets, and any core Query Loop marked
   .erdf-post-feed.

   Two faults this fixes, both seen on staging 2026-08-17:

   1. Featured images rendered DISTORTED. A core post-featured-image has no
      intrinsic box, so images of different shapes were stretched to whatever
      the column gave them. Same remedy as the Love Story card: a fixed
      aspect-ratio box with object-fit:cover, so a portrait scan and a landscape
      snapshot crop rather than squash.

   2. ONLY THE TITLE WAS CLICKABLE. A reader aiming at the card, the picture or
      the excerpt hit nothing. The card is now one target, using the same
      stretched-pseudo-element trick as .ls-link::after in love-stories.css.

      Note the rule that carries over with it: the stretched ::after sits ABOVE
      the card's other content, so any link that must stay independently
      clickable inside a card needs its own position and z-index. There are none
      today; if one is added, that is the thing that will break.

   3. 44 of the 57 posts have NO image at all, because her articles are text.
      A card with no picture must not collapse into a different shape beside one
      that has a picture, so the media box keeps its height and shows a quiet
      tint rather than a gap. This is a holding treatment, not a design
      decision: the real answer is open with Adam.

   ------------------------------------------------------------------------
   TOKENS. Same rules as transaction.css: font-size on --size-*, prose leading
   on --leading-*, every margin/padding/gap on --space-*, column measures left
   as rem, radius and colour already tokens.

   One value MOVED rather than mapped, and it is called out because it is a
   look change and not a rename. The title was 1.05rem and the excerpt 0.92rem:
   both round to --size-sm, which would have collapsed the card's only type
   hierarchy to nothing. Title is --size-lg and excerpt --size-sm instead, one
   step apart, which is also how the Love Story card is built (.ls-name is
   --fs-xl over --fs-sm body). The card grows about 10px. The rest of this
   page's design is still open (see bucket 3, items 4 to 6). */

/* VERTICAL RHYTHM SWEEP, 2026-08-18. NOTHING IN THIS FILE CHANGED. Recorded
   here because the sweep had permission to change it and deliberately did not.

   All Things Pets opens on a tinted head band, and that band's padding was the
   one value the sweep could not find at first. It is not a per-page block
   attribute and it is not here: it is `.erdf-section .erdf-section-tint` from
   patterns/standard-page.php, which populate-pages.php slices onto every
   non-P/R/U page. Its padding never painted, because Astra's inline
   `.entry-content > .wp-block-group` rule out-ranked the single-class
   `.erdf-section` rule in erdf.css. The fix is three new rules in erdf.css,
   which give the band --space-6 above and --space-4 below and every section
   after it a --space-6 top charge. This file styles the card feed under the
   band and needs no part in that.

   Source: design/vertical-rhythm-direction-2026-08-18.md, Correction A. */

.erdf-post-feed .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
	gap: var(--space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.erdf-post-feed .wp-block-post {
	position: relative;                 /* anchor for the stretched link */
	display: flex;
	flex-direction: column;
	background: var(--warm-white);
	border-radius: var(--radius-soft);
	overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease;
}

.erdf-post-feed .wp-block-post:hover,
.erdf-post-feed .wp-block-post:focus-within {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lift);
}

/* --- the picture ------------------------------------------------------- */

.erdf-post-feed .wp-block-post-featured-image {
	margin: 0;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--blue-tint);   /* the no-image case */
}

.erdf-post-feed .wp-block-post-featured-image a,
.erdf-post-feed .wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: 100%;
}

.erdf-post-feed .wp-block-post-featured-image img {
	object-fit: cover;                  /* crop, never stretch */
	object-position: 50% 40%;           /* faces sit above centre */
}

/* --- the text ---------------------------------------------------------- */

.erdf-post-feed .wp-block-post-title {
	margin: var(--space-2) var(--space-2) var(--space-1);
	font-size: var(--size-lg);
	line-height: var(--leading-heading);
}

.erdf-post-feed .wp-block-post-title a {
	text-decoration: none;
	color: var(--ink-navy);
}

.erdf-post-feed .wp-block-post-excerpt {
	margin: 0 var(--space-2) var(--space-2);
	font-size: var(--size-sm);
	line-height: var(--leading-body);
	color: var(--grey-mid);
}

/* --- whole card is the link -------------------------------------------- */

.erdf-post-feed .wp-block-post-title a::after {
	content: '';
	position: absolute;
	inset: 0;
}

/* The image's own anchor would otherwise sit above the stretched one and
   swallow clicks on the picture; it points at the same post, so it is simply
   taken out of the tab order and left as decoration. */
.erdf-post-feed .wp-block-post-featured-image a {
	pointer-events: none;
}

.erdf-post-feed .wp-block-post-title a:focus-visible::after {
	outline: 3px solid var(--rain-yellow);
	outline-offset: 3px;
	border-radius: var(--radius-soft);
}

/* --- Astra category archives (/category/events/, /category/pet-health/, …) --

   These pages are Astra's own blog template, not an .erdf-post-feed query
   loop, so none of the rules above reach them. Astra's inline CSS gives every
   card thumbnail `aspect-ratio:16/9; width:100%` and STOPS THERE: no
   object-fit, so a 3:4 portrait or a square flyer is squashed into 16:9
   (default object-fit is fill). Seen on staging 2026-08-21, Events and
   Pet Health archives.

   Same remedy as the cards above: crop, never stretch. Astra's selector is
   `.ast-article-post .post-thumb-img-content img`; matching it exactly keeps
   specificity equal, and there is no conflict to win anyway, Astra never sets
   object-fit here. */

.ast-article-post .post-thumb-img-content img {
	object-fit: cover;                  /* crop, never stretch */
	object-position: 50% 40%;           /* faces sit above centre */
}
