/* Events index rows: the one component this page adds.
   Loaded only where the erdf/events-index block is present (inc/events.php).

   Nothing here invents a visual language. The row is the post-feed card
   (post-feed.css) laid on its side: same warm-white ground, same radius, same
   hover lift, same fixed 4:3 media box with the quiet tint standing in when a
   post has no image, same crop-never-stretch, same whole-card link via the
   stretched pseudo-element, same title-over-excerpt one-step type hierarchy.
   The year line reuses the .erdf-eyebrow voice (erdf.css shared atoms). The
   section shells lean on .erdf-section for vertical rhythm, and .evix-wrap
   reproduces the constrained content column because a server-rendered block
   gets no wp-container layout CSS from WordPress.

   TOKENS. Same rules as post-feed.css: type on --size-*, leading on
   --leading-*, every margin/padding/gap on --space-*, radius and colour
   already tokens. */

/* ---- the content column ------------------------------------------------ */

.erdf-evix .evix-wrap {
	max-width: var(--content);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* ---- rich rows: sections 1 and 2 --------------------------------------- */

.erdf-evix .ev-rows {
	list-style: none;
	margin: var(--space-3) 0 0;
	padding: 0;
	display: grid;
	gap: var(--space-3);
}

/* The resting shadow is --shadow-card, the Love Story card's own (design
   system 2.4): the row and the page ground are both warm-white, so without it
   the card has no edge at rest. */
.erdf-evix .ev-row {
	position: relative;                 /* anchor for the stretched link */
	display: grid;
	grid-template-columns: minmax(12rem, 16rem) 1fr;
	background: var(--warm-white);
	border-radius: var(--radius-soft);
	overflow: hidden;
	box-shadow: var(--shadow-card);
	transition: transform .18s ease, box-shadow .18s ease;
}

.erdf-evix .ev-row:hover,
.erdf-evix .ev-row:focus-within {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lift);
}

@media (max-width: 600px) {
	.erdf-evix .ev-row { grid-template-columns: 1fr; }
}

/* the picture, or the quiet tint when the post has none */
.erdf-evix .ev-media {
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--blue-tint);
}

.erdf-evix .ev-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;                  /* crop, never stretch */
	object-position: 50% 40%;           /* faces sit above centre */
}

.erdf-evix .ev-body {
	padding: var(--space-2) var(--space-3) var(--space-3);
}

/* the visible year, first on the row (blueprint orientation rule) */
.erdf-evix .ev-year {
	margin: 0 0 var(--space-1);
	font-size: var(--size-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--grey-mid);
}

/* The year shares its line with the badges (R2; the pills are ev-badges.css).
   The line takes the year's bottom margin, so a row with no badge spaces
   exactly as before. */
.erdf-evix .ev-meta {
	margin: 0 0 var(--space-1);
}

.erdf-evix .ev-meta .ev-year {
	margin: 0;
}

.erdf-evix .ev-title {
	margin: 0 0 var(--space-1);
	font-size: var(--size-lg);
	line-height: var(--leading-heading);
}

.erdf-evix .ev-title a {
	text-decoration: none;
	color: var(--ink-navy);
}

.erdf-evix .ev-sum {
	margin: 0;
	font-size: var(--size-sm);
	line-height: var(--leading-body);
	color: var(--grey-mid);
}

/* whole row is the link; see post-feed.css for the idiom and its one caveat */
.erdf-evix .ev-title a::after {
	content: '';
	position: absolute;
	inset: 0;
}

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

/* ---- compact rows: section 3, the archive by year ---------------------- */

.erdf-evix .ev-past {
	margin-top: var(--space-4);
}

.erdf-evix .ev-past-year {
	margin: 0 0 var(--space-2);
	font-size: var(--size-xs);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--grey-mid);
}

.erdf-evix .ev-past-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* A post with a gallery carries an Event photos pill after its link (R2,
   spec section 3a), so the row is a flex line: the link, then the pill 8px
   on, wrapping under the title on a narrow screen. The whole row stays the
   link's target and takes the hover tint, as before, through the stretched
   pseudo-element the rich rows use; the pill sits under it as plain text. */
.erdf-evix .ev-past-row {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: var(--space-1);
	border-top: 1px solid var(--blue-tint);
}

.erdf-evix .ev-past-row:last-child {
	border-bottom: 1px solid var(--blue-tint);
}

.erdf-evix .ev-past-row a {
	display: block;
	padding: var(--space-2) var(--space-1);
	min-height: var(--touch-target);
	font-size: var(--size-base);
	color: var(--ink-navy);
	text-decoration: none;
}

.erdf-evix .ev-past-row a::after {
	content: '';
	position: absolute;
	inset: 0;
}

.erdf-evix .ev-past-row:hover,
.erdf-evix .ev-past-row a:focus-visible,
.erdf-evix .ev-past-row:has(a:focus-visible) {
	background: var(--blue-tint);
}

/* On a phone the pill takes its own line under the title, on the text's left
   edge, 8px under it and 16px clear of the row's rule, on every row alike,
   rather than wrapping onto the rule wherever a title happens to run long
   (three of the four did at 390). */
@media (max-width: 479px) {
	.erdf-evix .ev-past-row > .ev-badges {
		flex-basis: 100%;
		margin: calc(-1 * var(--space-1)) 0 var(--space-2) var(--space-1);
	}
}

.erdf-evix .ev-all {
	margin: var(--space-3) 0 0;
	font-size: var(--size-sm);
}

/* ---- section 4 --------------------------------------------------------- */

.erdf-evix .ev-support {
	margin: var(--space-3) 0 0;
}

/* ---- the draft marker, until go-live ----------------------------------- */
/* Same treatment as .erdf-ls .draftmark in love-stories.css; scoped here
   because that sheet does not load on this page. One filter in the theme
   turns every instance off together. */
.erdf-evix-page .draftmark {
	position: fixed; right: 12px; bottom: 12px; z-index: 90;
	font-size: 11px; letter-spacing: 0.06em; font-variant: small-caps;
	color: rgba(59,59,59,0.42); background: rgba(253,251,246,0.72);
	border: 1px solid rgba(59,59,59,0.18); border-radius: var(--radius-pill);
	padding: 3px 10px; pointer-events: auto; cursor: default;
}
.erdf-evix-page .draftmark:hover,
.erdf-evix-page .draftmark:focus {
	color: var(--ink-navy); border-color: var(--ink-navy); background: var(--warm-white);
}
