/*
 * NoConsent Manager - two-click embeds.
 * Uses the same --ncm-* variables as the banner. Button look matches .ncm-btn.
 */

.ncm-embed {
	--ncm-text: #1a1a1a;
	--ncm-bg: #ffffff;
	--ncm-accent: #444444;
	--ncm-font-heading: inherit;
	--ncm-font-text: inherit;
	--ncm-font-button: inherit;
	--ncm-radius: 6px;
	display: block;
	width: 100%;
	max-width: 100%;
	font-family: var(--ncm-font-text);
	container-type: inline-size;
}

/*
 * Placeholder (1.0.6): fills exactly the video area (16:9), border and colors selectable, content centered
 * horizontally and vertically. The placeholder is a <button>; theme / Elementor kit rules such as
 * ".elementor-kit-N button" (and :hover) beat class-only selectors, so every rule below uses
 * ".ncm-embed .ncm-embed__frame ..." (no !important). Colors come from the page unless set in the design tab:
 * background transparent, text = text color of the page (inherit), border and button = the Elementor global
 * accent color (--e-global-color-accent) or, without Elementor, the text color (currentColor).
 */
.ncm-embed .ncm-embed__frame {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr); /* the track never grows past the frame (long words, narrow containers) */
	width: 100%;
	box-sizing: border-box;
	overflow: hidden;
	border: var(--ncm-embed-border-width, 2px) solid var(--ncm-embed-border, var(--e-global-color-accent, currentColor));
	border-radius: var(--ncm-embed-radius, var(--ncm-radius));
	background: var(--ncm-embed-bg, transparent);
	color: var(--ncm-embed-text, inherit);
}

/* Spacer that keeps the aspect ratio; the placeholder shares its grid cell and grows with its content on small screens. */
.ncm-embed .ncm-embed__frame::before {
	content: '';
	grid-area: 1 / 1;
	width: 100%;
	aspect-ratio: var(--ncm-embed-ratio, 16 / 9);
}

.ncm-embed .ncm-embed__frame .ncm-embed__placeholder,
.ncm-embed .ncm-embed__frame .ncm-embed__placeholder:hover,
.ncm-embed .ncm-embed__frame .ncm-embed__placeholder:focus,
.ncm-embed .ncm-embed__frame .ncm-embed__placeholder:active {
	grid-area: 1 / 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	height: auto;
	margin: 0;
	padding: clamp(0.5rem, 3vw, 1.5rem);
	border: 0;
	border-radius: 0;
	box-shadow: none;
	background-color: var(--ncm-embed-bg, transparent);
	background-position: center;
	background-size: cover;
	color: var(--ncm-embed-text, inherit);
	font: inherit;
	text-align: center;
	text-transform: none;
	letter-spacing: normal;
	white-space: normal;
	cursor: pointer;
}

/* Poster: slight darkening layer (inset shadow over the poster, below the content); the panel stays solid for readability. */
.ncm-embed .ncm-embed__frame .ncm-embed__placeholder--poster,
.ncm-embed .ncm-embed__frame .ncm-embed__placeholder--poster:hover,
.ncm-embed .ncm-embed__frame .ncm-embed__placeholder--poster:focus {
	box-shadow: inset 0 0 0 100vmax rgba(0, 0, 0, 0.4);
}

/* On a poster the notice needs its own readable surface: dark panel, light text unless set in the design tab. */
.ncm-embed .ncm-embed__frame .ncm-embed__placeholder--poster .ncm-embed__panel {
	background: var(--ncm-embed-bg, rgba(0, 0, 0, 0.7));
	color: var(--ncm-embed-text, #ffffff);
}

.ncm-embed .ncm-embed__frame .ncm-embed__panel {
	position: static;
	display: block;
	box-sizing: border-box;
	max-width: 34rem;
	padding: 0.75rem 1rem;
	border-radius: var(--ncm-embed-radius, var(--ncm-radius));
	background: transparent;
	color: inherit;
	text-align: center;
}

/* Typography: heading / text / button settings; sizes are capped so the notice always fits the frame. */
.ncm-embed .ncm-embed__frame .ncm-embed__title {
	display: block;
	margin: 0 0 0.25rem;
	color: inherit;
	font-family: var(--ncm-font-heading);
	font-size: min(var(--ncm-size-heading, 0.9375rem), 1.25rem);
	font-weight: var(--ncm-weight-heading, 600);
	line-height: var(--ncm-lh-heading, 1.3);
	letter-spacing: var(--ncm-ls-heading, normal);
	text-transform: none;
}

.ncm-embed .ncm-embed__frame .ncm-embed__notice {
	display: block;
	margin: 0 0 0.5rem;
	color: inherit;
	font-family: var(--ncm-font-text);
	font-size: min(var(--ncm-size-text, 0.8125rem), 1.125rem);
	font-weight: var(--ncm-weight-text, 400);
	line-height: var(--ncm-lh-text, 1.4);
	letter-spacing: var(--ncm-ls-text, normal);
	text-transform: none;
	overflow-wrap: anywhere;
}

.ncm-embed .ncm-embed__frame .ncm-embed__action {
	display: inline-block;
	box-sizing: border-box;
	min-height: 2.75rem;
	min-width: 2.75rem;
	max-width: 100%;
	padding: 0.6rem 1.25rem;
	border: 2px solid var(--ncm-embed-btn-bg, var(--e-global-color-accent, currentColor));
	border-radius: var(--ncm-radius);
	background: var(--ncm-embed-btn-bg, transparent);
	color: var(--ncm-embed-btn-text, inherit);
	font-family: var(--ncm-font-button);
	font-size: min(var(--ncm-size-button, 0.9375rem), 1.125rem);
	font-weight: var(--ncm-weight-button, 600);
	line-height: var(--ncm-lh-button, 1.2);
	letter-spacing: var(--ncm-ls-button, normal);
	text-transform: none;
	transition: background-color 0.2s, border-color 0.2s;
}

.ncm-embed .ncm-embed__frame .ncm-embed__placeholder:hover .ncm-embed__action {
	background: var(--ncm-embed-btn-bg, color-mix(in srgb, currentColor 18%, transparent));
	filter: brightness(1.12);
}

.ncm-embed .ncm-embed__frame .ncm-embed__placeholder:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: -6px;
}

.ncm-embed__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Privacy link under the placeholder: theme-proof (kit rules on p / span / a), wraps instead of overflowing. */
.ncm-embed .ncm-embed__meta {
	max-width: 100%;
	margin: 0.4rem 0 0;
	font-size: 0.8125rem;
	letter-spacing: normal;
	text-transform: none;
	overflow-wrap: anywhere;
}

.ncm-embed .ncm-embed__meta a {
	max-width: 100%;
	color: inherit;
	font-size: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	text-decoration: underline;
	overflow-wrap: anywhere;
}

/*
 * Narrow container (phone, narrow column): smaller text and padding. The consent notice is never hidden and
 * never truncated: the frame grows with its content (aspect ratio is only the minimum area), the button stays visible.
 * Only the title may be shortened when space is tight.
 */
@container (max-width: 32rem) {
	.ncm-embed .ncm-embed__frame .ncm-embed__panel {
		padding: 0.5rem 0.625rem;
	}

	.ncm-embed .ncm-embed__frame .ncm-embed__title {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
		font-size: min(var(--ncm-size-heading, 0.875rem), 1.125rem);
	}

	.ncm-embed .ncm-embed__frame .ncm-embed__notice {
		font-size: min(var(--ncm-size-text, 0.75rem), 1rem);
	}
}

@container (max-width: 18rem) {
	.ncm-embed .ncm-embed__frame .ncm-embed__panel {
		padding: 0.375rem 0.5rem;
	}

	.ncm-embed .ncm-embed__frame .ncm-embed__title {
		-webkit-line-clamp: 1;
	}

	.ncm-embed .ncm-embed__frame .ncm-embed__notice {
		margin-bottom: 0.375rem;
		font-size: min(var(--ncm-size-text, 0.75rem), 0.75rem);
		line-height: 1.3;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ncm-embed .ncm-embed__frame .ncm-embed__action {
		transition: none;
	}
}
