/* Card Grid section. */

.rally-card-grid { padding-block: var(--rally-section-padding-y); }

.rally-card-grid__inner {
	display: flex;
	flex-direction: column;
	gap: var(--rally-space-7);
}

.rally-card-grid__header {
	text-align: center;
	display: flex;
	flex-direction: column;
	gap: var(--rally-space-2);
	max-width: 720px;
	margin-inline: auto;
}

.rally-card-grid__eyebrow {
	font-family: var(--rally-font-body);
	font-size: var(--rally-text-sm);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: var(--rally-red);
	margin: 0;
}

.rally-card-grid__heading {
	font-size: var(--rally-text-3xl);
	margin: 0;
}

.rally-card-grid__list {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--rally-space-5);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.rally-card-grid--cols-2 .rally-card-grid__list,
	.rally-card-grid--cols-3 .rally-card-grid__list,
	.rally-card-grid--cols-4 .rally-card-grid__list,
	.rally-card-grid--cols-5 .rally-card-grid__list {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (min-width: 900px) {
	.rally-card-grid--cols-3 .rally-card-grid__list { grid-template-columns: repeat(3, 1fr); }
	.rally-card-grid--cols-4 .rally-card-grid__list { grid-template-columns: repeat(4, 1fr); }
	.rally-card-grid--cols-5 .rally-card-grid__list { grid-template-columns: repeat(5, 1fr); }
}

.rally-card-grid__item { list-style: none; }

/* ============================================================
 * Card base — shared shell, hover lift, motion guards.
 * ============================================================ */

.rally-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--rally-white);
	/* overflow:visible by default so the button's drop shadow can extend
	 * past the card's bottom edge. Image-background variant overrides this
	 * because that one needs to clip the full-bleed scaling image. */
	transition:
		transform 250ms var(--rally-ease),
		box-shadow 250ms var(--rally-ease);
}

.rally-card-grid--image-background .rally-card {
	overflow: hidden;
}

.rally-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

@media (prefers-reduced-motion: reduce) {
	.rally-card,
	.rally-card:hover { transform: none; transition: none; }
	.rally-card__media img,
	.rally-card:hover .rally-card__media img { transform: none !important; }
}

/* ============================================================
 * Image-Top (default) — Ford-style category card.
 *   Big image, bold title with animated red accent under it,
 *   image zooms gently on hover.
 * ============================================================ */

.rally-card-grid--image-top .rally-card {
	border-top: 4px solid transparent;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transition:
		transform 250ms var(--rally-ease),
		box-shadow 250ms var(--rally-ease),
		border-color 250ms var(--rally-ease);
}

.rally-card-grid--image-top .rally-card:hover {
	border-top-color: var(--rally-red);
}

/* "Pop" treatment for content card grids — e.g. the homepage "Your Trusted
   Choice of Utility Equipment" category tiles. Solid black stroke + depth
   shadow, lifting with a red border on hover. Scoped away from the filterable
   trailer listing grids so those cards stay clean. */
.rally-card-grid--image-top:not(.rally-card-grid--filterable) .rally-card {
	border: 3px solid var(--rally-black);
	border-top-width: 4px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.rally-card-grid--image-top:not(.rally-card-grid--filterable) .rally-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 46px rgba(0, 0, 0, 0.30);
	border-color: var(--rally-red);
}

.rally-card-grid--image-top .rally-card__media {
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--rally-gray-light);
}

.rally-card-grid--image-top .rally-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform-origin: center;
	transition: transform 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rally-card-grid--image-top .rally-card:hover .rally-card__media img {
	transform: scale(1.12);
}

.rally-card-grid--image-top .rally-card__media::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.18) 100%);
	opacity: 0;
	transition: opacity 320ms ease;
	pointer-events: none;
}

.rally-card-grid--image-top .rally-card:hover .rally-card__media::after { opacity: 1; }

.rally-card-grid--image-top .rally-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--rally-space-2);
	padding: var(--rally-space-4) var(--rally-space-4) var(--rally-space-5);
	flex: 1;
}

.rally-card-grid--image-top .rally-card__title {
	font-size: var(--rally-text-xl);
	letter-spacing: 0.04em;
	margin: 0;
	padding-bottom: var(--rally-space-2);
	position: relative;
}

.rally-card-grid--image-top .rally-card__title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 40px;
	height: 3px;
	background: var(--rally-red);
	transition: width 300ms var(--rally-ease);
}

.rally-card-grid--image-top .rally-card:hover .rally-card__title::after {
	width: 72px;
}

.rally-card-grid--image-top .rally-card__model {
	font-family: var(--rally-font-body);
	font-size: var(--rally-text-sm);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--rally-red);
	margin: 0;
}

.rally-card-grid--image-top .rally-card__text {
	font-size: var(--rally-text-base);
	line-height: 1.6;
	color: var(--rally-gray-dark);
	margin: 0;
}

.rally-card-grid--image-top .rally-card__button {
	align-self: flex-start;
	/* margin-top:auto pushes the button to the bottom of the body, no matter
	 * how much (or how little) content sits above it. Every card's button
	 * lines up on a horizontal line across the row. */
	margin-top: auto;
	font-size: 14px;
	padding: 10px 22px;
}

/* ============================================================
 * Image-Background — Cotopaxi/Nike style. Tall card with image
 * filling the whole tile, dark gradient at the bottom, big
 * uppercase title overlaid.
 * ============================================================ */

.rally-card-grid--image-background .rally-card {
	position: relative;
	aspect-ratio: 4 / 5;
	color: var(--rally-white);
	background: var(--rally-black);
	isolation: isolate;
}

.rally-card-grid--image-background .rally-card__media {
	position: absolute;
	inset: 0;
	overflow: hidden;
	z-index: 0;
	background: var(--rally-gray-dark);
}

.rally-card-grid--image-background .rally-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 600ms var(--rally-ease);
}

.rally-card-grid--image-background .rally-card:hover .rally-card__media img {
	transform: scale(1.06);
}

.rally-card-grid--image-background .rally-card::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 25%, rgba(0, 0, 0, 0.85) 100%);
	z-index: 1;
	pointer-events: none;
	transition: background 300ms var(--rally-ease);
}

.rally-card-grid--image-background .rally-card:hover::after {
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 20%, rgba(0, 0, 0, 0.9) 100%);
}

.rally-card-grid--image-background .rally-card__body {
	position: relative;
	z-index: 2;
	margin-top: auto;
	display: flex;
	flex-direction: column;
	gap: var(--rally-space-2);
	padding: var(--rally-space-5);
}

.rally-card-grid--image-background .rally-card__title {
	font-size: var(--rally-text-2xl);
	color: var(--rally-white);
	margin: 0;
	letter-spacing: 0.05em;
	transition: transform 300ms var(--rally-ease);
}

.rally-card-grid--image-background .rally-card:hover .rally-card__title {
	transform: translateY(-4px);
}

.rally-card-grid--image-background .rally-card__text {
	font-size: var(--rally-text-base);
	line-height: 1.5;
	color: var(--rally-white);
	opacity: 0.9;
	margin: 0;
}

.rally-card-grid--image-background .rally-card__button {
	align-self: flex-start;
	margin-top: var(--rally-space-3);
	font-size: 14px;
	padding: 10px 22px;
}

/* ============================================================
 * Icon-Top — minimal, centered, for value-prop / feature lists.
 * ============================================================ */

.rally-card-grid--icon-top .rally-card {
	text-align: center;
	align-items: center;
	padding: var(--rally-space-5);
	background: var(--rally-white);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.rally-card-grid--icon-top .rally-card__media {
	width: 56px;
	height: 56px;
	background: transparent;
	margin-bottom: var(--rally-space-2);
	overflow: visible;
}

.rally-card-grid--icon-top .rally-card__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.rally-card-grid--icon-top .rally-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--rally-space-2);
	align-items: center;
	padding: 0;
}

.rally-card-grid--icon-top .rally-card__title {
	font-size: var(--rally-text-lg);
	margin: 0;
}

.rally-card-grid--icon-top .rally-card__text {
	font-size: var(--rally-text-sm);
	line-height: 1.6;
	color: var(--rally-gray-dark);
	margin: 0;
}

.rally-card-grid--icon-top .rally-card__button {
	margin-top: auto;
	font-size: 14px;
	padding: 10px 22px;
}
