/* =========================================================================
   MACHINE FUNDRAISER — homepage section (temporary Donor Wall replacement)
   =========================================================================
   Loaded only on the front page while the section is switched on. Uses the
   existing design tokens from main.css; no new colors or fonts.
   Template: template-parts/front-page/machine-fundraiser.php
   ========================================================================= */

.machine-fund {
	position: relative;
	padding-block: var(--space-2xl);
	background-color: var(--color-teal-100);
}

.machine-fund__anchor {
	position: absolute;
	top: 0;
	left: 0;
	width: 0;
	height: 0;
}

/* --- Picture + information --- */
.machine-fund__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-xl);
	align-items: start;
	margin-bottom: var(--space-xl);
}

.machine-fund__media {
	margin: 0;
	background-color: var(--color-white);
	border: 1px solid var(--color-line);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(11, 51, 43, 0.08);
}

.machine-fund__image {
	display: block;
	width: 100%;
	height: auto;
}

.machine-fund__placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--space-sm);
	min-height: 280px;
	padding: var(--space-lg);
	text-align: center;
	color: var(--color-teal-700);
	font-size: var(--text-sm);
}

.machine-fund__placeholder svg {
	width: 56px;
	height: 56px;
}

.machine-fund__name {
	margin: 0 0 var(--space-sm);
	font-size: var(--text-xl);
	color: var(--color-teal-900);
}

.machine-fund__text {
	margin: 0 0 var(--space-md);
}

.machine-fund__facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: var(--space-sm);
	margin: var(--space-lg) 0;
}

.machine-fund__fact {
	background-color: var(--color-white);
	border: 1px solid var(--color-line);
	border-radius: var(--radius-md);
	padding: var(--space-sm) var(--space-md);
}

.machine-fund__fact dt {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-teal-900);
	opacity: 0.6;
}

.machine-fund__fact dd {
	margin: 0;
	font-weight: 600;
	color: var(--color-teal-900);
	word-break: break-word;
}

.machine-fund__why-heading {
	margin: 0 0 var(--space-xs);
	font-size: var(--text-base, 1rem);
	color: var(--color-teal-700);
}

.machine-fund__why-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.machine-fund__why-list li {
	position: relative;
	padding-inline-start: 1.5rem;
	margin-bottom: var(--space-xs);
}

.machine-fund__why-list li::before {
	content: "";
	position: absolute;
	inset-inline-start: 0;
	top: 0.55em;
	width: 0.6rem;
	height: 0.6rem;
	border-radius: 50%;
	background-color: var(--color-gold-500);
}

/* --- Progress bar --- */
.machine-fund__progress,
.machine-fund__details {
	background-color: var(--color-white);
	border: 1px solid var(--color-line);
	border-radius: var(--radius-md);
	padding: var(--space-xl);
	box-shadow: 0 8px 30px rgba(11, 51, 43, 0.08);
}

.machine-fund__progress {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	margin-bottom: var(--space-xl);
}

.machine-fund__figures {
	display: flex;
	justify-content: space-between;
	gap: var(--space-md);
}

.machine-fund__figure {
	display: flex;
	flex-direction: column;
	gap: var(--space-2xs);
}

.machine-fund__figure--goal {
	text-align: end;
}

.machine-fund__figure-label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-teal-900);
	opacity: 0.65;
}

.machine-fund__figure-value {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: var(--text-lg);
	color: var(--color-teal-900);
}

.machine-fund__bar {
	position: relative;
	width: 100%;
	height: 16px;
	border-radius: var(--radius-pill);
	background-color: rgba(10, 10, 10, 0.1);
	overflow: hidden;
}

.machine-fund__bar-fill {
	display: block;
	height: 100%;
	border-radius: var(--radius-pill);
	background-color: var(--color-gold-500);
	transition: width var(--duration-base) var(--ease-standard);
}

.machine-fund__percent {
	margin: 0;
	font-weight: 600;
	font-size: var(--text-sm);
	color: var(--color-teal-700);
}

.machine-fund__note {
	margin: 0;
	font-size: var(--text-sm);
	opacity: 0.75;
}

/* --- Donation details --- */
.machine-fund__details-heading {
	margin: 0 0 var(--space-xs);
	font-size: var(--text-lg);
	color: var(--color-teal-900);
}

.machine-fund__details-intro {
	margin: 0 0 var(--space-md);
}

.machine-fund__bank {
	margin: 0 0 var(--space-md);
	padding: 0;
}

.machine-fund__bank-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-xs) var(--space-md);
	padding-block: var(--space-sm);
	border-bottom: 1px dashed var(--color-line);
}

.machine-fund__bank-row:last-child {
	border-bottom: none;
}

.machine-fund__bank-label {
	flex: 1 1 120px;
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--color-ink);
	opacity: 0.6;
}

.machine-fund__bank-value {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: var(--space-sm);
	flex: 1 1 auto;
	margin: 0;
	font-weight: 600;
	text-align: end;
}

.machine-fund__bank-value span {
	word-break: break-word;
}

.machine-fund__copy {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2xs);
	flex-shrink: 0;
	background-color: var(--color-teal-100);
	color: var(--color-teal-700);
	border: none;
	border-radius: var(--radius-sm);
	padding: 0.35rem 0.6rem;
	font-family: var(--font-body);
	font-size: var(--text-xs);
	font-weight: 600;
	cursor: pointer;
	transition: background-color var(--duration-fast) var(--ease-standard),
	            color var(--duration-fast) var(--ease-standard);
}

.machine-fund__copy svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.machine-fund__copy:hover,
.machine-fund__copy:focus {
	background-color: var(--color-gold-500);
	color: var(--color-teal-900);
}

.machine-fund__copy.is-copied {
	background-color: #25d366;
	color: var(--color-white);
}

.machine-fund__details-note {
	margin: 0 0 var(--space-md);
	font-size: var(--text-sm);
	opacity: 0.8;
}

.machine-fund__actions {
	display: flex;
	justify-content: center;
}

/* --- Larger screens: picture left, info right --- */
@media (min-width: 52em) {
	.machine-fund__layout {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
		gap: var(--space-2xl);
	}
}

/* --- Phones --- */
@media (max-width: 36em) {
	.machine-fund__progress,
	.machine-fund__details {
		padding: var(--space-lg);
	}
}

@media (max-width: 23.75em) {
	.machine-fund__bank-row {
		flex-direction: column;
		align-items: stretch;
		gap: var(--space-2xs);
	}

	.machine-fund__bank-value {
		justify-content: space-between;
		text-align: start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.machine-fund__bar-fill {
		transition: none;
	}
}


/* --- Two machine sizes (Option 1 / Option 2) --- */
.machine-fund__problem {
	max-width: 48rem;
	margin: 0 auto var(--space-xl);
}

/* Text + "why" side by side so there is no empty margin on wide screens */
.machine-fund__problem--split {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-lg);
	max-width: none;
	align-items: start;
}

.machine-fund__problem--split .machine-fund__why {
	background-color: var(--color-white);
	border: 1px solid var(--color-line);
	border-radius: var(--radius-md);
	padding: var(--space-lg);
}

.machine-fund__problem-main > :last-child {
	margin-bottom: 0;
}

.machine-fund__options {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-xl);
	margin-bottom: var(--space-xl);
}

.machine-fund__option {
	display: flex;
	flex-direction: column;
	height: 100%;
	background-color: var(--color-white);
	border: 1px solid var(--color-line);
	border-radius: var(--radius-md);
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(11, 51, 43, 0.08);
}

/* Both pictures share one frame so the cards line up and never leave gaps,
   whatever shape the uploaded photos are. */
.machine-fund__option .machine-fund__media {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	aspect-ratio: 4 / 3;
}

.machine-fund__option .machine-fund__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.machine-fund__option .machine-fund__placeholder {
	height: 100%;
	min-height: 0;
}

.machine-fund__option-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--space-lg);
}

/* Key details: one tidy column per card, rows stretch to fill the card */
.machine-fund__option .machine-fund__facts {
	flex: 1;
	grid-template-columns: minmax(0, 1fr);
	align-content: stretch;
	grid-auto-rows: 1fr;
	margin: var(--space-sm) 0 0;
}

.machine-fund__option .machine-fund__fact {
	display: flex;
	flex-direction: column;
	justify-content: center;
	background-color: var(--color-teal-100);
	border: 0;
}

.machine-fund__option-tag {
	align-self: flex-start;
	margin-bottom: var(--space-sm);
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	background-color: var(--color-teal-100);
	color: var(--color-teal-900);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* --- One shared bar, a marker per machine --- */
.machine-fund__track {
	position: relative;
	padding-top: 2rem;
}

.machine-fund__tick {
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	background-color: var(--color-teal-900);
	color: var(--color-white);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-weight: 700;
	z-index: 1;
}

.machine-fund__tick::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	width: 2px;
	height: 0.5rem;
	margin-left: -1px;
	background-color: var(--color-teal-900);
}

.machine-fund__tick.is-end {
	transform: translateX(-100%);
}

.machine-fund__tick.is-end::after {
	left: auto;
	right: 0;
	margin-left: 0;
}

.machine-fund__tick.is-reached {
	background-color: var(--color-gold-500);
	color: var(--color-teal-900);
}

.machine-fund__milestones {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: var(--space-sm);
}

.machine-fund__milestone {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-sm) var(--space-md);
	border: 1px solid var(--color-line);
	border-radius: var(--radius-md);
	background-color: var(--color-teal-100);
}

.machine-fund__milestone.is-reached {
	border-color: var(--color-gold-500);
}

.machine-fund__milestone.is-winner {
	background-color: var(--color-gold-500);
}

.machine-fund__milestone-num {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	background-color: var(--color-teal-900);
	color: var(--color-white);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-weight: 700;
}

.machine-fund__milestone-text {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	color: var(--color-teal-900);
}

.machine-fund__milestone-text strong {
	word-break: break-word;
}

.machine-fund__milestone-status {
	flex-shrink: 0;
	font-size: var(--text-sm);
	font-weight: 600;
	text-align: end;
	color: var(--color-teal-700);
}

.machine-fund__milestone.is-winner .machine-fund__milestone-status {
	color: var(--color-teal-900);
}

@media (min-width: 52em) {
	.machine-fund__options {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.machine-fund__problem--split {
		grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
		gap: var(--space-xl);
	}
}

.machine-fund__fact--price {
	background-color: var(--color-gold-500) !important;
}
