/**
 * Top Fundraisers Block Styles
 *
 * Shares the same card-style design language as FundraiserGrid / FundraiserList.
 * Displayed as a compact ranked list — no box-shadow wrapper so it sits naturally
 * in a sidebar column.
 */

/* ── Editor canvas preview ─────────────────────────────────────────────── */

.ambh-top-fundraisers.ambh-block-preview {
	padding: 2rem;
	background: #f0f0f1;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-align: center;
}

/* ── Block wrapper ──────────────────────────────────────────────────────── */

.ambh-top-fundraisers {
	margin: 0;
}

.ambh-tf-title {
	margin: 0 0 0.75rem;
	font-size: var(--ambh-font-sm, 0.875rem);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ambh-text-color, #1e1e1e);
}

/* ── List ────────────────────────────────────────────────────────────────── */

.ambh-tf-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

/* ── Item ────────────────────────────────────────────────────────────────── */

.ambh-tf-item {
	border: 1px solid var(--ambh-border-color, #e0e0e0);
	border-radius: 6px;
	overflow: hidden;
	background: #fff;
}

.ambh-tf-item__link {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	padding: 0.625rem 0.75rem;
	text-decoration: none;
	color: inherit;
}

.ambh-tf-item__link:hover,
.ambh-tf-item__link:focus {
	background: var(--ambh-bg-subtle, #f6f7f7);
	color: inherit;
	text-decoration: none;
}

/* ── Rank badge ──────────────────────────────────────────────────────────── */

.ambh-tf-rank {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: var(--ambh-border-color, #e0e0e0);
	color: var(--ambh-text-color, #1e1e1e);
	font-size: var(--ambh-font-xs, 0.75rem);
	font-weight: 700;
}

.ambh-tf-item--rank-1 .ambh-tf-rank { background: #f0a500; color: #fff; }
.ambh-tf-item--rank-2 .ambh-tf-rank { background: #9ea3a8; color: #fff; }
.ambh-tf-item--rank-3 .ambh-tf-rank { background: #b5651d; color: #fff; }

/* ── Thumbnail ───────────────────────────────────────────────────────────── */

.ambh-tf-thumb {
	flex-shrink: 0;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 4px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ambh-bg-subtle, #f6f7f7);
}

.ambh-tf-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ambh-tf-thumb--placeholder {
	color: var(--ambh-text-muted, #646970);
}

.ambh-tf-thumb--placeholder svg {
	width: 1.25rem;
	height: 1.25rem;
}

/* ── Body ─────────────────────────────────────────────────────────────────── */

.ambh-tf-body {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	flex: 1;
	min-width: 0;
}

.ambh-tf-name {
	font-size: var(--ambh-font-sm, 0.875rem);
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Stats ───────────────────────────────────────────────────────────────── */

.ambh-tf-stats {
	display: flex;
	align-items: baseline;
	gap: 0.25rem;
	font-size: var(--ambh-font-xs, 0.75rem);
}

.ambh-tf-raised {
	font-weight: 600;
	color: var(--ambh-text-color, #1e1e1e);
}

.ambh-tf-target {
	color: var(--ambh-text-muted, #646970);
}

/* ── Progress bar ──────────────────────────────────────────────────────────── */

.ambh-tf-progress {
	height: 4px;
	border-radius: 2px;
	background: var(--ambh-border-color, #e0e0e0);
	overflow: hidden;
}

.ambh-tf-progress__fill {
	height: 100%;
	border-radius: 2px;
	background: var(--ambh-color-progress, #00a32a);
	min-width: 2px;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */

.ambh-top-fundraisers--empty {
	padding: 1rem;
	background: var(--ambh-bg-subtle, #f6f7f7);
	border-radius: 6px;
	text-align: center;
	font-size: var(--ambh-font-sm, 0.875rem);
	color: var(--ambh-text-muted, #646970);
}

.top-fundraisers-title {
	margin: 0 0 25px 0;
	padding-bottom: 15px;
	border-bottom: 3px solid var(--ambh-color-primary, #3498db);
	color: var(--ambh-text-color, #1e1e1e);
	font-size: var(--ambh-font-lg, 1.5rem);
	font-weight: 700;
}

.top-fundraisers-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.top-fundraiser-item {
	display: flex;
	align-items: flex-start;
	padding: 20px;
	margin-bottom: 15px;
	background: var(--ambh-bg-subtle, #f6f7f7);
	border-radius: 8px;
	border-left: 4px solid var(--ambh-color-primary, #3498db);
	transition: all 0.3s ease;
}

.top-fundraiser-item:hover {
	background: var(--ambh-bg-subtle, #f6f7f7);
	transform: translateX(5px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Special styling for top 3 */
.top-fundraiser-rank-1 {
	border-left-color: #f39c12;
}

.top-fundraiser-rank-1 .top-fundraiser-rank {
	background: #f39c12;
	color: #ffffff;
}

.top-fundraiser-rank-2 {
	border-left-color: #95a5a6;
}

.top-fundraiser-rank-2 .top-fundraiser-rank {
	background: #95a5a6;
	color: #ffffff;
}

.top-fundraiser-rank-3 {
	border-left-color: #cd7f32;
}

.top-fundraiser-rank-3 .top-fundraiser-rank {
	background: #cd7f32;
	color: #ffffff;
}

.top-fundraiser-rank {
	flex-shrink: 0;
	width: 45px;
	height: 45px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ambh-color-primary, #3498db);
	color: #ffffff;
	border-radius: 50%;
	font-size: var(--ambh-font-base, 1rem);
	font-weight: 700;
	margin-right: 20px;
}

.top-fundraiser-content {
	flex: 1;
}

.top-fundraiser-name {
	margin: 0 0 10px 0;
	font-size: var(--ambh-font-md, 1.25rem);
	font-weight: 600;
	line-height: 1.3;
}

.top-fundraiser-name a {
	color: var(--ambh-text-color, #1e1e1e);
	text-decoration: none;
	transition: color 0.3s ease;
}

.top-fundraiser-name a:hover {
	color: var(--ambh-color-primary, #3498db);
}

.top-fundraiser-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	margin-bottom: 8px;
	font-size: var(--ambh-font-sm, 0.875rem);
}

.top-fundraiser-amount {
	color: var(--ambh-color-secondary, #27ae60);
	font-weight: 600;
	font-size: var(--ambh-font-base, 1rem);
}

.top-fundraiser-progress {
	color: var(--ambh-text-muted, #646970);
	font-size: var(--ambh-font-sm, 0.875rem);
}

.top-fundraiser-owner {
	color: var(--ambh-text-muted, #646970);
	font-size: var(--ambh-font-sm, 0.875rem);
	font-style: italic;
}

/* Empty state */
.top-fundraisers-empty {
	text-align: center;
	padding: 60px 30px;
	background: var(--ambh-bg-subtle, #f6f7f7);
}

.top-fundraisers-empty p {
	margin: 0;
	color: var(--ambh-text-muted, #646970);
	font-size: var(--ambh-font-base, 1rem);
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.top-fundraisers-block {
		padding: 20px;
		margin: 20px 0;
	}

	.top-fundraiser-item {
		padding: 15px;
	}

	.top-fundraiser-rank {
		width: 36px;
		height: 36px;
		font-size: var(--ambh-font-base, 1rem);
		margin-right: 15px;
	}

	.top-fundraiser-name {
		font-size: var(--ambh-font-base, 1rem);
	}

	.top-fundraiser-amount {
		font-size: var(--ambh-font-base, 1rem);
	}

	.top-fundraiser-stats {
		flex-direction: column;
		gap: 5px;
	}
}
