/* Carte d'article — réutilisée par index.php, archive.php, search.php,
   single.php (articles similaires) via inc/template-tags.php::afrotheme_post_card(). */

/* Radius resserré (--radius-sm, 10px) plutôt que --radius (16px, utilisé partout
   ailleurs dans le thème) : demande explicite de coller de plus près à la référence
   visuelle pour cette card précisément, pas un changement global. */
.afrotheme-post-card {
	display: flex;
	flex-direction: column;
	background: var(--color-bg-card);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-card);
	overflow: hidden;
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.afrotheme-post-card:hover {
	box-shadow: var(--shadow-card-hover);
	transform: translateY(-3px);
}

.afrotheme-post-card__image {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.afrotheme-post-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.afrotheme-post-card__body {
	padding: var(--space-md);
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	flex: 1 1 auto;
}

.afrotheme-post-card__title {
	margin: 0;
	font-size: var(--text-lg);
}

.afrotheme-post-card__title a {
	text-decoration: none;
	color: var(--color-text);
}

.afrotheme-post-card__title a:hover {
	color: var(--color-accent-hover);
}

.afrotheme-post-card__excerpt {
	margin: 0;
	font-size: var(--text-sm);
	color: var(--color-text-2);
	line-height: 1.5;
}

.afrotheme-post-card__footer {
	margin-top: auto;
	padding-top: var(--space-xs);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.afrotheme-post-card__author {
	font-size: var(--text-xs);
	color: var(--color-text-2);
}

.afrotheme-post-card__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: var(--border-width) solid var(--color-border);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--color-text-2);
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.afrotheme-post-card__link svg {
	width: 16px;
	height: 16px;
}

.afrotheme-post-card__link:hover,
.afrotheme-post-card__link:focus-visible {
	background: var(--color-accent);
	border-color: var(--color-accent);
	color: var(--color-bg);
}

/* Variante liste horizontale, utilisée par search.php. */
.afrotheme-post-card--row {
	flex-direction: row;
	align-items: stretch;
}

.afrotheme-post-card--row .afrotheme-post-card__image {
	flex: 0 0 200px;
	aspect-ratio: auto;
}

@media (max-width: 600px) {
	.afrotheme-post-card--row {
		flex-direction: column;
	}

	.afrotheme-post-card--row .afrotheme-post-card__image {
		flex-basis: auto;
		aspect-ratio: 4 / 3;
	}
}
