/* Donation Campaigns - public campaign box.

   Version 1.0 targets prosilver only (ADR-013). Every class is prefixed so it
   cannot collide with a board style or another extension, and nothing here
   depends on JavaScript.

   The progress bar's width is expressed as one class per five-percent step
   rather than an inline style, because ADR-013 forbids inline CSS. The
   listener only ever emits a multiple of five. */

.donationcampaigns-panel {
	margin-bottom: 10px;
}

/* The donation ledger on the management landing. prosilver centres table
   headers by default, which reads as misaligned above the left-aligned cells
   below them; the headers are aligned with their column's data instead. */
.donationcampaigns-ledger thead th {
	text-align: left;
}

/* TYPOGRAPHY.

   The box sits in a .panel, which inherits prosilver's 10px body size, while
   post text resolves to 13px. Left to inherit, the campaign read as a footnote
   beside the post it belongs to. Sizes below are em against that same 10px
   base, so they follow a reader who has scaled the board.

   The hierarchy is deliberate and stops short of the post: topic title 2.0em,
   post subject 1.7em, campaign title 1.5em. The campaign is meant to be
   noticed, not to compete with the post it introduces. */

.donationcampaigns-title {
	/* prosilver's h3 rule applies text-transform: uppercase (common.css:44).
	   A title is the administrator's own words — "Betrieb des Forums" must not
	   reach the reader as "BETRIEB DES FORUMS". */
	text-transform: none;
	font-size: 1.5em;
	line-height: 1.3;
	margin: 0 0 6px;
}

.donationcampaigns-desc {
	/* Matched to post text, because that is what it reads as. */
	font-size: 1.3em;
	line-height: 1.4;
	margin-bottom: 10px;
}

/* Fluid, so the box survives a narrow screen and a style with its own
   container widths. No fixed dimensions anywhere. */
.donationcampaigns-progress {
	background-color: #e2e8f0;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	display: block;
	height: 20px;
	max-width: 100%;
	overflow: hidden;
	box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
	position: relative;
}

.donationcampaigns-bar {
	display: block;
	height: 100%;
	border-radius: 10px;
	transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1), background 0.8s ease;
	background-color: #3b82f6; /* Fallback */
}

/* Stage color gradients:
   Stage 1 (<= 25%): Red
   Stage 2 (<= 50%): Orange
   Stage 3 (<= 80%): Yellow / Amber
   Stage 4 (<= 95%): Blue
   Stage 5 (> 95%): Green
*/
.donationcampaigns-bar--stage-1 {
	background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}
.donationcampaigns-bar--stage-2 {
	background: linear-gradient(90deg, #f97316 0%, #ea580c 100%);
}
.donationcampaigns-bar--stage-3 {
	background: linear-gradient(90deg, #eab308 0%, #ca8a04 100%);
}
.donationcampaigns-bar--stage-4 {
	background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
}
.donationcampaigns-bar--stage-5 {
	background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
}

.donationcampaigns-bar--0 { width: 0%; }
.donationcampaigns-bar--5 { width: 5%; }
.donationcampaigns-bar--10 { width: 10%; }
.donationcampaigns-bar--15 { width: 15%; }
.donationcampaigns-bar--20 { width: 20%; }
.donationcampaigns-bar--25 { width: 25%; }
.donationcampaigns-bar--30 { width: 30%; }
.donationcampaigns-bar--35 { width: 35%; }
.donationcampaigns-bar--40 { width: 40%; }
.donationcampaigns-bar--45 { width: 45%; }
.donationcampaigns-bar--50 { width: 50%; }
.donationcampaigns-bar--55 { width: 55%; }
.donationcampaigns-bar--60 { width: 60%; }
.donationcampaigns-bar--65 { width: 65%; }
.donationcampaigns-bar--70 { width: 70%; }
.donationcampaigns-bar--75 { width: 75%; }
.donationcampaigns-bar--80 { width: 80%; }
.donationcampaigns-bar--85 { width: 85%; }
.donationcampaigns-bar--90 { width: 90%; }
.donationcampaigns-bar--95 { width: 95%; }
.donationcampaigns-bar--100 { width: 100%; }

/* The figures are the point of the box, so they read at post-text size
   rather than at the 1.2em prosilver gives a bare paragraph. */
.donationcampaigns-figures {
	font-size: 1.3em;
	line-height: 1.4;
	margin: 6px 0 0;
}

/* Reaching the target is stated in words in the markup; the weight here is
   emphasis only, never the sole carrier of the information. */
.donationcampaigns-reached {
	font-weight: bold;
	margin: 4px 0 0;
}

.donationcampaigns-count,
.donationcampaigns-donors,
.donationcampaigns-link {
	margin: 6px 0 0;
}

.donationcampaigns-donor-item {
	padding: 1px 0;
	line-height: 1.45;
}

.donationcampaigns-donor-date {
	color: #666666;
	font-size: 0.9em;
}

.donationcampaigns-expand-wrapper {
	margin-top: 6px;
}

.donationcampaigns-expand-btn {
	background: transparent;
	border: 1px solid #cbd5e1;
	border-radius: 15px;
	padding: 3px 12px;
	font-size: 0.95em;
	color: #1e40af;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	transition: all 0.2s ease;
	font-weight: 500;
}

.donationcampaigns-expand-btn:hover {
	background-color: #f1f5f9;
	color: #0f172a;
	border-color: #94a3b8;
}

.donationcampaigns-expand-btn.is-expanded {
	background-color: #f8fafc;
	color: #475569;
}

.donationcampaigns-expand-hint {
	font-size: 0.9em;
	color: #64748b;
	font-weight: normal;
}

.donationcampaigns-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-top: 10px;
}

.donationcampaigns-actions {
	display: inline-flex;
	gap: 6px;
	margin-left: auto;
}

.donationcampaigns-btn-manage,
.donationcampaigns-btn-add {
	font-size: 11px;
	padding: 2px 8px;
	line-height: 18px;
}

/* Campaigns Directory Grid */
.donationcampaigns-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 15px;
	margin-top: 15px;
}

.donationcampaigns-card {
	background-color: #f7f7f7;
	border: 1px solid #dcdcdc;
	border-radius: 5px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.donationcampaigns-card-title {
	font-size: 1.3em;
	margin: 0 0 6px;
}

.donationcampaigns-card-desc {
	font-size: 1.1em;
	color: #555555;
	margin-bottom: 10px;
	line-height: 1.3;
}

.donationcampaigns-card-meta {
	margin-top: 8px;
	font-size: 1.1em;
}

.donationcampaigns-badge {
	display: inline-block;
	padding: 2px 6px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: bold;
	text-transform: uppercase;
}

.donationcampaigns-badge--active {
	background-color: #2e7d32;
	color: #ffffff;
}

.donationcampaigns-badge--reached {
	background-color: #0277bd;
	color: #ffffff;
}

.donationcampaigns-badge--success {
	background-color: #1b5e20;
	color: #ffffff;
}

.donationcampaigns-badge--closed {
	background-color: #757575;
	color: #ffffff;
}

.donationcampaigns-closed-banner {
	background-color: #fff3cd;
	border: 1px solid #ffeeba;
	color: #856404;
	padding: 10px 14px;
	border-radius: 6px;
	font-weight: bold;
	font-size: 1.2em;
	margin-top: 12px;
	margin-bottom: 4px;
}

.donationcampaigns-closed-banner--success {
	background-color: #d4edda;
	border-color: #c3e6cb;
	color: #155724;
}

.donationcampaigns-closed-banner--partial {
	background-color: #fff3cd;
	border-color: #ffeeba;
	color: #856404;
}

.donationcampaigns-goal-banner {
	background-color: #d1ecf1;
	border: 1px solid #bee5eb;
	color: #0c5460;
	padding: 10px 14px;
	border-radius: 6px;
	font-weight: bold;
	font-size: 1.2em;
	margin-top: 12px;
	margin-bottom: 4px;
}

.donationcampaigns-btn-closed {
	cursor: not-allowed;
	opacity: 0.7;
}

.donationcampaigns-filters {
	margin: 12px 0 15px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.donationcampaigns-filter-btn {
	padding: 4px 12px;
	font-size: 1.1em;
	text-decoration: none;
	border-radius: 4px;
	border: 1px solid #dcdcdc;
	background-color: #ffffff;
	color: #333333;
}

.donationcampaigns-filter-btn:hover {
	background-color: #f0f0f0;
	text-decoration: none;
}

.donationcampaigns-filter-btn.active {
	background-color: #126cb4;
	color: #ffffff;
	border-color: #0c548c;
	font-weight: bold;
}

/* Honour a reader who has asked for more contrast. */
@media (prefers-contrast: more) {
	.donationcampaigns-bar {
		background-color: #1a5c1a;
	}

	.donationcampaigns-progress {
		border-color: #000000;
	}
}
