/*
 * am-article-card — an article/insight teaser. Website articles do the SEO job:
 * people find the site through a piece that matched their search, which becomes
 * an entry point into the funnel. This is the teaser in a listing.
 *
 * Structure:
 *   am-article-card                 (an <article>)
 *     am-article-card__media        optional thumbnail
 *     am-article-card__body
 *       am-article-card__meta       date · tag
 *       am-article-card__title      h3 wrapping the link
 *         am-article-card__link     the article link (stretched over the card)
 *       am-article-card__excerpt    the teaser sentence
 *
 * The link is stretched across the whole card so the entire teaser is one target,
 * while the visible link text stays the accessible name.
 */

.am-article-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background-color: var(--am-color-surface);
	border: 1px solid var(--am-color-border);
	border-radius: var(--am-radius-lg);
	overflow: hidden;
	transition: box-shadow var(--am-transition), transform var(--am-transition);
}

.am-article-card:hover {
	box-shadow: var(--am-shadow-md);
	transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
	.am-article-card:hover {
		transform: none;
	}
}

.am-article-card__media img {
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.am-article-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--am-space-300);
	padding: var(--am-space-500);
}

.am-article-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--am-space-300);
	color: var(--am-color-text-muted);
	font-size: var(--am-font-size-200);
	letter-spacing: var(--am-tracking-wide);
	text-transform: uppercase;
}

.am-article-card__title {
	margin-block: 0;
	font-family: var(--am-font-sans); /* small heading — Archivo bold, not Black */
	font-weight: var(--am-weight-bold);
	font-size: var(--am-font-size-500);
	line-height: var(--am-leading-snug);
	letter-spacing: normal;
}

.am-article-card__link {
	color: var(--am-color-heading);
	text-decoration: none;
}

.am-article-card__link:hover {
	color: var(--am-color-accent);
}

/* Stretch the link across the card so the whole teaser is clickable. */
.am-article-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.am-article-card__excerpt {
	margin-block: 0;
	color: var(--am-color-text);
}

/* Keep the visible focus ring on the card, not just the hidden link edge. */
.am-article-card:focus-within {
	outline: var(--am-focus-ring);
	outline-offset: var(--am-focus-offset);
}

.am-article-card__link:focus-visible {
	outline: none;
}

/* Listing grid. */
.am-article-grid {
	display: grid;
	gap: var(--am-space-500);
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.am-article-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.am-article-grid--3 {
		grid-template-columns: repeat(3, 1fr);
	}
}
