/**
 * Donor Wall — block styles.
 *
 * Uses --ambh-dw-columns custom property to drive column count.
 * Uses --ambh-dw-avatar-bg for per-tile generated color.
 *
 * @package AmbassadorHub\Fundraisers\Blocks\DonorWall
 */

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

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

/* ── Wrapper ────────────────────────────────────────────────────────────── */

.ambh-donor-wall {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ambh-dw-title {
	margin: 0;
	font-size: var(--ambh-font-base, 1rem);
	font-weight: 600;
}

/* ── Grid ───────────────────────────────────────────────────────────────── */

.ambh-dw-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat( var( --ambh-dw-columns, 5 ), 1fr );
	gap: 0.75rem;
}

@media ( max-width: 640px ) {
	.ambh-dw-grid {
		grid-template-columns: repeat( min( var( --ambh-dw-columns, 5 ), 4 ), 1fr );
	}
}

@media ( max-width: 400px ) {
	.ambh-dw-grid {
		grid-template-columns: repeat( 3, 1fr );
	}
}

/* ── Tile ───────────────────────────────────────────────────────────────── */

.ambh-dw-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
	text-align: center;
}

/* ── Avatar ─────────────────────────────────────────────────────────────── */

.ambh-dw-tile__avatar {
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background-color: var( --ambh-dw-avatar-bg, #1e6db4 );
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: var(--ambh-font-base, 1rem);
	font-weight: 700;
	line-height: 1;
	flex-shrink: 0;
}

.ambh-dw-tile.is-anonymous .ambh-dw-tile__avatar {
	font-size: var(--ambh-font-base, 1rem);
}

/* ── Name ───────────────────────────────────────────────────────────────── */

.ambh-dw-tile__name {
	font-size: var(--ambh-font-xs, 0.75rem);
	color: var(--ambh-text-color, #1e1e1e);
	word-break: break-word;
	line-height: 1.3;
}

.ambh-dw-tile.is-anonymous .ambh-dw-tile__name {
	color: var(--ambh-text-muted, #646970);
	font-style: italic;
}

/* ── Amount ─────────────────────────────────────────────────────────────── */

.ambh-dw-tile__amount {
	font-size: var(--ambh-font-xs, 0.75rem);
	color: var(--ambh-text-muted, #646970);
}
