/*  Flexbox-Background for column-elements (CTA-Karten)
----------------------------------------------------------------------------*/

/*--- CMS (!) ---*/
.matrix-bg div.cc-m-all > div.cc-m-all-editor div.cc-m-all-footer,
.matrix-bg div.cc-m-all > div.cc-m-all-editor div.cc-m-all-settings .cc-m-settings-content {
	width: 300px;
}


/* --- Desktop: 3 Spalten 
-------------------------------------------------- */
.cc-pagemode-default .matrix-bg {
	display: flex;
	align-items: stretch;
	gap: 0;
	max-width: 1200px;
	width: 100%;
	height: auto;

}

.matrix-bg .cc-m-hgrid-column {
	flex: 1;
	display: flex;
}

.matrix-bg [id^="cc-matrix-"] {
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 5px 16px rgba(0, 0, 0, 0.15);
	max-width: 360px;
	margin: auto;
	margin-top: 0px;
	margin-bottom: 15px;
	padding: 15px 20px;
	overflow: hidden;
	height: auto;
}

/* CTA-Button immer unten */
.matrix-bg [id^="cc-matrix-"] .j-callToAction {
	margin-top: auto;
	padding-bottom: 20px;
}

/*  Tablet Portrait: 2 Spalten 
--------------------------------------------------------*/

@media (min-width: 768px) and (max-width: 1180px) {
	.matrix-bg {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: 0;
		width: calc(100% - 20px);
		margin: auto;
	}

	.matrix-bg .cc-m-hgrid-column {
		flex: 0 0 calc(50% - 50px);
		display: flex;
		min-width: 320px;
		margin: 10px auto 0;
	}

	.matrix-bg [id^="cc-matrix-"] {
		width: calc(100%);
		box-sizing: border-box;
	}
}

/*  Mobile: 1 Spalte (<768px) 
----------------------------------------*/
@media (max-width: 767px) {

	.matrix-bg {
		display: block !important;
		/* Flexcontainer deaktivieren */
	}

	/* Spalten richtig umbrechen */
	.matrix-bg .cc-m-hgrid-column {
		width: 100% !important;
		min-width: 100% !important;
		display: block !important;
		flex: none !important;
		/* verhindert Nebeneinander */
		margin: 0 0 20px 0 !important;
	}

	/* Inhalt sauber einpassen */
	.matrix-bg [id^="cc-matrix-"] {
		width: 90% !important;
		margin: 0 auto !important;
		box-sizing: border-box;
		height: auto !important;
	}

	.matrix-bg .cc-m-hgrid-column.last {
		float: none !important;
	}
}



/* min-height
------------------------------------*/

@media (max-width: 1024px) {
	.matrix-bg [id^="cc-matrix-"] {
		min-height: 550px !important;
		height: auto !important;
	}
}

@media (min-width: 1025px) {
	.matrix-bg [id^="cc-matrix-"] {
		min-height: unset !important;
	}
}
