/**
 * OKC video popup — trigger button + lightbox.
 *
 * Replaces the [video_popup] shortcode the legacy templates called, so widgets
 * carry their own popup and do not depend on a separate plugin.
 *
 * Every button property below reads a custom property, so the widget's Style
 * controls can drive it without any of these rules needing !important.
 */

/* ==========================================================================
   TRIGGER
   ========================================================================== */
.okc-w .okc-video-popup {
	display: flex;
	justify-content: var(--okc-video-align, center);
	margin-top: var(--okc-video-offset-top, 2rem);
}

.okc-w .okc-video-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--okc-video-btn-gap, 0.625rem);
	cursor: pointer;
	border: none;
	font-family: var(--okc-video-btn-font, "Pragmatica", "PT Sans", sans-serif);
	font-size: var(--okc-video-btn-size, 0.875rem);
	font-weight: var(--okc-video-btn-weight, 700);
	letter-spacing: var(--okc-video-btn-tracking, 0.025em);
	text-transform: var(--okc-video-btn-transform, uppercase);
	line-height: 1;
	color: var(--okc-video-btn-color, #ffffff);
	background-color: var(--okc-video-btn-bg, #0a3b5c);
	padding: var(--okc-video-btn-pad-y, 0.875rem) var(--okc-video-btn-pad-x, 2rem);
	border-radius: var(--okc-video-btn-radius, 0.375rem);
	transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease,
		box-shadow 0.3s ease;
	/* box-shadow is deliberately not set here — the Box Shadow group control owns
	   it, and declaring it would compete with that control's generated rule. */
}

/* Shape presets. */
.okc-w .okc-video-btn--pill {
	border-radius: 9999px;
}

.okc-w .okc-video-btn--square {
	border-radius: 0;
}

.okc-w .okc-video-btn:hover {
	color: var(--okc-video-btn-color-hover, #ffffff);
	background-color: var(--okc-video-btn-bg-hover, #c41e3a);
	transform: translateY(-2px);
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.okc-w .okc-video-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.okc-w .okc-video-btn__icon {
	display: inline-flex;
	flex: 0 0 auto;
}

.okc-w .okc-video-btn__icon svg {
	display: block;
	width: var(--okc-video-btn-icon-size, 20px);
	height: var(--okc-video-btn-icon-size, 20px);
}

/* Circle preset drops the label and squares the box. */
.okc-w .okc-video-btn--circle {
	padding: 0;
	width: var(--okc-video-btn-circle-size, 4rem);
	height: var(--okc-video-btn-circle-size, 4rem);
	border-radius: 9999px;
}

.okc-w .okc-video-btn--circle .okc-video-btn__text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Pulse ring, useful on the circle preset. */
.okc-w .okc-video-btn--pulse {
	position: relative;
}

.okc-w .okc-video-btn--pulse::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: 0 0 0 0 var(--okc-video-btn-bg, #0a3b5c);
	animation: okc-video-pulse 2.4s ease-out infinite;
	pointer-events: none;
}

@keyframes okc-video-pulse {
	0%   { box-shadow: 0 0 0 0 currentColor; opacity: 0.5; }
	100% { box-shadow: 0 0 0 22px currentColor; opacity: 0; }
}

/* ==========================================================================
   LIGHTBOX  (markup is created by okc-video-modal.js, outside .okc-w)
   ========================================================================== */
.okc-vmodal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.25rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.okc-vmodal.is-open {
	opacity: 1;
	visibility: visible;
}

.okc-vmodal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	cursor: pointer;
}

.okc-vmodal__frame {
	position: relative;
	width: 100%;
	max-width: 62rem;
	transform: scale(0.96);
	transition: transform 0.3s ease;
}

.okc-vmodal.is-open .okc-vmodal__frame {
	transform: scale(1);
}

.okc-vmodal__media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 0.5rem;
	overflow: hidden;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* Fallback for browsers without aspect-ratio. */
@supports not (aspect-ratio: 16 / 9) {
	.okc-vmodal__media { padding-top: 56.25%; height: 0; }
}

.okc-vmodal__media iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.okc-vmodal__close {
	position: absolute;
	top: -3rem;
	right: 0;
	width: 2.5rem;
	height: 2.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-radius: 9999px;
	color: #fff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	transition: transform 0.3s ease, background-color 0.3s ease;
}

.okc-vmodal__close:hover {
	background: rgba(255, 255, 255, 0.15);
	transform: rotate(90deg);
}

.okc-vmodal__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

@media (max-width: 640px) {
	.okc-vmodal__close { top: -2.75rem; }
}

/* Set on <html> while a popup is open. */
.okc-vmodal-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.okc-vmodal,
	.okc-vmodal__frame,
	.okc-vmodal__close,
	.okc-w .okc-video-btn {
		transition: none;
	}
	.okc-w .okc-video-btn--pulse::after { animation: none; }
}
