/* =========================================================================
   Font Previewer for Bricks Builder
   CSS custom properties are injected inline by PHP on each .fp-wrapper
   ========================================================================= */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.fp-wrapper {
	display: flex;
	flex-direction: column;
	gap: 10px;
	box-sizing: border-box;
	width: 100%;
}

/* ── Controls bar ─────────────────────────────────────────────────────────── */
.fp-controls {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: var( --fp-gap, 8px );
}

/* ── +/− Buttons ─────────────────────────────────────────────────────────── */
.fp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	cursor: pointer;
	user-select: none;
	font-weight: 700;
	line-height: 1;
	/* background, color, border, border-radius set via Bricks style controls */
	background: #f0f0f0;
	color: #333;
	border: 1px solid #ccc;
	border-radius: 6px;
	transition: background 0.15s ease, opacity 0.15s ease;
}

/* SVGs must be display:block to avoid inline baseline gap */
.fp-btn svg {
	display: block;
	flex-shrink: 0;
	pointer-events: none;
}

.fp-btn:hover:not(:disabled) {
	filter: brightness( 0.92 );
}

.fp-btn:active:not(:disabled) {
	filter: brightness( 0.84 );
}

.fp-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

/* Inherit site button styles — strip all our custom visual overrides */
.fp-btn.fp-btn-inherit {
	background: unset;
	color: unset;
	border: unset;
	border-radius: unset;
	font-weight: unset;
}

/* ── Size variants ───────────────────────────────────────────────────────── */
.fp-size-sm .fp-btn { width: 28px; height: 28px; font-size: 17px; }
.fp-size-md .fp-btn { width: 36px; height: 36px; font-size: 20px; }
.fp-size-lg .fp-btn { width: 48px; height: 48px; font-size: 26px; }

/* ── Range Slider ────────────────────────────────────────────────────────── */
.fp-slider {
	flex: 1 1 80px;
	min-width: 60px;
	cursor: pointer;
	/* accent-color set via Bricks style control */
	accent-color: #0073aa;
	border: none;
	background: transparent;
	padding: 0;
}

/* Thumb height by size variant */
.fp-size-sm .fp-slider { height: 18px; }
.fp-size-md .fp-slider { height: 22px; }
.fp-size-lg .fp-slider { height: 28px; }

/* ── Size readout ────────────────────────────────────────────────────────── */
.fp-size-label {
	font-weight: 600;
	color: #555;
	white-space: nowrap;
	min-width: 46px;
	text-align: right;
	letter-spacing: 0.02em;
}

.fp-size-sm .fp-size-label { font-size: 12px; }
.fp-size-md .fp-size-label { font-size: 14px; }
.fp-size-lg .fp-size-label { font-size: 16px; }

/* ── Textarea preview ────────────────────────────────────────────────────── */
.fp-text-input {
	display: block;
	box-sizing: border-box;
	line-height: 1.5;
	resize: vertical;
	transition: font-size 0.08s ease;
	font-family: inherit;
	/* All visual styles (bg, border, padding, radius, color) are set
	   as inline styles by PHP render — no defaults needed here. */
}

.fp-text-input:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

/* ── Font selector bar ───────────────────────────────────────────────────── */
.fp-font-bar {
	flex-wrap: nowrap;
}

.fp-font-tag {
	font-size: 12px;
	font-weight: 600;
	color: #777;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	white-space: nowrap;
	flex-shrink: 0;
}

.fp-font-select {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 100%;
	cursor: pointer;
	border: 1px solid #ccc;
	border-radius: 5px;
	background: #fff;
	color: #222;
	padding: 4px 8px;
	font-size: inherit;
	font-family: inherit;
	appearance: auto;
}

.fp-size-sm .fp-font-select { font-size: 12px; }
.fp-size-md .fp-font-select { font-size: 14px; }
.fp-size-lg .fp-font-select { font-size: 16px; }

.fp-font-empty {
	font-size: 12px;
	color: #999;
	font-style: italic;
}

/* ── Bricks editor hints ─────────────────────────────────────────────────── */
.brxe-fp-font-previewer .fp-wrapper {
	pointer-events: auto;
}
