/**
 * Keystone Theme - Latest Posts Card Grid
 */

/* Section wrapper — sits inside an alignwide block (max 1340px).
 * No horizontal padding: the parent alignwide block handles margins.
 * This matches how keystone-hp-section works on the homepage. */
.keystone-latest-posts {
	width: 100%;
	padding-top: var(--wp--preset--spacing--50);
	padding-bottom: var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--accent-6);
	margin-top: var(--wp--preset--spacing--50);
}

/* Section heading */
.keystone-latest-posts__heading {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	margin: 0 0 var(--wp--preset--spacing--50) 0;
	color: var(--wp--preset--color--contrast);
}

/* 3-column grid — fills the full section width */
.keystone-latest-posts__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--wp--preset--spacing--40);
}

@media (max-width: 900px) {
	.keystone-latest-posts__grid {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--40);
	}
}

/* Card */
.keystone-post-card {
	border-radius: 12px;
	overflow: hidden;
	position: relative;
	min-height: 460px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15);
	transition: box-shadow 0.2s ease;
}

.keystone-post-card:hover {
	box-shadow: 0 2px 3px rgba(0,0,0,0.3), 0 6px 10px 4px rgba(0,0,0,0.15);
}

@media (max-width: 900px) {
	.keystone-post-card {
		min-height: 400px;
	}
}

/* Full-card link */
.keystone-post-card__link {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	height: 100%;
	min-height: inherit;
	text-decoration: none;
	color: #fff;
	position: relative;
	border-radius: 12px;
	overflow: hidden;
}

/* Background image layer */
.keystone-post-card__bg {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform 0.4s ease;
}

.keystone-post-card:hover .keystone-post-card__bg,
.keystone-post-card__link:hover .keystone-post-card__bg {
	transform: scale(1.04);
}

/* Gradient overlay */
.keystone-post-card__overlay {
	position: relative;
	z-index: 1;
	padding: 24px;
	background: linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0) 0%,
		rgba(0, 0, 0, 0.6) 20%,
		rgba(0, 0, 0, 0.88) 100%
	);
}

/* Author row */
.keystone-post-card__author {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}

.keystone-post-card__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 2px solid rgba(255, 255, 255, 0.25);
}

.keystone-post-card__author-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.keystone-post-card__author-name {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: #fff;
	line-height: 1.3;
}

.keystone-post-card__author-role {
	font-size: 0.75rem;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.75);
	line-height: 1.3;
}

/* Article title */
.keystone-post-card__title {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 700;
	line-height: 1.35;
	color: #fff;
	margin: 0 0 16px 0;
}

/* Bottom meta row */
.keystone-post-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
}

.keystone-post-card__category {
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.65);
	line-height: 1.4;
}

.keystone-post-card__reading-time,
.keystone-post-card__updated {
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.5);
	line-height: 1.4;
}

.keystone-post-card__meta-dot {
	font-size: 0.7rem;
	color: rgba(255, 255, 255, 0.35);
	line-height: 1.4;
}
