/**
 * MNS Termly Video Placeholder
 *
 * Colors are the site's Elementor global palette:
 *   Primary #183C48 | Secondary #F1F0EE | Text #083333 | Accent #E0BE74
 *
 * Values are hardcoded rather than referencing --e-global-color-* on purpose:
 * WP Rocket's Remove Unused CSS is active with an EMPTY safelist on this site and
 * strips those custom properties from the page. Relying on them is exactly what
 * caused the invisible footer Privacy Policy link. Hardcoding is RUCSS-proof.
 */

/**
 * Sizing note: for YouTube there is NO iframe when blocked (Elementor never builds
 * one because Termly blocked youtube.com/iframe_api), so .elementor-wrapper can
 * collapse to zero height. We must give the box its own aspect ratio rather than
 * relying on an iframe to hold it open.
 */
.mns-has-video-placeholder {
	position: relative;
	aspect-ratio: 16 / 9;
	min-height: 200px;
	width: 100%;
}

/* Fallback for browsers without aspect-ratio support. */
@supports not ( aspect-ratio: 16 / 9 ) {
	.mns-has-video-placeholder {
		padding-top: 56.25%;
		height: 0;
	}
}

/* Hide any neutered iframe so it can't leave a grey box behind the placeholder. */
.mns-has-video-placeholder iframe[data-autoblocked] {
	visibility: hidden;
}

.mns-video-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	background-color: #183C48;
	color: #F1F0EE;
	text-align: center;
	box-sizing: border-box;
}

.mns-video-placeholder__inner {
	max-width: 34rem;
	margin: 0 auto;
}

.mns-video-placeholder__icon {
	display: block;
	margin: 0 auto 0.85rem;
	color: #E0BE74;
	line-height: 0;
}

.mns-video-placeholder__icon svg {
	display: inline-block;
	max-width: 100%;
	height: auto;
}

.mns-video-placeholder .mns-video-placeholder__heading {
	margin: 0 0 0.35rem;
	font-family: "Urbanist", Helvetica, Arial, sans-serif;
	font-size: 1.15rem;
	line-height: 1.35;
	font-weight: 500;
	color: #FFFFFF;
	text-transform: none;
	letter-spacing: normal;
}

.mns-video-placeholder .mns-video-placeholder__body {
	margin: 0 0 1.1rem;
	font-family: "Urbanist", Helvetica, Arial, sans-serif;
	font-size: 0.95rem;
	line-height: 1.5;
	font-weight: 400;
	color: #F1F0EE;
	opacity: 0.9;
	text-transform: none;
	letter-spacing: normal;
}

/**
 * The button label was rendering invisible: the placeholder is injected inside an
 * Elementor container whose descendant-anchor rules outrank a single-class
 * selector, and the theme's Canela/Urbanist stack has no 600 weight, so the label
 * could also fall back to an unrendered face. Fixes below:
 *   - selector doubled (.x.x) to raise specificity without !important
 *   - font-family/size/weight/color pinned explicitly so nothing is inherited
 *   - font-weight 500, which the loaded faces actually provide
 *   - text-indent/transform neutralised in case a parent rule shifts the label
 */
.mns-video-placeholder button.mns-video-placeholder__link.mns-video-placeholder__link,
.mns-video-placeholder button.mns-video-placeholder__link.mns-video-placeholder__link:visited {
	display: inline-block;
	box-sizing: border-box;
	/* Reset UA button styling - this is a <button>, not an <a>. */
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0.6rem 1.4rem;
	border: 1px solid #E0BE74;
	border-radius: 2px;
	background-color: transparent;
	color: #E0BE74;
	font-family: "Urbanist", Helvetica, Arial, sans-serif;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.02em;
	text-align: center;
	text-decoration: none;
	text-indent: 0;
	text-transform: none;
	white-space: normal;
	visibility: visible;
	opacity: 1;
	transition: background-color 0.2s ease, color 0.2s ease;
	cursor: pointer;
}

.mns-video-placeholder button.mns-video-placeholder__link.mns-video-placeholder__link:hover,
.mns-video-placeholder button.mns-video-placeholder__link.mns-video-placeholder__link:focus {
	background-color: #E0BE74;
	color: #183C48;
	text-decoration: none;
}

.mns-video-placeholder button.mns-video-placeholder__link.mns-video-placeholder__link:focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: 2px;
}

/**
 * Termly may add `termly-display-preferences--disabled` to elements carrying its
 * class. We bind our own click handler and call window.displayPreferenceModal()
 * directly, so our button stays functional regardless - do NOT let that class
 * grey it out or it would look broken while still working.
 */
.mns-video-placeholder button.mns-video-placeholder__link.termly-display-preferences--disabled {
	opacity: 1;
	cursor: pointer;
}

/* Tighten up inside small embeds (sidebars, narrow columns). */
@media (max-width: 600px) {
	.mns-video-placeholder {
		padding: 1rem;
	}

	.mns-video-placeholder__heading {
		font-size: 1rem;
	}

	.mns-video-placeholder__body {
		font-size: 0.875rem;
		margin-bottom: 0.9rem;
	}

	.mns-video-placeholder__icon svg {
		width: 28px;
		height: 28px;
	}
}
