/* HTA YouTube Banner Popup – override the variables in Elementor > Site Settings > Custom CSS */
:root {
	--hta-ybp-size: 66px;            /* play button width (desktop) */
	--hta-ybp-bg: #ffffff;           /* button colour */
	--hta-ybp-icon: #1f2a3a;         /* triangle colour */
	--hta-ybp-hover-bg: #ffffff;
	--hta-ybp-overlay: rgba(0, 0, 0, 0.9);
	--hta-ybp-max-w: 1100px;
}

/* ---------- Overlay that centres the button on the banner ---------- */
.hta-ybp-host,
.elementor-widget-shortcode:has(.hta-ybp--center) {
	position: absolute !important;
	inset: 0 !important;
	z-index: 6;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	pointer-events: none; /* clicks pass through to the slide… */
}
.hta-ybp-host > .elementor-widget-container,
.hta-ybp-host .elementor-shortcode { height: 100%; }

.hta-ybp--center {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
}
.hta-ybp--inline { display: inline-block; }

/* ---------- The play button ---------- */
.hta-ybp-btn {
	pointer-events: auto; /* …except on the button itself */
	display: grid;
	place-items: center;
	padding: 0;
	margin: 0;
	border: 0;
	background: none;
	cursor: pointer;
	line-height: 0;
	-webkit-tap-highlight-color: transparent;
}
.hta-ybp-btn__shape {
	display: grid;
	place-items: center;
	width: var(--hta-ybp-size);
	aspect-ratio: 1.42;
	border-radius: 24% / 34%;
	background: var(--hta-ybp-bg);
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hta-ybp-btn__tri {
	width: 0;
	height: 0;
	border-block: calc(var(--hta-ybp-size) * 0.12) solid transparent;
	border-left: calc(var(--hta-ybp-size) * 0.2) solid var(--hta-ybp-icon); /* always points right, also in RTL */
	margin-left: calc(var(--hta-ybp-size) * 0.04);
}
.hta-ybp-btn__img { width: var(--hta-ybp-size); height: auto; transition: transform 0.2s ease; }

.hta-ybp-btn:hover .hta-ybp-btn__shape,
.hta-ybp-btn:focus-visible .hta-ybp-btn__shape {
	transform: scale(1.08);
	background: var(--hta-ybp-hover-bg);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.hta-ybp-btn:hover .hta-ybp-btn__img { transform: scale(1.08); }
.hta-ybp-btn:focus-visible { outline: 3px solid #fff; outline-offset: 6px; border-radius: 14px; }

@media (max-width: 767px) {
	:root { --hta-ybp-size: 50px; }
}

/* ---------- Lightbox ---------- */
html.hta-ybp-lock, html.hta-ybp-lock body { overflow: hidden; }

.hta-ybp-modal[hidden] { display: none; }
.hta-ybp-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	place-items: center;
	padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
	opacity: 0;
	transition: opacity 0.25s ease;
}
.hta-ybp-modal.is-open { opacity: 1; }

.hta-ybp-modal__backdrop {
	position: absolute;
	inset: 0;
	background: var(--hta-ybp-overlay);
}

.hta-ybp-modal__stage {
	position: relative;
	width: min(var(--hta-ybp-max-w), 100%);
	transform: scale(0.97);
	transition: transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hta-ybp-modal.is-open .hta-ybp-modal__stage { transform: none; }

.hta-ybp-modal__bar {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-block-end: 10px;
	color: #fff;
}
.hta-ybp-modal__title {
	margin: 0;
	font-size: clamp(16px, 1.6vw, 20px);
	font-weight: 600;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.hta-ybp-modal__close {
	flex: none;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	margin-inline-start: auto;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
.hta-ybp-modal__close:hover { background: rgba(255, 255, 255, 0.12); }
.hta-ybp-modal__close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.hta-ybp-modal__close svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

.hta-ybp-modal__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	max-height: calc(100vh - 120px);
	margin-inline: auto;
	border-radius: 8px;
	overflow: hidden;
	background: #000;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.hta-ybp-modal__frame.is-vertical { aspect-ratio: 9 / 16; width: min(420px, 100%); }
.hta-ybp-modal__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.hta-ybp-modal__spinner {
	position: absolute;
	inset: 50% auto auto 50%;
	width: 40px;
	height: 40px;
	margin: -20px 0 0 -20px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: #fff;
	border-radius: 50%;
	animation: hta-ybp-spin 0.8s linear infinite;
}
.hta-ybp-modal__frame.is-loaded .hta-ybp-modal__spinner { display: none; }
@keyframes hta-ybp-spin { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
	.hta-ybp-modal { padding-inline: 0; }
	.hta-ybp-modal__bar { padding-inline: 12px; }
	.hta-ybp-modal__frame { border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.hta-ybp-modal, .hta-ybp-modal__stage, .hta-ybp-btn__shape, .hta-ybp-btn__img { transition: none; }
}
