/* KREISMUSIK – Zwei-Klick-Einbettungen und Video-Galerien */

.km-embed {
	container-type: inline-size; /* Kopfzeile skaliert mit der Breite des Videos */
	/* isolation + transform: Safari schneidet iframes sonst nicht an den runden Ecken ab */
	isolation: isolate;
	transform: translateZ(0);
	position: relative;
	width: 100%;
	max-width: 800px;
	aspect-ratio: 16 / 9;
	margin: 0 0 24px;
	background: #2b2b2b;
	border-radius: 15px; /* wie Bilder und Künstlerbilder */
	overflow: hidden;
	cursor: pointer;
	color: #eee;
	text-align: center;
}

.km-embed.is-loaded {
	cursor: auto;
	background: #000;
}

.entry-content .km-embed iframe,
.km-embed iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	margin: 0;
	border-radius: 15px; /* wie Bilder und Künstlerbilder */
}

.km-embed img.km-embed-poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
	margin: 0 !important;
	border-radius: 0 !important;
}

.km-embed-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 16px;
	font-family: var(--km-font-text, "Helvetica Neue", Helvetica, Arial, sans-serif);
	font-size: 12px;
	line-height: 17px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Kopfzeile wie im YouTube-Player: Kanal-Icon, Titel, Kanalname */
.km-embed-header {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	gap: clamp(8px, 2cqi, 14px);
	padding: clamp(10px, 3cqi, 22px) clamp(12px, 3.5cqi, 26px) clamp(24px, 7cqi, 56px);
	background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
	color: #fff;
	text-align: left;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
	pointer-events: none;
}

.km-embed-avatar {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: clamp(28px, 6cqi, 48px);
	height: clamp(28px, 6cqi, 48px);
	border-radius: 50%;
	overflow: hidden;
	background: #fff;
	color: #333;
	font-weight: bold;
	font-size: clamp(13px, 2.6cqi, 20px);
	text-shadow: none;
}

.entry-content .km-embed-avatar img,
.km-embed-avatar img {
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	margin: 0;
	border-radius: 50%;
}

.km-embed-meta {
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.km-embed-title,
.km-embed-channel {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.km-embed-title {
	font-weight: bold;
	font-size: clamp(13px, 2.4cqi, 20px);
	line-height: 1.25;
}

.km-embed-channel {
	font-size: clamp(11px, 1.6cqi, 14px);
	line-height: 1.35;
	opacity: 0.92;
}

.km-consent-text {
	max-width: 420px;
}

.km-consent-text a {
	color: inherit;
}

/* Beim Darüberfahren leicht heller bzw. (SoundCloud) dunkler – der Mauszeiger allein zeigt den
   Link nicht an, der ganze Platzhalter ist anklickbar */
.km-consent-text a:hover,
.km-consent-text a:focus-visible {
	color: rgba(255, 255, 255, 0.9); /* Videos: normal 0.78 – nur leicht heller */
}

/* Datenschutzhinweis bei Videos: Leiste am unteren Rand, auf jedem Motiv lesbar */
.km-consent-bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	max-width: none;
	padding: 7px 14px;
	background: rgba(0, 0, 0, 0.72);
	color: rgba(255, 255, 255, 0.78);
	text-shadow: none;
	font-size: 12px;
	line-height: 17px;
}

/* Text-Button (sonstige Dienste wie Bandcamp, Spotify) */
.km-consent-textbutton {
	appearance: none;
	background: rgba(255, 255, 255, 0.92);
	background-image: none;
	color: #000;
	border: 0;
	border-radius: 3px;
	padding: 6px 16px;
	font: 13px/19px "Helvetica Neue", Helvetica, Arial, sans-serif;
	cursor: pointer;
	text-shadow: none;
	box-shadow: none;
}

.km-consent-textbutton:hover,
.km-consent-textbutton:focus-visible {
	background: #fff;
	text-decoration: underline;
}

/* Play-Symbol (bei Videos zugleich der Button) */
.km-play {
	display: block;
	width: 68px;
	height: 48px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 12px;
	background: rgba(0, 0, 0, 0.7);
	background-image: none;
	box-shadow: none;
	position: relative;
	cursor: pointer;
	transition: background-color 0.15s;
}

button.km-play:hover,
button.km-play:focus,
.km-embed:hover button.km-play {
	background: rgba(0, 0, 0, 0.88);
	background-image: none;
	box-shadow: none;
}

/* Play-Button in der Farbe des Dienstes (wie im Original-Player) */
.km-service-youtube button.km-play {
	background: #e62117;
}

.km-service-youtube button.km-play:hover,
.km-service-youtube button.km-play:focus,
.km-embed.km-service-youtube:hover button.km-play {
	background: #ff0000;
}

.km-service-vimeo button.km-play {
	background: rgba(26, 183, 234, 0.95);
}

.km-service-vimeo button.km-play:hover,
.km-service-vimeo button.km-play:focus,
.km-embed.km-service-vimeo:hover button.km-play {
	background: #1ab7ea;
}

button.km-play:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

.km-play::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-35%, -50%);
	border-style: solid;
	border-width: 11px 0 11px 18px;
	border-color: transparent transparent transparent #fff;
}

/* Kein Seitenverhältnis bei reinen Audio-Playern/Formularen: Höhe kommt aus dem iframe */
.km-embed:not(.km-embed-video)[style*="height:"] {
	aspect-ratio: auto;
}

/* ---- Video-Galerie: Bühne + 3 Spalten wie bisher ---- */

/* Wie beim alten Plugin: bei nur einem Video keine Vorschauliste */
.km-videos-single .km-videos-list {
	display: none;
}

.km-videos {
	margin-bottom: 100px;
}

.km-videos-stage {
	max-width: 800px;
	margin-bottom: 24px;
}

.km-videos-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px 19px;
}

.entry-content .km-videos-list li,
.km-videos-list li {
	margin: 0;
	padding: 0;
	list-style: none;
	min-height: 191px; /* Kachelhöhe wie beim alten Plugin */
}

.km-videos-link {
	display: block;
	color: #333;
	text-decoration: none;
	text-align: left;
}

.km-videos-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	background: #2b2b2b;
	border-radius: 15px; /* wie Bilder und Künstlerbilder */
	overflow: hidden;
}

.entry-content .km-videos-thumb img,
.km-videos-thumb img {
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
}

.km-play-small {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.25);
	border: 2px solid rgba(255, 255, 255, 0.55);
	box-sizing: border-box;
}

.km-play-small::after {
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent rgba(255, 255, 255, 0.75);
	transform: translate(-30%, -50%);
}

.km-videos-title {
	/* wie bisher höchstens zwei Zeilen, Rest mit … (voller Titel im title-Attribut) */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	margin-top: 4px;
	font-family: var(--km-font-text, "Helvetica Neue", Helvetica, Arial, sans-serif);
	font-size: 12px;
	line-height: 20px;
}

.km-videos-item.is-selected .km-videos-title,
.km-videos-link:hover .km-videos-title,
.km-videos-link:focus-visible .km-videos-title {
	text-decoration: underline;
}

@media screen and (max-width: 599px) {
	.km-videos-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 14px 12px;
	}
	.entry-content .km-videos-list li,
	.km-videos-list li {
		min-height: 0;
	}
	.km-videos {
		margin-bottom: 48px;
	}
	.km-embed-overlay {
		font-size: 11px;
		line-height: 15px;
		gap: 6px;
	}
}

/* ---- Video-Block des Editors ("Einbetten"/YouTube-Block) ----
   Der Block reserviert per ::before schon Platz fürs Seitenverhältnis; die Vorschau
   übernimmt das selbst, sonst entstünde darüber eine leere Fläche. */
/* spezifischer als WordPress' ".wp-embed-responsive .wp-embed-aspect-16-9 .wp-block-embed__wrapper:before" */
.wp-embed-responsive .wp-block-embed.wp-has-aspect-ratio .wp-block-embed__wrapper:has(> .km-embed)::before,
.wp-block-embed .wp-block-embed__wrapper:has(> .km-embed)::before {
	content: none;
	display: none;
	padding: 0;
}

.wp-block-embed .km-embed {
	max-width: 100% !important;
	aspect-ratio: 16 / 9 !important;
	margin-bottom: 0;
}

.wp-embed-aspect-21-9 .km-embed { aspect-ratio: 21 / 9 !important; }
.wp-embed-aspect-18-9 .km-embed { aspect-ratio: 18 / 9 !important; }
.wp-embed-aspect-4-3 .km-embed { aspect-ratio: 4 / 3 !important; }
.wp-embed-aspect-1-1 .km-embed { aspect-ratio: 1 / 1 !important; }
.wp-embed-aspect-9-16 .km-embed { aspect-ratio: 9 / 16 !important; }
.wp-embed-aspect-1-2 .km-embed { aspect-ratio: 1 / 2 !important; }

/* ---- SoundCloud: Platzhalter im Stil des SoundCloud-Players ---- */

.km-embed-audio {
	display: flex;
	aspect-ratio: auto;
	background: #fff;
	color: #333;
	text-align: left;
	font-family: var(--km-font-text, "Helvetica Neue", Helvetica, Arial, sans-serif);
}

.km-embed-audio.is-loaded {
	display: block;
	background: transparent;
}

.entry-content .km-embed-audio img.km-audio-cover,
.km-embed-audio img.km-audio-cover {
	flex: none;
	width: auto;
	height: 100% !important;
	max-width: none;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	margin: 0 !important;
	border-radius: 0 !important;
}

.km-audio-main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 12px 14px 9px;
}

.km-audio-head {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

button.km-audio-play {
	flex: none;
	position: relative;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: #f50;
	background-image: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s;
}

button.km-audio-play:hover,
button.km-audio-play:focus,
.km-embed-audio:hover button.km-audio-play {
	background: #e64a00;
	background-image: none;
	box-shadow: none;
}

button.km-audio-play:focus-visible {
	outline: 2px solid #333;
	outline-offset: 3px;
}

.km-audio-play::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-35%, -50%);
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent #fff;
}

.km-audio-meta {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding-top: 2px;
}

.km-audio-author,
.km-audio-title {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.km-audio-author {
	font-size: 12px;
	line-height: 17px;
	color: #999;
}

.km-audio-title {
	font-size: 15px;
	line-height: 21px;
	color: #333;
}

.km-audio-brand {
	flex: none;
	font-size: 11px;
	line-height: 17px;
	font-weight: bold;
	color: #f50;
}

.km-audio-wave {
	display: block;
	flex: 1;
	min-height: 0;
	width: 100%;
}

.km-audio-wave-top {
	fill: #b8b8b8;
}

.km-audio-wave-fade {
	fill: #e3e3e3;
}

.km-embed-audio:hover .km-audio-wave-top {
	fill: #a0a0a0;
}

.km-consent-text.km-audio-note {
	max-width: none;
	font-size: 11px;
	line-height: 15px;
	color: #888;
}

.km-audio-note a:hover,
.km-audio-note a:focus-visible {
	color: #333;
}

/* „Visueller“ Player: Cover als Hintergrund, Beschriftung auf dunklen Feldern */
.km-audio-visual {
	background: #333;
	color: #fff;
}

.entry-content .km-audio-visual img.km-audio-cover,
.km-audio-visual img.km-audio-cover {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	aspect-ratio: auto;
}

.km-audio-visual::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.55));
}

.km-audio-visual .km-audio-main {
	padding: 18px 20px 10px;
}

.km-audio-visual button.km-audio-play {
	width: 60px;
	height: 60px;
}

.km-audio-visual .km-audio-play::after {
	border-width: 12px 0 12px 20px;
}

.km-audio-visual .km-audio-meta {
	align-items: flex-start;
	gap: 4px;
	padding-top: 0;
}

.km-audio-visual .km-audio-author,
.km-audio-visual .km-audio-title {
	max-width: 100%;
	padding: 2px 7px;
	background: rgba(0, 0, 0, 0.82);
	color: #ccc;
}

.km-audio-visual .km-audio-title {
	color: #fff;
	font-size: 17px;
	line-height: 24px;
}

.km-audio-visual .km-audio-brand {
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.km-audio-visual .km-audio-wave {
	flex: none;
	height: 64px;
	margin-top: auto;
}

.km-audio-visual .km-audio-wave-top,
.km-audio-visual:hover .km-audio-wave-top {
	fill: rgba(255, 255, 255, 0.9);
}

.km-audio-visual .km-audio-wave-fade {
	fill: rgba(255, 255, 255, 0.4);
}

.km-audio-visual .km-audio-note {
	color: rgba(255, 255, 255, 0.85);
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.km-audio-visual .km-audio-note a:hover,
.km-audio-visual .km-audio-note a:focus-visible {
	color: #fff;
}

/* Schmale Spalte (Handy): Cover weglassen, damit Titel und Wellenform Platz haben */
@container (max-width: 459px) {
	.km-embed-audio:not(.km-audio-visual) img.km-audio-cover,
	.km-audio-brand {
		display: none;
	}
}

/* ---- Newsletter: Brevos Formular-Code (newsletter.php) ----
   Brevo setzt Schriftgrößen an den umgebenden Elementen; die Absatz-Regeln des Themes
   würden sie sonst überschreiben. */
.entry-content .km-newsletter .sib-form p {
	font-size: inherit;
	line-height: inherit;
	margin: 0;
}

/* Hover: Das alte Theme (legacy.css) legt einen fast weißen Verlauf über alle Buttons.
   Stattdessen Brevos Grau etwas abdunkeln (!important wegen Brevos Inline-Farbe). */
.km-newsletter .sib-form-block__button:hover,
.km-newsletter .sib-form-block__button:focus-visible {
	background-color: #555 !important;
	background-image: none;
	color: #fff !important;
}
