/* Post Card Component
 * Column layout with visual-first image via CSS order
 */

.post-card {
	--post-card-bg: #ffffff;
	--post-card-radius: var(--card-rounded, 8px);
	--post-card-shadow: 2px 2px 10px 0px rgba(195, 198, 203, 0.3);

	--post-card-title-color: #262626;
	--post-card-title-size: 22px;
	--post-card-title-hover-color: #1578f8;

	--post-card-lede-color: #555555;

	--post-card-tag-color: #444242;
	--post-card-tag-prefix-color: #bcbcbc;

	--post-card-meta-color: #777777;
	--post-card-date-size: 12px;

	display: flex;
	flex-direction: column;
	gap: 0;
	width: 100%;
	background-color: var(--post-card-bg);
	border-radius: var(--post-card-radius);
	box-shadow: var(--post-card-shadow);
	height: 100%;
	overflow: hidden;
	position: relative;
}

/* Clickable card — title link covers entire card */

.clickable-parent a::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* Media — rendered last in DOM, displayed first via order */

.post-card__media-wrapper {
	order: -1;
	aspect-ratio: 5 / 3;
	overflow: hidden;
}

.post-card__media {
	height: 100%;
	margin: 0;
	padding: 0;
	line-height: 0;
}

.post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: var(--post-card-radius) var(--post-card-radius) 0 0;
}

/* Body */

.post-card__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px 24px;
}

/* Title */

.post-card__title {
	color: var(--post-card-title-color);
	font-weight: 700;
	font-size: var(--post-card-title-size);
	margin: 0;
	line-height: 1.3;
}

.post-card__title-link {
	color: var(--post-card-title-color);
}

.post-card__title-link:hover {
	color: var(--post-card-title-hover-color);
}

/* Lede / Excerpt */

.post-card__lede {
	color: var(--post-card-lede-color);
	font-size: 15px;
	line-height: 1.5;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Footer */

.post-card__footer {
	display: flex;
	flex-direction: row;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

/* Date */

.post-card__date {
	font-size: var(--post-card-date-size);
	color: var(--post-card-meta-color);
}

/* Tags */

.post-card__tags {
	display: flex;
	flex-direction: row;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.post-card__tag {
	display: inline-flex;
	color: var(--post-card-tag-color);
	font-size: 13px;
	position: relative;
	z-index: 1;
}

.post-card__tag-prefix {
	color: var(--post-card-tag-prefix-color);
}

/* Author */

.post-card__author {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
	color: var(--post-card-meta-color);
	font-size: 14px;
}

.post-card__author-avatar img {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: block;
}

/* Edit link */

.post-card__edit {
	margin-left: auto;
	position: relative;
	z-index: 1;
}

/* Accessibility: visually hidden */

.post-card__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Responsive */

@media (max-width: 767px) {
	.post-card__body {
		padding: 16px;
	}

	.post-card__title {
		font-size: 18px;
		line-height: 1.2;
	}

	.post-card__lede {
		font-size: 14px;
		-webkit-line-clamp: 2;
	}

	.post-card__date {
		font-size: 11px;
	}
}
