/**
 * Lösungsfinder – Frontend-Design
 * Angelehnt an die Design-Vorlage (helles Layout, Divi-kompatibel).
 */

.mloes {
	--mloes-accent: #c01e1d;
	--mloes-accent-dark: #8a1615;
	--mloes-accent-soft: #fbeceb;
	--mloes-accent-border: #edc4c3;
	--mloes-text: #1f2937;
	--mloes-muted: #6b7280;
	--mloes-border: #e5e7eb;
	/* Hintergrund/Akzent der geöffneten Karte (neutral, nicht rot). */
	--mloes-open-bg: #f3f4f6;
	--mloes-open-stripe: #cbd0d6;
	--mloes-radius: 12px;

	/* Volle verfügbare Breite. */
	width: 100%;
	max-width: 100%;
	margin: 0;
	color: var(--mloes-text);
	/* Basis-Schriftgröße gilt nur innerhalb des Lösungsfinders (nicht seitenweit).
	   Kind-Elemente skalieren per em von diesem Wert – unabhängig vom Theme. */
	font-size: 16px;
	line-height: 1.55;
	box-sizing: border-box;
}

.mloes *,
.mloes *::before,
.mloes *::after {
	box-sizing: border-box;
}

/* ---------------- Suche ---------------- */
.mloes-search {
	display: flex;
	gap: 8px;
	background: #fff;
	border: 1px solid var(--mloes-border);
	border-radius: var(--mloes-radius);
	padding: 8px;
	box-shadow: 0 1px 2px rgba( 15, 23, 42, 0.04 );
	margin-bottom: 1.5rem;
}

.mloes-search-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0;
	background: transparent;
	font-size: 1em;
	padding: 10px 12px;
	color: var(--mloes-text);
	outline: none;
}

.mloes-search-input::placeholder {
	color: var(--mloes-muted);
}

.mloes-search-button {
	flex: 0 0 auto;
	border: 0;
	background: var(--mloes-accent);
	color: #fff;
	font-size: 1em;
	font-weight: 600;
	padding: 10px 28px;
	border-radius: 8px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.mloes-search-button:hover,
.mloes-search-button:focus-visible {
	background: var(--mloes-accent-dark);
}

/* ---------------- Tabs ---------------- */
.mloes-tabs {
	display: flex;
	gap: 1.75rem;
	border-bottom: 1px solid var(--mloes-border);
	margin-bottom: 1rem;
}

.mloes-tab {
	border: 0;
	background: transparent;
	font-size: 1.05em;
	font-weight: 600;
	color: var(--mloes-muted);
	padding: 0.5rem 0.15rem 0.75rem;
	cursor: pointer;
	position: relative;
	transition: color 0.15s ease;
}

.mloes-tab:hover {
	color: var(--mloes-accent);
}

.mloes-tab.is-active {
	color: var(--mloes-accent);
}

.mloes-tab.is-active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: var(--mloes-accent);
}

/* ---------------- Zähler ---------------- */
.mloes-count {
	color: var(--mloes-muted);
	font-size: 0.95em;
	margin: 0 0 0.9rem;
}

.mloes-count-number {
	font-weight: 600;
	color: var(--mloes-text);
}

/* ---------------- Liste / Karten ---------------- */
.mloes-list {
	display: flex;
	flex-direction: column;
	gap: 0;
	border: 1px solid var(--mloes-border);
	border-radius: var(--mloes-radius);
	overflow: hidden;
	background: #fff;
}

.mloes-item {
	border-top: 1px solid var(--mloes-border);
}

.mloes-item:first-child,
.mloes-item.is-first {
	border-top: 0;
}

/* Geöffnete Karte hebt sich hervor (helles Grau statt Rot) */
.mloes-item.is-open {
	background: var(--mloes-open-bg);
	border-top-color: var(--mloes-border);
	box-shadow: inset 4px 0 0 var(--mloes-open-stripe);
}

.mloes-item.is-open + .mloes-item {
	border-top-color: var(--mloes-border);
}

/* ---------------- Karten-Kopf (Toggle) ---------------- */
.mloes-item-heading {
	margin: 0;
	font-size: 1em;
}

.mloes-item-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	border: 0;
	background: transparent;
	text-align: left;
	cursor: pointer;
	padding: 1.15rem 1.4rem;
	font-size: 1em;
	font-weight: 600;
	line-height: 1.3;
}

.mloes-item-title {
	flex: 1 1 auto;
        font-size: 1emloesungen;
}

/* Plus/Minus-Icon */
.mloes-item-icon {
	flex: 0 0 auto;
	position: relative;
	width: 20px;
	height: 20px;
}

.mloes-item-icon::before,
.mloes-item-icon::after {
	content: "";
	position: absolute;
	background: var(--mloes-accent);
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.mloes-item-icon::before {
	top: 9px;
	left: 2px;
	right: 2px;
	height: 2px;
}

.mloes-item-icon::after {
	left: 9px;
	top: 2px;
	bottom: 2px;
	width: 2px;
}

.mloes-item.is-open .mloes-item-icon::after {
	transform: rotate( 90deg );
	opacity: 0;
}

/* ---------------- Karten-Inhalt ---------------- */
.mloes-item-body {
	padding: 0 1.4rem 1.4rem;
}

.mloes-row {
	display: grid;
	grid-template-columns: minmax( 180px, 240px ) 1fr;
	gap: 0.5rem 1.75rem;
	padding: 0.9rem 0;
	border-top: 1px solid var(--mloes-border);
}

.mloes-row:first-child {
	border-top: 0;
	padding-top: 0.4rem;
}

.mloes-row-label {
	font-weight: 600;
}

.mloes-row-value {
	color: var(--mloes-text);
}

.mloes-row-value > :first-child {
	margin-top: 0;
}

.mloes-row-value > :last-child {
	margin-bottom: 0;
}

.mloes-row-value p {
	margin: 0 0 0.6rem;
}

/* Bild */
.mloes-image {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	display: block;
}

/* ---------------- Zwei-Spalten-Layout (mit Video) ---------------- */
.mloes-body-cols {
	display: grid;
	grid-template-columns: 1fr 1fr; /* 50:50 */
	gap: 1.75rem;
	align-items: start;
}

/* Textspalte: einspaltig gestapelt (Überschrift über Text), keine Label/Wert-Trennung. */
.mloes-col-text .mloes-row {
	grid-template-columns: 1fr;
	gap: 0.25rem;
}

.mloes-col-media {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.mloes-col-media .mloes-image {
	width: 100%;
}

/* Video-Einbettung */
.mloes-video {
	margin: 0;
}

.mloes-video--embed {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
}

.mloes-video--embed iframe,
.mloes-video--embed embed,
.mloes-video--embed object,
.mloes-video--embed video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.mloes-video--file video {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 8px;
	background: #000;
}

.mloes-video--link {
	word-break: break-word;
}

/* Download */
.mloes-download {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	font-weight: 600;
	color: var(--mloes-accent);
	background: #fff;
	border: 1px solid var(--mloes-accent-border);
	border-radius: 8px;
	padding: 0.55rem 1rem;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.mloes-download:hover,
.mloes-download:focus-visible {
	background: var(--mloes-accent);
	color: #fff;
}

.mloes-download-icon {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	position: relative;
}

.mloes-download-icon::before {
	content: "";
	position: absolute;
	left: 7px;
	top: 0;
	width: 2px;
	height: 10px;
	background: currentColor;
	border-radius: 2px;
}

.mloes-download-icon::after {
	content: "";
	position: absolute;
	left: 3px;
	top: 6px;
	width: 10px;
	height: 6px;
	border-left: 2px solid currentColor;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	border-radius: 0 0 2px 2px;
}

/* Pfeilspitze für Download */
.mloes-download-text::before {
	content: "";
}

/* ---------------- Leerzustände ---------------- */
.mloes-noresults,
.mloes-empty {
	color: var(--mloes-muted);
	background: #fff;
	border: 1px dashed var(--mloes-border);
	border-radius: var(--mloes-radius);
	padding: 1.5rem;
	text-align: center;
	margin: 1rem 0 0;
}

/* ---------------- Responsive ---------------- */
@media ( max-width: 640px ) {
	.mloes-row {
		grid-template-columns: 1fr;
		gap: 0.25rem;
	}

	.mloes-body-cols {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}

	.mloes-item-toggle {
		padding: 1rem 1.1rem;
		font-size: 1.05em;
	}

	.mloes-item-body {
		padding: 0 1.1rem 1.1rem;
	}

	.mloes-search-button {
		padding: 10px 18px;
	}

	.mloes-tabs {
		gap: 1.1rem;
	}
}
