
/* ============================================
 * Block: Video
 * ============================================ */

.block-video {
	display: grid;
	position: relative;
	background-color: #000;
	/* Ohne Poster ist var() ungültig → Deklaration entfällt, schwarzer Fallback bleibt */
	background-image: linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.55)), var(--jw-video-poster);
	background-size: cover;
	background-position: center;
	overflow: hidden;
}

/* Mindesthöhe 16:9, relativ zur Blockbreite (nicht zum Viewport). Als Grid-Zeile
   statt aspect-ratio, damit der Einwilligungstext den Block auf schmalen
   Viewports höher machen darf, statt abgeschnitten zu werden. */
.block-video::before {
	content: "";
	grid-area: 1 / 1;
	padding-top: 56.25%;
}

.block-video__overlay,
.block-video iframe {
	grid-area: 1 / 1;
}

.block-video iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

.block-video__overlay {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	padding: 2rem;
	color: var(--wp--preset--color--white);
	text-align: center;
}

.block-video__overlay[hidden] {
	display: none;
}

.block-video__title {
	font-size: var(--wp--preset--font-size--large, 1.25rem);
	font-weight: 700;
}

.block-video__text {
	max-width: 46rem;
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	opacity: 0.8;
}

.block-video__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--jw-space-16);
	font-size: var(--wp--preset--font-size--small, 0.875rem);
}

.block-video__links a {
	color: inherit;
	text-decoration: underline;
}

.block-video__consent {
	background: transparent;
	border: 0;
	color: inherit;
	cursor: pointer;
}

.block-video__button {
	display: inline-block;
	margin-top: 0.5rem;
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--white);
	color: #000;
	font-weight: 700;
}

.block-video__settings {
	background: transparent;
	border: 0;
	color: inherit;
	font-size: var(--wp--preset--font-size--small, 0.875rem);
	text-decoration: underline;
	cursor: pointer;
}


/* --------------------------------------------
 * Consent liegt vor
 * Kein Einwilligungstext mehr, nur Poster + Play-Button.
 * Das iframe lädt weiterhin erst beim Klick.
 * -------------------------------------------- */

.block-video--consented .block-video__text,
.block-video--consented .block-video__links,
.block-video--consented .block-video__button {
	display: none;
}

/* Ohne gepflegten Titel steht dort nur „Video laden" – neben dem Play-Button doppelt */
.block-video--consented .block-video__title--fallback {
	display: none;
}

/* Ganze Fläche klickbar wie bei einem normalen Video-Thumbnail. Der Titel
   rutscht dafür nach oben, sonst läge er unter dem zentrierten Play-Button. */
.block-video--consented .block-video__overlay {
	justify-content: flex-start;
}

.block-video--consented .block-video__consent {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.block-video__play {
	display: none;
}

.block-video--consented .block-video__play {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--jw-space-20);
	border-radius: 50%;
	background: var(--wp--preset--color--white);
	color: #000;
}

/*# sourceURL=/wp-content/themes/jw-base/blocks/video/style.css */
