/* CB Favoriten – Herz, Seite „Meine Favoriten“, Meldung
 * (C) 2026 Designsektor, GNU/GPL version 2 */

:is(.mlxFav, .mlxFavPage, .mlxFavToast, .mlxMini) {
	--mlxf-brand: var(--mlx-accent, #4e2a56);
	--mlxf-dark: var(--mlx-primary, #2f5353);
	--mlxf-text: var(--mlx-text, #2c2e36);
	--mlxf-muted: var(--mlx-muted, #626875);
	--mlxf-line: #e2e6e9;
	--mlxf-fill: #f3f5f6;
	--mlxf-heart: #c8364f;
}

/* Das Formular stört die Anordnung nicht: der Knopf steht, als gäbe es das Formular nicht */
form.mlxFav:not(.mlxFav--list) {
	display: contents;
}

.mlxFav__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	font: inherit;
	cursor: pointer;
}

button.mlxFav__btn {
	border: 0;
}

/* Doppelte Klasse: schlägt "svg { fill: currentColor }" der Profilknöpfe */
.mlxFav__heart.mlxFav__heart {
	flex: none;
	width: 1.15em;
	height: 1.15em;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linejoin: round;
	transition: transform .15s ease;
}

.mlxFav__btn.is-on .mlxFav__heart.mlxFav__heart {
	fill: currentColor;
}

.mlxFav__btn:active .mlxFav__heart {
	transform: scale(.85);
}

.mlxFav__btn:disabled {
	cursor: progress;
}

/* Nur Herz: runder Knopf (Musikersuche, Favoriten-Seite) */
.mlxFav__btn--icon {
	width: 2.4rem;
	height: 2.4rem;
	padding: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(16, 24, 40, .15);
	color: var(--mlxf-muted);
}

.mlxFav__btn--icon:hover,
.mlxFav__btn--icon:focus-visible,
.mlxFav__btn--icon.is-on {
	color: var(--mlxf-heart);
}

.mlxFav__btn--icon:focus-visible {
	outline: 3px solid var(--mlxf-brand);
	outline-offset: 2px;
}

.mlxFav__btn--icon .mlxFav__heart.mlxFav__heart {
	width: 1.25rem;
	height: 1.25rem;
}

/* Musikersuche: oben rechts auf der Karte */
.mlxFav--list {
	position: absolute;
	top: .5rem;
	right: .5rem;
	z-index: 2;
	margin: 0;
	text-decoration: none !important;
}

/* ---------- Mini-Profilkopf (wie der Kopf der Profilseite) ---------- */

.mlxMini {
	overflow: hidden;
	border-radius: 14px;
	background: #fff;
	color: var(--mlxf-text);
}

.mlxMini__hero {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 1rem;
	padding: 1.1rem;
	overflow: hidden;
	background: var(--mlxf-dark);
	color: #fff;
	isolation: isolate;
}

/* dezente Fläche in Markenfarbe rechts, wie im Profilkopf (hinter dem Inhalt) */
.mlxMini__hero::before {
	position: absolute;
	top: -40%;
	right: -15%;
	z-index: -1;
	width: 50%;
	height: 180%;
	background: var(--mlxf-brand);
	opacity: .55;
	transform: rotate(18deg);
	content: "";
	pointer-events: none;
}

.mlxMini__avatar img {
	display: block;
	width: 76px !important;
	height: 76px !important;
	max-width: none;
	border-radius: 50% !important;
	object-fit: cover;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 6px 18px rgba(0, 0, 0, .25);
}

/* Feste Zeilen: jede Zeile genau eine Textzeile hoch, auch wenn die Angabe fehlt – so sind alle Köpfe
   gleich hoch und Ort, Dabei seit, Entfernung und Anzeigen stehen immer an derselben Stelle */
.mlxMini__intro {
	--mlxm-row: 1.35rem;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.mlxMini__badges,
.mlxMini__pills {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: .3rem;
	height: var(--mlxm-row);
	margin: 0;
	padding: 0;
	overflow: hidden;
	list-style: none;
}

.mlxMini__badges {
	margin-bottom: .3rem;
}

.mlxMini__badges li {
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	padding: .15rem .55rem;
	border-radius: 999px;
	background: #fff;
	font-size: .6875rem;
	font-weight: 800;
	letter-spacing: .05em;
	line-height: 1.2;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--mlxf-brand);
}

.mlxMini__badges .mlxMini__more {
	flex: none;
	background: rgba(255, 255, 255, .25);
	color: #fff;
}

.mlxMini .mlxMini__name {
	margin: 0 !important;
	overflow: hidden;
	font-size: 1.25rem !important;
	font-weight: 800 !important;
	line-height: 1.3 !important;
	text-overflow: ellipsis;
	text-transform: none !important;
	letter-spacing: 0 !important;
	white-space: nowrap;
}

/* Der Name deckt die ganze Kopffläche ab: Klick irgendwo öffnet das Profil */
.mlxMini__name a {
	text-decoration: none !important;
	color: #fff !important;
}

.mlxMini__name a::after {
	position: absolute;
	inset: 0;
	content: "";
}

.mlxMini__hero:has(.mlxMini__name a:focus-visible) {
	outline: 3px solid var(--mlxf-brand);
	outline-offset: -3px;
}

.mlxMini__name a:hover {
	text-decoration: underline !important;
}

/* Ich bin, Ort, Dabei seit: je eine Zeile, zu Langes mit „…“ */
.mlxMini__line {
	display: flex;
	align-items: center;
	gap: .3rem;
	height: var(--mlxm-row);
	margin: 0;
	overflow: hidden;
	font-size: .8125rem;
	line-height: var(--mlxm-row);
	white-space: nowrap;
	opacity: .95;
}

.mlxMini__line > span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mlxMini__type {
	display: block;
	font-size: .9375rem;
	text-overflow: ellipsis;
	opacity: .9;
}

.mlxMini__since {
	display: block;
	text-overflow: ellipsis;
}

.mlxMini__line svg {
	flex: none;
	width: 1.05em;
	height: 1.05em;
	fill: currentColor;
}

/* Entfernung und Anzeigen: immer unten in einer Reihe */
.mlxMini__pills {
	margin-top: .35rem;
	font-size: .8125rem;
}

.mlxMini__pills li {
	flex: none;
	padding: .05rem .5rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, .15);
	font-weight: 700;
	line-height: 1.3;
	white-space: nowrap;
}
/* Herz oben rechts über dem Profil-Link */
.mlxMini__aside {
	position: relative;
	z-index: 1;
	align-self: start;
}

.mlxMini__heart.mlxFav__btn--icon {
	background: rgba(255, 255, 255, .15);
	box-shadow: none;
	color: #fff;
}

.mlxMini__heart.mlxFav__btn--icon:hover,
.mlxMini__heart.mlxFav__btn--icon:focus-visible {
	background: #fff;
	color: var(--mlxf-heart);
}

/* Favorit: rotes, gefülltes Herz auf weißem Kreis */
.mlxMini__heart.mlxFav__btn--icon.is-on {
	background: #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
	color: var(--mlxf-heart);
}

.mlxMini__heart.mlxFav__btn--icon.is-on:hover,
.mlxMini__heart.mlxFav__btn--icon.is-on:focus-visible {
	background: #fde8ec;
}

/* Kleine Variante (rechte Spalte im eigenen Profil) */
.mlxMini--small .mlxMini__hero {
	gap: .75rem;
	padding: .8rem .9rem;
}

.mlxMini--small .mlxMini__avatar img {
	width: 52px !important;
	height: 52px !important;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .9);
}

.mlxMini--small .mlxMini__name {
	font-size: 1.05rem !important;
}

.mlxMini--small .mlxMini__badges li {
	font-size: .625rem;
}

.mlxMini--small .mlxMini__intro {
	--mlxm-row: 1.2rem;
}

.mlxMini--small .mlxMini__line,
.mlxMini--small .mlxMini__pills {
	font-size: .75rem;
}

.mlxMini--small .mlxMini__pills {
	margin-top: .25rem;
}
/* Handy: etwas kleineres Bild, damit Gesuch und Ort mehr Platz haben */
@media (max-width: 575.98px) {
	.mlxMini:not(.mlxMini--small) .mlxMini__hero {
		gap: .8rem;
		padding: 1rem .9rem;
	}

	.mlxMini:not(.mlxMini--small) .mlxMini__avatar img {
		width: 60px !important;
		height: 60px !important;
	}
}

/* ---------- Seite „Meine Favoriten“ ---------- */

.mlxFavPage {
	color: var(--mlxf-text);
}

.mlxFavPage__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.mlxFavPage .mlxFavPage__title {
	margin: 0 !important;
	font-size: 1.75rem;
	font-weight: 800;
}

.mlxFavPage__count {
	margin: .25rem 0 0;
	color: var(--mlxf-muted);
}

.mlxFavPage__sort {
	display: inline-flex;
	padding: .2rem;
	border-radius: 999px;
	background: var(--mlxf-fill);
}

.mlxFavPage__sort a {
	padding: .4rem .9rem;
	border-radius: 999px;
	font-size: .875rem;
	font-weight: 700;
	text-decoration: none;
	color: var(--mlxf-muted);
}

.mlxFavPage__sort a.is-active {
	background: #fff;
	box-shadow: 0 1px 3px rgba(16, 24, 40, .12);
	color: var(--mlxf-dark);
}

.mlxFavPage__empty {
	padding: 2rem;
	border: 1px dashed var(--mlxf-line);
	border-radius: 14px;
	text-align: center;
}

.mlxFavPage__empty .mlxFav__heart {
	vertical-align: -.2em;
	color: var(--mlxf-heart);
}

.mlxFavPage__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mlxFavCard {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--mlxf-line);
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
	transition: opacity .25s ease, transform .25s ease;
}

.mlxFavCard > .mlxMini {
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	border-radius: 0;
}

.mlxFavCard.is-leaving {
	opacity: 0;
	transform: scale(.97);
}

.mlxFavCard__body {
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
	gap: .85rem;
	padding: 1rem;
}

.mlxFavCard__note textarea {
	display: block;
	width: 100%;
	min-height: 3.2rem;
	padding: .5rem .7rem;
	border: 1px solid transparent;
	border-radius: 10px;
	background: var(--mlxf-fill);
	font: inherit;
	font-size: .9375rem;
	resize: vertical;
}

.mlxFavCard__note textarea:focus {
	border-color: var(--mlxf-brand);
	outline: 0;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(78, 42, 86, .15);
}

.mlxFavCard__noteBar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: .75rem;
	min-height: 1.75rem;
	margin-top: .35rem;
}

.mlxFavCard__noteState {
	font-size: .8125rem;
	color: var(--mlxf-dark);
}

/* Mit JavaScript erscheint „Notiz speichern“ erst nach einer Änderung */
.mlxFavCard__noteSave {
	padding: .25rem .8rem;
	border: 1px solid var(--mlxf-dark);
	border-radius: 999px;
	background: #fff;
	font-size: .8125rem;
	font-weight: 700;
	color: var(--mlxf-dark);
	cursor: pointer;
}

.mlxFavPage--js .mlxFavCard__note:not(.is-dirty) .mlxFavCard__noteSave {
	display: none;
}

.mlxFavCard__actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin-top: auto;
}

.mlxFavCard__actions a {
	flex: 1 1 auto;
	padding: .5rem .9rem;
	border-radius: 999px;
	font-size: .875rem;
	font-weight: 700;
	text-align: center;
	text-decoration: none !important;
}

.mlxFavCard__profile {
	box-shadow: inset 0 0 0 1px var(--mlxf-line);
	color: var(--mlxf-dark) !important;
}

.mlxFavCard__msg {
	background: var(--mlxf-dark);
	color: #fff !important;
}

.mlxFavCard__msg:hover {
	background: var(--mlxf-brand);
}

/* ---------- Meldung ---------- */

.mlxFavToast {
	position: fixed;
	left: 50%;
	bottom: 1.5rem;
	z-index: 1080;
	max-width: calc(100vw - 2rem);
	padding: .65rem 1.1rem;
	border-radius: 999px;
	background: var(--mlxf-dark);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
	font-weight: 700;
	color: #fff;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 1rem);
	transition: opacity .2s ease, transform .2s ease;
}

.mlxFavToast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.mlxFavToast.is-error {
	background: #b42318;
}

@media (prefers-reduced-motion: reduce) {
	.mlxFav__heart,
	.mlxFavCard,
	.mlxFavToast {
		transition: none;
	}
}
