/**
 * Fundraisers directory — /fundraisers/ (Phase 7E-2A).
 *
 * A balanced card grid with no featured card, used for Campaign Engine
 * records and the local fallback list alike. Loaded only on /fundraisers/.
 *
 * Intentional isolation (Ryan-approved, 2026-10-13): the amount-raised,
 * goal-progress, and Meals Provided rules below deliberately repeat the
 * standard-card treatment from current-fundraisers-data.css, scoped to
 * .hcfb-fundraisers-directory, instead of loading the Ways to Give
 * stylesheets here. That keeps Ways to Give's featured-card and layout rules
 * off this page and lets either page change without affecting the other.
 * Do not extract a shared abstraction without a separate decision.
 */

.hcfb-fundraisers-directory {
	padding: clamp(2.5rem, 5vw, 4.5rem) var(--wp--preset--spacing--hcfb-page-gutter, 1.25rem) clamp(4rem, 7vw, 6rem);
	background: linear-gradient(180deg, var(--wp--preset--color--hcfb-surface) 0%, color-mix(in srgb, var(--wp--preset--color--hcfb-green) 8%, var(--wp--preset--color--hcfb-surface)) 100%);
}

.hcfb-fundraisers-directory__inner {
	width: min(100%, var(--hcfb-home-wide, 82rem));
	margin-inline: auto;
}

.hcfb-fundraisers-directory__count {
	margin: 0 0 1.25rem;
	color: var(--wp--preset--color--hcfb-green-text);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.hcfb-fundraisers-directory__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1rem, 1.6vw, 1.4rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.hcfb-fundraisers-directory__item {
	display: flex;
	min-width: 0;
	margin: 0;
}

/* Card shell. */
.hcfb-fundraiser-card {
	position: relative;
	display: flex;
	flex: 1;
	min-width: 0;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--hcfb-navy) 14%, transparent);
	border-top: 5px solid var(--wp--preset--color--hcfb-green);
	border-radius: 1rem;
	background: var(--wp--preset--color--hcfb-surface);
	box-shadow: 0 14px 34px rgba(20, 21, 60, 0.09);
	transition: transform 180ms ease, box-shadow 180ms ease;
}

.hcfb-fundraisers-directory__item:nth-child(3n + 2) .hcfb-fundraiser-card {
	border-top-color: var(--wp--preset--color--hcfb-orange);
}

.hcfb-fundraisers-directory__item:nth-child(3n) .hcfb-fundraiser-card {
	border-top-color: var(--wp--preset--color--hcfb-navy);
}

.hcfb-fundraiser-card:hover,
.hcfb-fundraiser-card:focus-within {
	transform: translateY(-4px);
	box-shadow: 0 20px 44px rgba(20, 21, 60, 0.16);
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__media {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--wp--preset--color--hcfb-cream);
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hcfb-fundraiser-card__content {
	display: flex;
	flex: 1;
	min-width: 0;
	flex-direction: column;
	padding: clamp(1.25rem, 2vw, 1.6rem);
}

/* Two classes so the generic `.wp-block-post-content h2` margins cannot win. */
.hcfb-fundraisers-directory .hcfb-fundraiser-card__name {
	margin: 0;
	color: var(--wp--preset--color--hcfb-navy);
	font-size: clamp(1.3rem, 1.8vw, 1.55rem);
	line-height: 1.12;
	letter-spacing: -0.015em;
	overflow-wrap: anywhere;
}

.hcfb-fundraiser-card__description {
	margin: 0.85rem 0 1.25rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.hcfb-fundraiser-card__cta {
	position: relative;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 0.5rem;
	min-height: 44px;
	margin-top: auto;
	border-radius: 999px;
	padding: 0.75rem 1.125rem;
	background: var(--wp--preset--color--hcfb-orange);
	color: var(--wp--preset--color--hcfb-navy);
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
}

.hcfb-fundraiser-card__cta:hover,
.hcfb-fundraiser-card__cta:focus-visible {
	background: var(--wp--preset--color--hcfb-navy);
	color: var(--wp--preset--color--hcfb-surface);
	text-decoration: none;
}

.hcfb-fundraiser-card__cta:focus-visible {
	outline: 3px solid var(--wp--preset--color--hcfb-navy);
	outline-offset: 3px;
}

/* Visually hidden fundraiser name: a unique accessible name for each identical CTA. */
.hcfb-fundraiser-card__cta-context {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Amount raised, goal progress, and Meals Provided (intentionally repeated; see header). */
.hcfb-fundraisers-directory .hcfb-current-fundraiser__progress {
	margin: 0 0 1.25rem;
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__raised {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem;
	margin: 0;
	color: var(--wp--preset--color--hcfb-green-text);
	font-weight: 800;
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__raised strong {
	color: var(--wp--preset--color--hcfb-navy);
	font-size: 1.3rem;
	line-height: 1.1;
	letter-spacing: -0.015em;
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__raised span {
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__bar {
	height: 0.5rem;
	margin-top: 0.75rem;
	overflow: hidden;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--hcfb-navy) 12%, transparent);
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__bar span {
	display: block;
	width: var(--hcfb-cf-progress, 0%);
	height: 100%;
	border-radius: inherit;
	background: var(--wp--preset--color--hcfb-green);
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__goal {
	margin: 0.5rem 0 0;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.4;
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__impact {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.3em;
	margin: -0.25rem 0 1.25rem;
	color: var(--wp--preset--color--hcfb-green-text);
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.4;
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__impact strong {
	color: inherit;
	font-size: inherit;
	font-weight: 800;
}

.hcfb-fundraisers-directory .hcfb-current-fundraiser__impact span {
	text-transform: lowercase;
}

/* Empty state: only when even the local list has nothing to show. */
.hcfb-fundraisers-directory__empty {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1rem;
	max-width: 40rem;
}

.hcfb-fundraisers-directory__empty p {
	margin: 0;
	font-size: 1.1rem;
	line-height: 1.6;
}

.hcfb-fundraisers-directory__empty-cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	border-radius: 999px;
	padding: 0.75rem 1.125rem;
	background: var(--wp--preset--color--hcfb-orange);
	color: var(--wp--preset--color--hcfb-navy);
	font-weight: 800;
	text-decoration: none;
}

.hcfb-fundraisers-directory__empty-cta:hover,
.hcfb-fundraisers-directory__empty-cta:focus-visible {
	background: var(--wp--preset--color--hcfb-navy);
	color: var(--wp--preset--color--hcfb-surface);
}

/* Hero breadcrumb: a quiet, centered wayfinding row (mirrors the Ways to Give hero treatment). */
.hcfb-fundraisers-hero .hcfb-fundraisers-breadcrumb {
	margin-bottom: var(--wp--preset--spacing--hcfb-sm, 1rem);
}

.hcfb-fundraisers-hero .hcfb-fundraisers-breadcrumb .hcfb-breadcrumbs {
	font-size: 0.8125rem;
}

.hcfb-fundraisers-hero .hcfb-fundraisers-breadcrumb .hcfb-breadcrumbs ol {
	justify-content: center;
}

@media (max-width: 1050px) {
	.hcfb-fundraisers-directory__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.hcfb-fundraisers-directory__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.hcfb-fundraiser-card__cta {
		width: 100%;
		justify-content: center;
		text-align: center;
	}
}

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

	.hcfb-fundraiser-card:hover,
	.hcfb-fundraiser-card:focus-within {
		transform: none;
	}
}

@media (forced-colors: active) {
	.hcfb-fundraiser-card,
	.hcfb-fundraiser-card__cta,
	.hcfb-fundraisers-directory__empty-cta {
		border: 2px solid CanvasText;
	}

	.hcfb-fundraisers-directory .hcfb-current-fundraiser__bar {
		forced-color-adjust: none;
		border: 1px solid CanvasText;
		background: Canvas;
	}

	.hcfb-fundraisers-directory .hcfb-current-fundraiser__bar span {
		forced-color-adjust: none;
		background: Highlight;
	}
}
