/**
 * Particle Background front-end styles.
 *
 * Colours and height arrive as custom properties on :root, written by PHP from
 * validated settings. A per-instance override is set inline on the container.
 */

.hbpb-container {
	position: relative;
	overflow: hidden;
	background-color: var( --hbpb-bg, #b61924 );
	isolation: isolate;
}

/* Full-height block prepended to the front or blog page. */
.hbpb-container--hero {
	width: 100%;
	height: var( --hbpb-height, 100vh );
}

/* Rendered in place of a shortcode. */
.hbpb-container--inline {
	width: 100%;
	height: var( --hbpb-height, 100vh );
}

/* Injected into an element matched by the CSS selector setting. It fills its
   host rather than adding height of its own. */
.hbpb-container--target {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	width: auto;
	height: auto;
	z-index: 0;
}

.hbpb-canvas {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	z-index: 0;
}

.hbpb-content {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 0 16px;
	box-sizing: border-box;
	color: var( --hbpb-text, #ffffff );
	text-align: center;
	pointer-events: none;
}

/* Links and buttons in the overlay stay usable even though the wrapper
   forwards pointer events through to the canvas. */
.hbpb-content a,
.hbpb-content button,
.hbpb-content input,
.hbpb-content select,
.hbpb-content textarea {
	pointer-events: auto;
}

.hbpb-content > :first-child {
	margin-top: 0;
}

.hbpb-content > :last-child {
	margin-bottom: 0;
}

.hbpb-content p {
	font-size: clamp( 1.75rem, 5vw, 2.75rem );
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.2;
}

/* The renderer already draws a still frame when reduced motion is requested;
   this guards against a flash before the script runs. */
@media ( prefers-reduced-motion: reduce ) {
	.hbpb-canvas {
		animation: none !important;
		transition: none !important;
	}
}
