/**
 * Cards (design-system.md §5).
 *
 * One structure, four content variants. Only the article variant exists at M3,
 * because related guides need it; template, product, and topic-door land with
 * the card grids in M5.
 *
 * **The whole card is one link.** The `::after` overlay stretches the title's
 * anchor across the card, which gives a full-card hit area with exactly one
 * focusable element — no nested interactive traps, and the title is the
 * accessible name.
 */

.ait-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	border: var(--border-hair);
	border-radius: var(--r-md);
	background: var(--c-surface);
	box-shadow: var(--shadow-1);
	overflow: hidden;
	transition:
		box-shadow var(--t-fast) var(--ease),
		transform var(--t-fast) var(--ease);
}

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

.ait-card__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.ait-card__body {
	padding: var(--s-4);
}

.ait-card__title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: var(--fs-h4);
	line-height: var(--lh-h4);
}

/* The excerpt sits under the title on every browse surface. Clamped rather than
   truncated server-side so the full sentence stays in the markup for a crawler
   and a screen reader, while the grid keeps even card heights. */
.ait-card__excerpt {
	margin: var(--s-2) 0 0;
	color: var(--c-ink-muted);
	font-size: var(--fs-small);
	line-height: var(--lh-body);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ait-card__link {
	color: var(--c-primary);
	text-decoration: none;
}

.ait-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.ait-card__link:hover {
	text-decoration: underline;
}

.ait-card__link:focus-visible {
	outline: var(--focus-width) solid var(--focus-color);
	outline-offset: var(--focus-offset);
}

@media (prefers-reduced-motion: reduce) {
	.ait-card {
		transition: none;
	}

	.ait-card:hover {
		transform: none;
	}
}
