/* =============================================================
   Elite Pearl Charter — latest posts
   Grid: 1 col -> 2 (560px) -> 3 (1024px).
   ============================================================= */

.epc-blog {
	background: var(--epc-black);
	color: var(--epc-silver);
	border-top: 1px solid var(--epc-line-soft);
}

.epc-blog__inner {
	width: 100%;
	max-width: var(--epc-container);
	margin-inline: auto;
	padding: 4rem var(--epc-gutter);
}

@media (min-width: 768px) {
	.epc-blog__inner {
		padding-block: 5.5rem;
	}
}

@media (min-width: 1200px) {
	.epc-blog__inner {
		padding-block: 7rem;
	}
}

/* --- Intro ---------------------------------------------------------- */

.epc-blog__intro {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
	.epc-blog__intro {
		flex-direction: row;
		align-items: flex-end;
		justify-content: space-between;
		gap: 2rem;
		margin-bottom: 3.5rem;
	}
}

.epc-blog__eyebrow {
	margin: 0 0 0.75rem;
	font-family: var(--epc-font-sans);
	font-size: clamp(0.6875rem, 1.6vw, 0.8125rem);
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--epc-silver);
}

.epc-blog__heading {
	margin: 0;
	font-family: var(--epc-font-serif);
	font-size: clamp(1.625rem, 4.6vw, 2.75rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: 0.01em;
	text-transform: uppercase;
}

.epc-blog__rule {
	display: block;
	width: 72px;
	height: 1px;
	margin-top: 1.25rem;
	background: linear-gradient(
		to right,
		rgb(255 255 255 / 70%) 0%,
		transparent 100%
	);
}

.epc-blog__all {
	flex-shrink: 0;
	align-self: flex-start;
}

@media (max-width: 479.98px) {
	.epc-blog__all {
		width: 100%;
	}
}

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

.epc-blog__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 560px) {
	.epc-blog__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.epc-blog__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1.75rem;
	}
}

/* --- Card -------------------------------------------------------------- */

.epc-post {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background: var(--epc-gradient-surface);
	border: 1px solid rgb(141 143 142 / 32%);
	border-radius: 14px;
	box-shadow:
		0 0 0 rgb(0 0 0 / 0%),
		inset 0 1px 0 rgb(255 255 255 / 6%);
	transition: transform 520ms var(--epc-ease-soft),
		border-color 520ms var(--epc-ease-soft),
		box-shadow 520ms var(--epc-ease-soft);
}

.epc-post:hover,
.epc-post:focus-within {
	transform: translateY(-6px);
	border-color: rgb(255 255 255 / 60%);
	box-shadow:
		0 22px 48px rgb(0 0 0 / 50%),
		0 8px 20px rgb(0 0 0 / 35%),
		inset 0 1px 0 rgb(255 255 255 / 12%);
}

/* Gradient hairline along the top edge, wiping in from the left. */
.epc-post__accent {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 3;
	width: 100%;
	height: 2px;
	background: var(--epc-gradient-title);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 620ms var(--epc-ease-soft);
}

.epc-post:hover .epc-post__accent,
.epc-post:focus-within .epc-post__accent {
	transform: scaleX(1);
}

/* --- Ghost index --------------------------------------------------------- */

/*
 * Sits on the seam between image and body, outlined rather than filled so it
 * reads as texture behind the title instead of competing with it.
 */
.epc-post__index {
	position: absolute;
	top: calc(56.25% - 1.9rem);
	right: 1.1rem;
	z-index: 2;
	font-family: var(--epc-font-serif);
	font-size: 3.5rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.02em;
	color: transparent;
	-webkit-text-stroke: 1px rgb(255 255 255 / 38%);
	transition: opacity 520ms var(--epc-ease-soft),
		-webkit-text-stroke-color 520ms var(--epc-ease-soft);
	pointer-events: none;
}

@media (min-width: 1024px) {
	.epc-post__index {
		font-size: 4rem;
		top: calc(56.25% - 2.2rem);
	}
}

.epc-post:hover .epc-post__index {
	-webkit-text-stroke-color: rgb(255 255 255 / 70%);
}

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

.epc-post__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: var(--epc-ink-900);
}

.epc-post__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 760ms var(--epc-ease-soft);
}

.epc-post:hover .epc-post__img,
.epc-post:focus-within .epc-post__img {
	transform: scale(1.06);
}

.epc-post__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgb(0 0 0 / 0%) 40%, rgb(0 0 0 / 78%) 100%);
	pointer-events: none;
}

/* Date badge sits on the photo, freeing the body for the copy. */
.epc-post__date {
	position: absolute;
	left: 1rem;
	bottom: 0.9rem;
	z-index: 2;
	margin: 0;
	padding: 0.35rem 0.7rem;
	font-family: var(--epc-font-sans);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--epc-white);
	background: rgb(0 0 0 / 55%);
	border: 1px solid var(--epc-line);
	border-radius: 999px;
	backdrop-filter: blur(6px);
}

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

.epc-post__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.5rem 1.35rem 1.5rem;
}

@media (min-width: 1024px) {
	.epc-post__body {
		padding: 1.75rem 1.5rem 1.6rem;
	}
}

.epc-post__title {
	/* Clears the ghost number so long titles never run under it. */
	margin: 0 3rem 0 0;
	font-family: var(--epc-font-serif);
	font-size: clamp(1rem, 2.1vw, 1.125rem);
	font-weight: 600;
	line-height: 1.35;
	text-wrap: balance;

	/*
	 * Two lines maximum, so every card in the row keeps the same shape however
	 * long the headline is. This only clips visually; the full text stays in the
	 * DOM for crawlers and screen readers.
	 */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.epc-post__title a {
	color: var(--epc-white);
	text-decoration: none;
	transition: color 520ms var(--epc-ease-soft);
}

/* One link per card in the tab order, but the whole card is clickable. */
.epc-post__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.epc-post:hover .epc-post__title a {
	color: var(--epc-silver);
}

.epc-post__divider {
	display: block;
	width: 34px;
	height: 1px;
	margin: 0.9rem 0;
	background: linear-gradient(
		to right,
		rgb(255 255 255 / 60%) 0%,
		transparent 100%
	);
	transition: width 520ms var(--epc-ease-soft);
}

.epc-post:hover .epc-post__divider,
.epc-post:focus-within .epc-post__divider {
	width: 62px;
}

/*
 * Excerpt was grey (#808080) at 14px, which is roughly 3.4:1 against this
 * background and hard to read. Soft white at 15px clears 4.5:1 comfortably.
 */
.epc-post__excerpt {
	margin: 0;
	font-family: var(--epc-font-sans);
	font-size: clamp(0.875rem, 1.9vw, 0.9375rem);
	line-height: 1.8;
	color: var(--epc-nav-idle);
	text-wrap: pretty;
}

.epc-post__more {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: auto;
	padding-top: 1.5rem;
	font-family: var(--epc-font-sans);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--epc-white);
}

.epc-post__more i {
	font-size: 0.75rem;
	transition: transform 520ms var(--epc-ease-soft);
}

.epc-post:hover .epc-post__more i,
.epc-post:focus-within .epc-post__more i {
	transform: translateX(5px);
}

/* --- Reduced motion -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.epc-post,
	.epc-post__img,
	.epc-post__title a,
	.epc-post__accent,
	.epc-post__divider,
	.epc-post__index,
	.epc-post__more i {
		transition-duration: 0.01ms !important;
	}

	.epc-post:hover,
	.epc-post:focus-within {
		transform: none;
	}

	.epc-post:hover .epc-post__img,
	.epc-post:focus-within .epc-post__img {
		transform: none;
	}
}
