/**
 * Charity Donation & Campaign Manager — استایل فرانت‌اند
 * پیشوند: cdm-
 */

.cdm-grid {
	display: grid;
	gap: 24px;
	margin-block: 24px;
}

.cdm-grid-1 { grid-template-columns: 1fr; }
.cdm-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cdm-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cdm-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
	.cdm-grid-3, .cdm-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	.cdm-grid-2, .cdm-grid-3, .cdm-grid-4 { grid-template-columns: 1fr; }
}

.cdm-card-campaign {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
	display: flex;
	flex-direction: column;
}

.cdm-card-media { display: block; aspect-ratio: 16 / 9; background: #f3f4f6; }
.cdm-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cdm-card-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.cdm-card-title { margin: 0; font-size: 1.05rem; line-height: 1.6; }
.cdm-card-title a { color: inherit; text-decoration: none; }
.cdm-card-excerpt { margin: 0; color: #4b5563; font-size: .9rem; line-height: 1.8; }

.cdm-progress { display: flex; flex-direction: column; gap: 8px; }
.cdm-progress-amounts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: .95rem; }
.cdm-progress-goal { color: #6b7280; font-size: .82rem; }
.cdm-progress-track { width: 100%; height: 10px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.cdm-progress-bar { display: block; height: 100%; border-radius: 999px; background: #16a34a; transition: width .3s ease; }
.cdm-progress-meta { display: flex; justify-content: space-between; gap: 8px; color: #6b7280; font-size: .8rem; }

.cdm-button,
.cdm-form button[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 11px 20px;
	border: 0;
	border-radius: 10px;
	background: #16a34a;
	color: #fff;
	font-size: .92rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: opacity .2s ease;
}

.cdm-button:hover { opacity: .9; color: #fff; }
.cdm-button[disabled] { opacity: .6; cursor: not-allowed; }

.cdm-form-wrap {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 22px;
	margin-block: 24px;
}

.cdm-form-title { margin: 0 0 16px; font-size: 1.15rem; }
.cdm-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cdm-field { display: flex; flex-direction: column; gap: 6px; }
.cdm-field-full, .cdm-form .cdm-amounts, .cdm-form .cdm-check, .cdm-form .cdm-note, .cdm-form button { grid-column: 1 / -1; }

@media (max-width: 600px) {
	.cdm-form { grid-template-columns: 1fr; }
}

.cdm-field label { font-size: .87rem; font-weight: 600; color: #374151; }
.cdm-required { color: #dc2626; }

.cdm-form input[type="text"],
.cdm-form input[type="email"],
.cdm-form input[type="tel"],
.cdm-form select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 9px;
	background: #fff;
	font-size: .92rem;
	line-height: 1.6;
	box-sizing: border-box;
}

.cdm-form input:focus,
.cdm-form select:focus {
	outline: 2px solid #86efac;
	outline-offset: 1px;
	border-color: #16a34a;
}

.cdm-amounts { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.cdm-amounts legend { font-size: .87rem; font-weight: 600; color: #374151; margin-block-end: 8px; }
.cdm-amount-option {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	background: #f9fafb;
	font-size: .85rem;
	cursor: pointer;
}
.cdm-amount-option:has(input:checked) { border-color: #16a34a; background: #ecfdf5; color: #166534; }
.cdm-amount-custom { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; }
.cdm-amount-custom input { max-width: 180px; }

.cdm-check { display: flex; align-items: flex-start; gap: 8px; font-size: .85rem; color: #374151; line-height: 1.7; }
.cdm-check input { margin-block-start: 3px; }
.cdm-note { margin: 0; font-size: .8rem; color: #6b7280; line-height: 1.8; }

.cdm-notice {
	padding: 12px 14px;
	border-radius: 10px;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	color: #374151;
	font-size: .88rem;
	line-height: 1.8;
	margin-block: 16px;
}

.cdm-notice-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.cdm-notice-success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

.cdm-single { display: flex; flex-direction: column; gap: 18px; }
.cdm-single-media img { width: 100%; height: auto; border-radius: 14px; display: block; }
.cdm-single-title { margin: 0; font-size: 1.5rem; }
.cdm-single-content { line-height: 1.9; color: #374151; }

.cdm-donors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cdm-donors li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #eef2f7; border-radius: 10px; background: #fff; font-size: .88rem; }
.cdm-donor-amount { color: #16a34a; font-weight: 600; }

.cdm-dashboard { display: flex; flex-direction: column; gap: 14px; }
.cdm-table { width: 100%; border-collapse: collapse; font-size: .88rem; background: #fff; }
.cdm-table th, .cdm-table td { padding: 10px 12px; border-bottom: 1px solid #eef2f7; text-align: start; }
.cdm-table th { background: #f9fafb; font-weight: 600; }
.cdm-link-danger { color: #b91c1c; text-decoration: none; }

.cdm-result { padding: 18px; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff; }
.cdm-result h3 { margin-block-start: 0; }

.cdm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.cdm-stat { padding: 16px; border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.cdm-stat span { font-size: .82rem; color: #6b7280; }
.cdm-stat strong { font-size: 1.15rem; color: #111827; }

.cdm-editor-note {
	padding: 10px 12px;
	border: 1px dashed #cbd5e1;
	border-radius: 8px;
	background: #f8fafc;
	color: #475569;
	font-size: .8rem;
	margin-block-end: 10px;
}

.cdm-single-head { display: flex; flex-direction: column; gap: 8px; }
.cdm-single-excerpt { margin: 0; color: #4b5563; line-height: 1.9; }

.cdm-details-meta {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin: 0;
	padding: 0;
	color: #6b7280;
	font-size: .82rem;
}

.cdm-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 10px;
}

.cdm-gallery-item { display: block; border-radius: 10px; overflow: hidden; background: #f3f4f6; }
.cdm-gallery-item img { width: 100%; height: 110px; object-fit: cover; display: block; }

.cdm-single-body { display: grid; gap: 22px; align-items: start; }
.cdm-single-body .cdm-form-wrap { margin: 0; }

@media (min-width: 801px) {
	.cdm-single-two-column .cdm-single-body {
		grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
	}
}

.cdm-button-small { padding: 6px 12px; font-size: .8rem; border-radius: 8px; }

@media (max-width: 600px) {
	.cdm-form-wrap { padding: 16px; }
	.cdm-single-title { font-size: 1.25rem; }
}
