/* Bright Addons Pro: Reading Progress */

/* Elementor Container: fill the width the container gives widgets. */
/* Same fix Elementor uses for its own Video and Accordion widgets: without it the */
/* widget shrinks to its content in Row or centred containers and can collapse to 0px. */
.e-con > .elementor-widget-bapro-reading-progress,
.e-con-inner > .elementor-widget-bapro-reading-progress {
	width: var(--container-widget-width, 100%);
	--flex-grow: var(--container-widget-flex-grow);
}

.bapro-rp {
	--bapro-rp-p: 0;
	--bapro-rp-h: 4px;
	--bapro-rp-edge: 0px;
	--bapro-rp-fill: #5b3df5;
	--bapro-rp-fill-end: var(--bapro-rp-fill);
	--bapro-rp-track: transparent;
	--bapro-rp-size: 52px;
	--bapro-rp-icon: 16px;
	--bapro-rp-x: 24px;
	--bapro-rp-y: 24px;
	--bapro-rp-ring: 4;
	--bapro-rp-ring-color: var(--bapro-rp-fill);
	--bapro-rp-ring-track: #e6e8ee;
	box-sizing: border-box;
}

.bapro-rp *,
.bapro-rp *::before,
.bapro-rp *::after {
	box-sizing: border-box;
}

/* WordPress admin bar */
.admin-bar .bapro-rp--bar-top .bapro-rp__bar {
	top: calc(var(--bapro-rp-edge) + 32px);
}

@media (max-width: 782px) {
	.admin-bar .bapro-rp--bar-top .bapro-rp__bar {
		top: calc(var(--bapro-rp-edge) + 46px);
	}
}

/* ---------- Bar ---------- */
.bapro-rp__bar {
	position: fixed;
	right: 0;
	left: 0;
	z-index: 99990;
	height: var(--bapro-rp-h);
	background: var(--bapro-rp-track);
	pointer-events: none;
}

.bapro-rp--bar-top .bapro-rp__bar {
	top: var(--bapro-rp-edge);
}

.bapro-rp--bar-bottom .bapro-rp__bar {
	bottom: var(--bapro-rp-edge);
}

.bapro-rp__fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 100%;
	background: linear-gradient(90deg, var(--bapro-rp-fill), var(--bapro-rp-fill-end));
	transform: scaleX(var(--bapro-rp-p));
	transform-origin: left center;
	will-change: transform;
}

.bapro-rp .bapro-rp__bubble {
	position: absolute;
	top: calc(100% + 6px);
	left: calc(var(--bapro-rp-p) * 100%);
	padding: 3px 8px;
	border-radius: 20px;
	background: var(--bapro-rp-fill-end);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.3;
	white-space: nowrap;
	translate: calc(var(--bapro-rp-p) * -100%) 0;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.bapro-rp--bar-bottom .bapro-rp__bubble {
	top: auto;
	bottom: calc(100% + 6px);
}

.bapro-rp.is-scrolling .bapro-rp__bubble {
	opacity: 1;
}

/* ---------- Back to top ---------- */
.bapro-rp__top-wrap {
	position: fixed;
	bottom: var(--bapro-rp-y);
	z-index: 99980;
	transition: opacity 0.3s ease, translate 0.3s ease, visibility 0.3s;
}

.bapro-rp--side-right .bapro-rp__top-wrap {
	right: var(--bapro-rp-x);
}

.bapro-rp--side-left .bapro-rp__top-wrap {
	left: var(--bapro-rp-x);
}

.bapro-rp__top-wrap.is-waiting {
	opacity: 0;
	visibility: hidden;
	translate: 0 14px;
}

/* Button: hardened against theme and Site Settings button styles. */
.bapro-rp .bapro-rp__top-wrap .bapro-rp__top {
	-webkit-appearance: none;
	appearance: none;
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--bapro-rp-size);
	min-width: 0;
	height: var(--bapro-rp-size);
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0 solid transparent;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 8px 24px rgba(20, 24, 40, 0.16);
	color: #1d2330;
	font-family: inherit;
	font-size: var(--bapro-rp-icon);
	font-weight: 700;
	letter-spacing: normal;
	line-height: 1;
	text-transform: none;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, translate 0.25s ease, box-shadow 0.25s ease;
}

.bapro-rp--plain .bapro-rp__top-wrap .bapro-rp__top {
	background: var(--bapro-rp-fill);
	color: #fff;
}

.bapro-rp .bapro-rp__top-wrap .bapro-rp__top:hover {
	translate: 0 -3px;
}

.bapro-rp .bapro-rp__top-wrap .bapro-rp__top:focus-visible {
	outline: 2px solid var(--bapro-rp-fill);
	outline-offset: 3px;
}

.bapro-rp__ring {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	rotate: -90deg;
	pointer-events: none;
}

.bapro-rp__ring circle {
	fill: none;
	stroke-width: var(--bapro-rp-ring);
}

.bapro-rp__ring-track {
	stroke: var(--bapro-rp-ring-track);
}

.bapro-rp__ring-fill {
	stroke: var(--bapro-rp-ring-color);
	stroke-dasharray: 100 100;
	stroke-dashoffset: calc(100 - var(--bapro-rp-p) * 100);
	stroke-linecap: round;
}

.bapro-rp__icon,
.bapro-rp__pct {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.bapro-rp__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.bapro-rp__pct {
	font-size: 0.8em;
	font-variant-numeric: tabular-nums;
}

/* Percentage first, the icon on hover */
.bapro-rp--show-both .bapro-rp__icon {
	position: absolute;
	opacity: 0;
	scale: 0.6;
	transition: opacity 0.2s ease, scale 0.2s ease;
}

.bapro-rp--show-both .bapro-rp__pct {
	transition: opacity 0.2s ease;
}

.bapro-rp--show-both .bapro-rp__top:hover .bapro-rp__icon,
.bapro-rp--show-both .bapro-rp__top:focus-visible .bapro-rp__icon {
	opacity: 1;
	scale: 1;
}

.bapro-rp--show-both .bapro-rp__top:hover .bapro-rp__pct,
.bapro-rp--show-both .bapro-rp__top:focus-visible .bapro-rp__pct {
	opacity: 0;
}

/* ---------- Editor preview: keep both parts visible in the column ---------- */
.elementor-editor-active .bapro-rp {
	position: relative;
	display: flex;
	align-items: center;
	gap: 20px;
	min-height: calc(var(--bapro-rp-size) + 20px);
	padding: 10px;
	border: 1px dashed #c9ccd3;
	border-radius: 8px;
	--bapro-rp-p: 0.6;
}

.elementor-editor-active .bapro-rp__bar {
	position: relative;
	top: auto;
	bottom: auto;
	flex: 1 1 auto;
}

.elementor-editor-active .bapro-rp__top-wrap {
	position: static;
	opacity: 1;
	visibility: visible;
	translate: none;
}

@media (prefers-reduced-motion: reduce) {
	.bapro-rp__top-wrap,
	.bapro-rp .bapro-rp__top-wrap .bapro-rp__top {
		transition: none;
	}
}

/* Anything the script hides with the hidden attribute stays hidden, even
   when a display value above (or from the theme) would show it. */
.bapro-rp [hidden] {
	display: none !important;
}
