/* ══════════════════════════════════════════════════════════════════════
   Fire Fund — Frontend Styles
   ══════════════════════════════════════════════════════════════════════ */

:root {
	--fire-fund-accent: #f03f5c;
	--fire-fund-accent-dim: rgba(240, 63, 92, 0.06);
	--fire-fund-accent-glow: rgba(240, 63, 92, 0.2);
	--ff-green: #22C55E;
	--ff-radius: 4px;
}

/* ── Wrap & Theme ───────────────────────────────────────────────────── */

.fire-fund-wrap {
	max-width: 720px;
	margin: 0 auto;
	font-family: inherit;
}

.fire-fund-wrap.ff-align-left   { margin-left: 0; margin-right: auto; }
.fire-fund-wrap.ff-align-center { margin-left: auto; margin-right: auto; }
.fire-fund-wrap.ff-align-right  { margin-left: auto; margin-right: 0; }

.fire-fund-wrap.ff-theme-dark {
	background: var(--wp--preset--color--background, #111);
	color: var(--wp--preset--color--foreground, #e8e8e8);
	padding: 32px;
	border-radius: 12px;
}

.fire-fund-wrap.ff-theme-light {
	background: var(--wp--preset--color--background, #fff);
	color: var(--wp--preset--color--foreground, #111);
	padding: 32px;
	border-radius: 12px;
	border: 1px solid rgba(128,128,128,0.15);
}

/* ── Campaign Title (use h2 not h1 — it's in a shortcode, not the page title) ── */

.ff-campaign-title {
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 8px;
	line-height: 1.2;
}

/* ── Status Notice ──────────────────────────────────────────────────── */

.ff-status-notice {
	text-align: center;
}

.ff-status-notice p {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
}

/* ── Progress-only CTA ──────────────────────────────────────────────── */

.ff-progress-cta {
	margin-top: 16px;
}

/* ── Progress Bar ────────────────────────────────────────────────────── */

.ff-progress {
	margin: 24px 0;
}

.ff-progress-bar,
.ff-card-progress-bar {
	width: 100%;
	height: 8px;
	background: rgba(128,128,128,0.2);
	border-radius: 4px;
	overflow: hidden;
}

.ff-progress-fill,
.ff-card-progress-fill {
	height: 100%;
	background: var(--ff-green);
	border-radius: 4px;
	transition: width 1s ease-out;
	width: 0;
}

.ff-stats-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 12px;
	align-items: baseline;
}

.ff-stat-raised {
	font-size: 20px;
	font-weight: 700;
}

.ff-stat-goal,
.ff-stat-usd,
.ff-stat-donors,
.ff-stat-days {
	font-size: 14px;
	color: inherit; opacity: 0.6;
}

/* ── Donate Card ─────────────────────────────────────────────────────── */

.ff-donate-card {
	border: none;
	border-radius: var(--ff-radius, 12px);
	padding: var(--ff-padding, 24px);
	margin: 24px 0;
	background: transparent;
}

.ff-donate-card.ff-has-border {
	border: 1px solid rgba(128,128,128,0.2);
}

.fire-fund-wrap.ff-theme-dark .ff-donate-card.ff-has-border {
	border-color: #2a2a2a;
}

.ff-preset-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.ff-preset-buttons--few {
	display: inline-flex;
}

.ff-preset-buttons--few .ff-preset-btn {
	flex: 0 0 auto;
	min-width: 80px;
}

.ff-preset-btn {
	flex: 1;
	min-width: 70px;
	padding: 10px 16px;
	border: 2px solid var(--ff-accent, var(--fire-fund-accent));
	border-radius: 9999px;
	background: transparent;
	color: var(--ff-accent, var(--fire-fund-accent));
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
}

.ff-preset-btn:hover,
.ff-preset-btn.active {
	background: var(--ff-accent, var(--fire-fund-accent));
	color: #fff;
}

.ff-custom-amount {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.ff-amount-input {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid rgba(128,128,128,0.25);
	border-radius: var(--ff-radius);
	font-size: 16px;
}

.ff-amount-input:focus {
	outline: none;
	border-color: var(--fire-fund-accent);
	box-shadow: 0 0 0 2px var(--fire-fund-accent-glow);
}

.ff-amount-label {
	font-size: 14px;
	font-weight: 600;
	color: inherit; opacity: 0.6;
	white-space: nowrap;
}

.ff-usd-equiv {
	font-size: 13px;
	color: inherit; opacity: 0.5;
	margin-bottom: 16px;
	min-height: 20px;
}

/* ── Donor Fields ────────────────────────────────────────────────────── */

.ff-donor-fields {
	margin-bottom: 16px;
}

.ff-donor-fields input,
.ff-donor-fields textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid rgba(128,128,128,0.25);
	border-radius: var(--ff-radius);
	font-size: 14px;
	margin-bottom: 8px;
	font-family: inherit;
}

.ff-donor-fields textarea {
	resize: vertical;
	min-height: 60px;
}

.ff-donor-fields input:focus,
.ff-donor-fields textarea:focus {
	outline: none;
	border-color: var(--fire-fund-accent);
}

/* ── Visibility Selector ─────────────────────────────────────────────── */

.ff-visibility {
	margin-bottom: 16px;
}

.ff-visibility-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: inherit; opacity: 0.8;
	margin-bottom: 8px;
}

.ff-visibility-options {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ff-visibility-options label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: inherit; opacity: 0.7;
	cursor: pointer;
	padding: 8px 0;
}

.ff-visibility-options input[type="radio"] {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 14px;
	border: 1px solid rgba(128,128,128,0.4);
	border-radius: 50%;
	margin: 0;
	padding: 0;
	flex-shrink: 0;
	cursor: pointer;
	position: relative;
	box-sizing: border-box;
	outline: none;
	background: transparent;
}

.ff-visibility-options input[type="radio"]:focus {
	outline: none;
	box-shadow: none;
}

.ff-visibility-options input[type="radio"]:checked {
	border-color: var(--fire-fund-accent);
}

.ff-visibility-options input[type="radio"]:checked::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--fire-fund-accent);
}

/* ── Donate Button ───────────────────────────────────────────────────── */

.ff-donate-btn {
	width: 100%;
	padding: 14px 24px;
	background: var(--ff-accent, var(--fire-fund-accent));
	color: #fff;
	border: none;
	border-radius: 9999px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.1s ease;
}

.ff-donate-btn.ff-btn-outline {
	background: transparent;
	border: 2px solid var(--ff-accent, var(--fire-fund-accent));
	color: var(--ff-accent, var(--fire-fund-accent));
}

.ff-donate-btn.ff-btn-minimal {
	background: transparent;
	border: none;
	color: var(--ff-accent, var(--fire-fund-accent));
	text-decoration: underline;
}

.ff-donate-btn:hover:not(:disabled) {
	filter: brightness(0.9);
}

.ff-donate-btn:active:not(:disabled) {
	transform: scale(0.98);
}

.ff-donate-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

/* ── Status Messages ─────────────────────────────────────────────────── */

.ff-donate-status {
	text-align: center;
	margin-top: 12px;
	font-size: 14px;
	min-height: 24px;
}

.ff-donate-status.ff-confirming {
	color: var(--fire-fund-accent);
	animation: ff-pulse 2s ease-in-out infinite;
}

.ff-donate-status.ff-error {
	color: #ef4444;
}

.ff-wallet-notice {
	background: #fff7ed;
	border: 1px solid #fed7aa;
	border-radius: 6px;
	padding: 12px 16px;
	margin-top: 12px;
	font-size: 13px;
	color: #9a3412;
}

.ff-wallet-notice a {
	color: var(--fire-fund-accent);
	font-weight: 600;
}

/* ── Thank You ───────────────────────────────────────────────────────── */

.ff-thank-you {
	text-align: center;
	padding: 32px 24px;
	animation: ff-fade-in 0.4s ease-out;
}

.ff-thank-you-icon {
	font-size: 48px;
	color: var(--fire-fund-accent);
	margin-bottom: 12px;
}

.ff-thank-you-title {
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 8px;
}

.ff-thank-you-message {
	font-size: 15px;
	color: inherit; opacity: 0.6;
	margin: 0;
}

/* ── Spinner ─────────────────────────────────────────────────────────── */

.ff-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: currentColor;
	border-radius: 50%;
	animation: ff-spin 0.8s linear infinite;
	vertical-align: middle;
	margin-right: 6px;
}

/* ── Cover Media ─────────────────────────────────────────────────────── */

.ff-cover {
	width: 100%;
	max-height: 480px;
	overflow: hidden;
	border-radius: 8px;
	margin-bottom: 24px;
}

.ff-cover img {
	width: 100%;
	height: 100%;
	max-height: 480px;
	object-fit: cover;
	display: block;
}

.ff-cover-video {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 24px;
}

.ff-cover-video iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ── Campaign Header ─────────────────────────────────────────────────── */

.ff-campaign-header {
	margin-bottom: 24px;
}

.ff-tagline {
	font-size: 18px;
	color: inherit; opacity: 0.6;
	margin: 8px 0 0;
}

.ff-category-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	color: inherit; opacity: 0.6;
	background: rgba(128,128,128,0.1);
	margin-top: 8px;
}

/* ── Section Labels ──────────────────────────────────────────────────── */

.ff-section-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: inherit; opacity: 0.5;
	margin: 32px 0 16px;
}

/* ── Updates Feed ────────────────────────────────────────────────────── */

.ff-update-item {
	padding: 16px 0;
	border-bottom: 1px solid rgba(128,128,128,0.15);
}

.ff-update-item:last-child {
	border-bottom: none;
}

.ff-update-date {
	font-size: 12px;
	color: inherit; opacity: 0.5;
	margin-bottom: 4px;
}

.ff-update-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 6px;
}

.ff-update-content {
	font-size: 14px;
	line-height: 1.6;
	color: inherit; opacity: 0.7;
}

/* ── Donor Wall ──────────────────────────────────────────────────────── */

.ff-donor-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid rgba(128,128,128,0.1);
}

.ff-donor-item:last-child {
	border-bottom: none;
}

.ff-donor-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(128,128,128,0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: 700;
	color: inherit; opacity: 0.6;
	flex-shrink: 0;
}

.ff-donor-avatar--anon {
	color: var(--fire-fund-accent);
}

.ff-donor-info {
	flex: 1;
	min-width: 0;
}

.ff-donor-name {
	font-weight: 600;
	font-size: 14px;
}

.ff-donor-amount {
	font-size: 13px;
	color: inherit; opacity: 0.6;
	margin-left: 8px;
}

.ff-donor-msg {
	font-size: 13px;
	color: inherit; opacity: 0.6;
	margin-top: 2px;
}

.ff-donor-time {
	font-size: 12px;
	color: inherit; opacity: 0.5;
	margin-top: 2px;
}

.ff-load-more {
	display: block;
	width: 100%;
	padding: 10px;
	margin-top: 12px;
	border: 1px solid rgba(128,128,128,0.2);
	border-radius: 9999px;
	background: transparent;
	color: inherit; opacity: 0.6;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.15s;
}

.ff-load-more:hover {
	background: rgba(128,128,128,0.05);
}

/* ══════════════════════════════════════════════════════════════════════
   Archive / Campaign Grid
   ══════════════════════════════════════════════════════════════════════ */

.ff-archive {
	max-width: 1200px;
	margin: 0 auto;
}

.ff-archive-controls {
	margin-bottom: 24px;
}

.ff-archive-form {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.ff-search-input {
	flex: 1;
	min-width: 200px;
	padding: 8px 12px;
	border: 1px solid rgba(128,128,128,0.25);
	border-radius: var(--ff-radius);
	font-size: 14px;
}

.ff-sort-select {
	padding: 8px 12px;
	border: 1px solid rgba(128,128,128,0.25);
	border-radius: var(--ff-radius);
	font-size: 14px;
	background: transparent;
}

.ff-search-btn {
	padding: 8px 20px;
	background: var(--fire-fund-accent);
	color: #fff;
	border: none;
	border-radius: 9999px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ff-campaign-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.ff-campaign-card {
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(128,128,128,0.2);
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.ff-campaign-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.ff-card-cover {
	height: 180px;
	background-size: cover;
	background-position: center;
	background-color: rgba(128,128,128,0.1);
}

.ff-card-cover--empty {
	display: flex;
	align-items: center;
	justify-content: center;
}

.ff-card-body {
	padding: 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.ff-card-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 4px;
	line-height: 1.3;
}

.ff-card-tagline {
	font-size: 13px;
	color: inherit; opacity: 0.6;
	margin: 0 0 12px;
	flex: 1;
}

.ff-card-progress {
	margin-bottom: 8px;
}

.ff-card-progress-bar {
	height: 4px;
}

.ff-card-stats {
	display: flex;
	gap: 12px;
	font-size: 12px;
	color: inherit; opacity: 0.5;
}

.ff-card-stat {
	white-space: nowrap;
}

.ff-card-link {
	display: block;
	margin-top: 12px;
	font-size: 13px;
	font-weight: 600;
	color: var(--fire-fund-accent);
}

.ff-no-results {
	text-align: center;
	color: inherit; opacity: 0.5;
	padding: 48px 0;
	font-size: 16px;
}

/* ── Widget (shortcode embed) ────────────────────────────────────────── */

.ff-widget {
	border: 1px solid rgba(128,128,128,0.2);
	border-radius: 8px;
	padding: 24px;
	max-width: 480px;
}

.ff-widget-title {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 16px;
}

/* ══════════════════════════════════════════════════════════════════════
   Animations
   ══════════════════════════════════════════════════════════════════════ */

@keyframes ff-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.4; }
}

@keyframes ff-spin {
	to { transform: rotate(360deg); }
}

@keyframes ff-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
	.ff-campaign-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}

	.ff-stats-row {
		gap: 12px;
	}

	.ff-stat-raised {
		font-size: 18px;
	}

	.ff-preset-buttons {
		gap: 6px;
	}

	.ff-preset-btn {
		padding: 8px 12px;
		font-size: 13px;
	}
}

@media (max-width: 480px) {
	.ff-campaign-grid {
		grid-template-columns: 1fr;
	}

	.ff-donate-card {
		padding: 16px;
	}

	.ff-preset-buttons {
		flex-wrap: wrap;
	}

	.ff-preset-btn {
		flex: 0 0 calc(50% - 4px);
	}

	.ff-archive-form {
		flex-direction: column;
	}

	.ff-search-input {
		min-width: 100%;
	}
}
