/**
 * Leyka Campaign Block
 */
:root {
	--knd-block-card-background: var(--knd-color-light-grey);
	--knd-block-card-button: var(--knd-color-main);
	--knd-block-card-collected-amount: var(--knd-color-main);
	--knd-block-card-progressbar: var(--knd-color-main);
	--knd-block-card-target-amount: var(--leyka-color-gray-notsolight);
	--knd-block-card-excerpt: var(---knd-color-base);
}

.entry-content .wp-block-leyka-form:not(:last-child) {
	margin-bottom: 26px;
}

.leyka-shortcode.campaign-card {
	border-radius: var(--knd-image-border-radius);
	//max-width: 1160px !important;

	.progressbar-unfulfilled {
		overflow: hidden;
		margin-top: auto;
	}

	a.campaign-thumb {
		&:hover {
			opacity: .8;
		}
	}

	.leyka-button-wrapper {
		border-bottom: 0;
		transition: filter .3s;

		&:hover {
			filter: brightness(0.9);
		}
	}
}

.knd-block-leyka-cards {
	margin-top: 25px;
	margin-bottom: 25px;
	background-color: var(--knd-block-cards-background);

	&:not(.alignfull) .knd-container {
		padding-left: 0;
		padding-right: 0;
	}

	&.has-background {
		padding-top: 30px;
		padding-bottom: 30px;

		&.alignfull {
			margin-top: 0;
			margin-bottom: 0;
		}
	}

	.section-title {
		font-size: 24px;
		font-family: var(--knd-font-family-headings);
		color: var(--knd-block-people-heading-color);
		margin-top: 0;
		margin-bottom: 30px;
		padding: 0;
	}

	.section-heading {
		margin-bottom: 30px;
	}

	.knd-block-items {

		&:not(.knd-block-carousel) {
			display: flex;
			flex-wrap: wrap;
		}
		margin-left: -20px;
		margin-right: -20px;
	}

	.knd-block-item {
		flex: 0 0 100%;
		max-width: 100%;
		width: 100%;
		padding-left: 20px;
		padding-right: 20px;
		padding-bottom: 20px;
		padding-top: 20px;
		box-sizing: border-box;

		&:first-child {
			padding-top: 0;
		}
	}

	@media (min-width: 768px) {
		&.knd-block-col {
			&-2 .knd-block-item {
				flex: 0 0 calc( 100% / 2 );
				max-width: calc( 100% / 2 );
				width: calc( 100% / 2 );
				padding-top: 0;

				&:nth-child(n+3) {
					padding-top: 20px;
				}
			}
		}
	}

	@media (min-width: 992px) {
		&.knd-block-col {
			&-3 .knd-block-item {
				flex: 0 0 calc( 100% / 3 );
				max-width: calc( 100% / 3 );
				width: calc( 100% / 3 );
				padding-top: 0;

				&:nth-child(n+4) {
					padding-top: 20px;
				}
			}
			&-4 .knd-block-item {
				flex: 0 0 calc( 100% / 4 );
				max-width: calc( 100% / 4 );
				width: calc( 100% / 4 );
				padding-top: 0;

				&:nth-child(n+5) {
					padding-top: 20px;
				}
			}
		}
	}

	.bottom-line-item {
		display: flex;
		justify-content: center;
		flex-direction: column;

		&.target-info {
			padding-right: 10px;
		}
	}

	.wp-block-leyka-card.campaign-card {
		background-color: var(--knd-block-card-background);
		height: 100%;

		.campaign-thumb {
			border-radius: inherit;
			height: auto;
			border-bottom: 0;

			&:after {
				content: '';
				display: block;
				padding-top: 60%;
			}
		}

		.bottom-line {
			margin-top: auto;

			.leyka-button-wrapper {
				background-color: var(--knd-block-card-button);
			}

			.target-info {
				.funded {
					color: var(--knd-block-card-collected-amount);
				}

				.target {
					color: var(--knd-block-card-target-amount);
				}
			}
		}

		.progressbar-unfulfilled {
			.progressbar-fulfilled {
				background-color: var(--knd-block-card-progressbar);
			}

			+ .bottom-line {
				margin-top: -24px;
			}
		}

		.campaign-title {
			color: var(--knd-block-card-title);
			margin-top: 0;
			font-size: var(--knd-block-card-title-size, 24px);
			line-height: 1.2;
			font-weight: 500;

			& + .bottom-line {
				.leyka-button-wrapper:first-child {
					margin-top: 0;
				}
			}
		}

		.campaign-excerpt {
			margin-bottom: 24px;
			color: var(--knd-block-card-excerpt);
			line-height: 1.4;
		}

		.campaign-title + .campaign-excerpt {
			margin-top: -15px;
		}
	}
}

/** Leyka cards */
.leyka-block-cards {

	.leyka-block-card.campaign-card {
		border-radius: var(--knd-image-border-radius);

		.campaign-thumb {
			border-radius: calc(var(--knd-image-border-radius) / 1.6);
			height: auto;
			border-bottom: 0;

			&:after {
				content: '';
				display: block;
				padding-top: 60%;
			}
		}
	}

	.bottom-line-item.target-info:not(:last-child){
		padding-right: 10px;
	}
}