/*!
 * Nil Elementor Addons — Live Card widget
 * Frontend styles for the .nil-live-card component.
 */

.nil-live-card-wrap {
	display: flex;
	width: 100%;
	justify-content: center;
}

.nil-live-card {
	--card-aspect: 534 / 692;
	--live-color: #ef2929;
	--pulse-color: rgba(239, 41, 41, 0.65);
	--pulse-spread: 14px;
	--pulse-duration: 1.8s;
	--indicator-offset: 32px;
	--frame-color: #ffffff;
	--frame-thickness: 1;

	position: relative;
	display: block;
	width: 100%;
	max-width: 534px;
	aspect-ratio: var(--card-aspect);
	margin: 0;
	overflow: hidden;
	background-color: #1a1a1a;
}

.nil-live-card__link {
	display: block;
	width: 100%;
	color: inherit;
	text-decoration: none;
}

.nil-live-card__media {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
}

/*
 * Frame: four L-shaped corner brackets, drawn as a single inline SVG.
 * Path coordinates are in viewBox (534 × 692) units that match the Figma
 * source, so the brackets sit at the exact proportional positions at any
 * card size. preserveAspectRatio="none" lets the SVG stretch to any aspect
 * ratio; vector-effect: non-scaling-stroke keeps the stroke width constant
 * regardless of how the SVG is scaled.
 */
.nil-live-card__frame {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
	z-index: 1;
	fill: none;
	stroke: var(--frame-color, #ffffff);
	stroke-width: var(--frame-thickness, 1);
	stroke-linecap: butt;
	stroke-linejoin: miter;
}

.nil-live-card__frame path {
	vector-effect: non-scaling-stroke;
}

.nil-live-card__indicator {
	position: absolute;
	display: inline-flex;
	align-items: center;
	gap: 12px;
	z-index: 2;
	/* Default position (bottom-center) — overridden via inline CSS variables. */
	top: auto;
	right: auto;
	bottom: var(--indicator-offset);
	left: 50%;
	transform: translateX(-50%);
	pointer-events: none;
}

.nil-live-card__dot {
	position: relative;
	display: block;
	flex-shrink: 0;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background-color: var(--live-color);
}

.nil-live-card--pulsing .nil-live-card__dot::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	animation: nil-live-pulse var(--pulse-duration) ease-out infinite;
}

@keyframes nil-live-pulse {
	0% {
		box-shadow: 0 0 0 0 var(--pulse-color);
	}
	70% {
		box-shadow: 0 0 0 var(--pulse-spread) transparent;
	}
	100% {
		box-shadow: 0 0 0 0 transparent;
	}
}

.nil-live-card__label {
	margin: 0;
	display: inline-block;
	color: #ffffff;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 1px;
	line-height: 1;
	text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
	.nil-live-card--pulsing .nil-live-card__dot::after {
		animation: none;
	}
}
