/**
 * Current Fundraisers — isolated card section on /ways-to-give/.
 */

.hcfb-current-fundraisers {
	padding: clamp(4rem, 7vw, 6.5rem) var(--wp--preset--spacing--hcfb-page-gutter, 1.25rem);
	background:
		radial-gradient(circle at 8% 8%, color-mix(in srgb, var(--wp--preset--color--hcfb-orange) 10%, transparent) 0 8rem, transparent 8.1rem),
		linear-gradient(135deg, color-mix(in srgb, var(--wp--preset--color--hcfb-green) 10%, var(--wp--preset--color--hcfb-surface)) 0%, var(--wp--preset--color--hcfb-surface) 72%);
}

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

.hcfb-current-fundraisers__eyebrow {
	margin: 0 0 0.75rem;
	color: var(--wp--preset--color--hcfb-green-text);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.hcfb-current-fundraisers .hcfb-current-fundraisers__heading {
	margin: 0;
	max-width: 11ch;
	color: var(--wp--preset--color--hcfb-navy);
	font-size: clamp(2.5rem, 5vw, 4.5rem);
	line-height: 0.98;
	letter-spacing: -0.035em;
}

.hcfb-current-fundraisers__intro {
	max-width: 46rem;
	margin: 1.25rem 0 0;
	font-size: clamp(1.05rem, 1.6vw, 1.25rem);
	line-height: 1.65;
}

.hcfb-current-fundraisers__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: minmax(13.5rem, auto);
	gap: clamp(1rem, 1.6vw, 1.4rem);
	margin-top: clamp(2.5rem, 5vw, 4rem);
}

.hcfb-current-fundraiser {
	position: relative;
	display: flex;
	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, border-color 180ms ease;
}

.hcfb-current-fundraiser:first-child {
	grid-column: span 2;
	grid-row: span 2;
	border-color: var(--wp--preset--color--hcfb-navy);
	border-top-color: var(--wp--preset--color--hcfb-orange);
	background: var(--wp--preset--color--hcfb-navy);
	box-shadow: 0 20px 48px rgba(20, 21, 60, 0.2);
}

.hcfb-current-fundraiser:first-child::before,
.hcfb-current-fundraiser:first-child::after {
	position: absolute;
	content: "";
	pointer-events: none;
}

.hcfb-current-fundraiser:first-child::before {
	width: clamp(11rem, 20vw, 18rem);
	aspect-ratio: 1;
	right: clamp(-8rem, -8vw, -4rem);
	top: clamp(-8rem, -8vw, -4rem);
	border: clamp(1.25rem, 2vw, 2rem) solid color-mix(in srgb, var(--wp--preset--color--hcfb-green) 35%, transparent);
	border-radius: 50%;
}

.hcfb-current-fundraiser:first-child::after {
	width: 8rem;
	height: 8rem;
	right: 12%;
	bottom: -5.5rem;
	border-radius: 50%;
	background: color-mix(in srgb, var(--wp--preset--color--hcfb-orange) 24%, transparent);
}

.hcfb-current-fundraiser:nth-child(3) {
	border-top-color: var(--wp--preset--color--hcfb-orange);
}

.hcfb-current-fundraiser:nth-child(4) {
	border-top-color: var(--wp--preset--color--hcfb-navy);
	background: color-mix(in srgb, var(--wp--preset--color--hcfb-green) 7%, var(--wp--preset--color--hcfb-surface));
}

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

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

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

.hcfb-current-fundraiser__content {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 1;
	min-width: 0;
	flex-direction: column;
	padding: clamp(1.5rem, 2vw, 1.75rem);
}

.hcfb-current-fundraiser:first-child .hcfb-current-fundraiser__content {
	padding: clamp(2rem, 2.5vw, 2.125rem);
}

/* Two classes so the generic `.wp-block-post-content h3` top margin cannot win. */
.hcfb-current-fundraisers .hcfb-current-fundraiser__name {
	margin: 0;
	color: var(--wp--preset--color--hcfb-navy);
	font-size: clamp(1.4rem, 2vw, 1.75rem);
	line-height: 1.08;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}

.hcfb-current-fundraisers .hcfb-current-fundraiser:first-child .hcfb-current-fundraiser__name {
	max-width: 12ch;
	color: var(--wp--preset--color--hcfb-surface);
	font-size: clamp(2.25rem, 4.5vw, 4rem);
	line-height: 0.98;
}

.hcfb-current-fundraiser__description {
	margin: 1rem 0 1.75rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.hcfb-current-fundraiser:first-child .hcfb-current-fundraiser__description {
	max-width: 38rem;
	color: color-mix(in srgb, var(--wp--preset--color--hcfb-surface) 88%, transparent);
	font-size: clamp(1.05rem, 1.5vw, 1.2rem);
}

.hcfb-current-fundraiser__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;
}

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

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

.hcfb-current-fundraiser:first-child .hcfb-current-fundraiser__cta:hover,
.hcfb-current-fundraiser:first-child .hcfb-current-fundraiser__cta:focus-visible {
	background: var(--wp--preset--color--hcfb-surface);
	color: var(--wp--preset--color--hcfb-navy);
}

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

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

	.hcfb-current-fundraiser:first-child {
		grid-column: auto;
		grid-row: span 2;
	}
}

@media (max-width: 850px) {
	.hcfb-current-fundraisers__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		grid-auto-rows: auto;
	}

	.hcfb-current-fundraiser:first-child {
		grid-column: 1 / -1;
		grid-row: auto;
	}
}

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

	.hcfb-current-fundraiser:first-child {
		grid-column: auto;
	}

	.hcfb-current-fundraisers .hcfb-current-fundraisers__heading {
		font-size: clamp(2.4rem, 14vw, 3.5rem);
	}

	.hcfb-current-fundraiser:first-child .hcfb-current-fundraiser__content {
		min-height: 20rem;
		padding: 2rem 1.5rem;
	}

	.hcfb-current-fundraiser__cta {
		width: 100%;
		justify-content: center;
		text-align: center;
	}
}

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

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

@media (forced-colors: active) {
	.hcfb-current-fundraiser,
	.hcfb-current-fundraiser__cta {
		border: 2px solid CanvasText;
	}
}

/* Optional fundraiser impact metric. The value may later come from Campaign Engine. */
.hcfb-current-fundraiser__impact {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.15rem;
	margin: 0 0 1.25rem;
	color: var(--wp--preset--color--hcfb-green-text);
}

.hcfb-current-fundraiser__impact strong {
	color: var(--wp--preset--color--hcfb-navy);
	font-size: clamp(1.75rem, 2.5vw, 2.25rem);
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.025em;
}

.hcfb-current-fundraiser__impact span {
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.hcfb-current-fundraiser:first-child .hcfb-current-fundraiser__impact {
	color: color-mix(in srgb, var(--wp--preset--color--hcfb-surface) 78%, transparent);
}

.hcfb-current-fundraiser:first-child .hcfb-current-fundraiser__impact strong {
	color: var(--wp--preset--color--hcfb-orange);
}
