/**
 * Shared widget styles — Classiera Navigation and Classiera Scroll Tools.
 *
 * These two widgets are used by BOTH landing templates, so their CSS cannot
 * live in either template's own stylesheet. It previously sat in landing.css,
 * which meant the 2026 page rendered its navigation completely unstyled: the
 * bar, the drawer and the scrim were all visible at once as plain lists.
 *
 * Loaded on any page built from a registered template.
 */

/* -------------------------------------------------------------------------
 * 1. Navigation widget
 * ---------------------------------------------------------------------- */

.cle-nav {
	width: 100%;
}

.cle-nav__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 1rem 12px;
}

.cle-nav__brand {
	font-family: var(--cle-font-heading);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--cle-text-strong);
	text-decoration: none;
}

.cle-nav__brand img {
	display: block;
	width: auto;
	max-height: 48px;
}

.cle-nav__menu {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	margin: 0 0 0 auto;
	padding: 0;
	list-style: none;
}

.cle-nav__link {
	display: block;
	padding: 0.5rem 0.75rem;
	color: rgba(0, 0, 0, 0.55);
	font-family: var(--cle-font-body);
	font-size: 1rem;
	text-decoration: none;
	border-radius: 4px;
	transition: color 0.15s ease;
}

.cle-nav__link:hover,
.cle-nav__link:focus-visible,
.cle-nav__link[aria-current="true"] {
	color: rgba(0, 0, 0, 0.9);
}

.cle-nav__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	flex-shrink: 0;
	padding: 0.5rem 1rem;
	border: 1px solid var(--cle-primary);
	border-radius: 0.375rem;
	background-color: var(--cle-primary);
	color: #fff;
	font-family: var(--cle-font-body);
	font-size: 1rem;
	line-height: 1.5;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cle-nav__cta:hover,
.cle-nav__cta:focus-visible {
	border-color: var(--cle-primary-hover);
	background-color: var(--cle-primary-hover);
	color: #fff;
}

.cle-nav__cta svg {
	width: 18px;
	height: auto;
	flex-shrink: 0;
}

.cle-nav__toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 0.375rem;
	background: transparent;
	color: var(--cle-text-strong);
	cursor: pointer;
}

.cle-nav__toggle svg {
	width: 24px;
	height: 24px;
}

/**
 * Off-canvas drawer, shown below the nav's breakpoint.
 *
 * `content-visibility: hidden` is what keeps this honest. A closed drawer used
 * to sit at `left: -319px` via `translateX(-100%)` while still being a
 * 319 x 1122 box in the layout, and the scrim beside it is `inset: 0`, so it
 * sized itself to the *document* rather than the viewport. Between them the
 * document could grow wider than the screen, the scrim would then match that
 * new width, and the two fed each other — the page got progressively wider on
 * mobile (375 to 518px over a few seconds) and never recovered, which is what
 * produced the horizontal scrollbar and the scroll-anchoring jumps.
 *
 * Skipping the closed drawer's contents removes it from layout entirely, so it
 * cannot contribute overflow at all, while `transform` still animates it in and
 * out exactly as before.
 */
.cle-nav__panel {
	position: fixed;
	z-index: 1000;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: min(400px, 85vw);
	max-width: 100%;
	padding: 1rem;
	background: #fff;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
	transform: translateX(-100%);
	visibility: hidden;
	content-visibility: hidden;
	transition: transform 0.3s ease, visibility 0.3s ease;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.cle-nav__panel[data-open="true"] {
	transform: translateX(0);
	visibility: visible;
	content-visibility: visible;
}

.cle-nav__panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 1rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.cle-nav__panel-title {
	margin: 0;
	font-family: var(--cle-font-heading);
	font-size: 1.25rem;
	font-weight: 700;
}

.cle-nav__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--cle-text-strong);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.cle-nav__panel .cle-nav__menu {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
	margin: 1.5rem 0;
}

.cle-nav__panel .cle-nav__link {
	padding: 0.65rem 0;
}

.cle-nav__panel .cle-nav__cta {
	justify-content: center;
}

/*
 * The scrim is `inset: 0`, which resolves against the initial containing block.
 * On a page that has any horizontal overflow that block is the *document*, not
 * the viewport, so a closed scrim would silently stretch to the overflowed
 * width and hold it there. Collapsing it to nothing while closed breaks that
 * feedback loop; `100vw`/`100vh` size it to the viewport when it is actually
 * shown, independently of document width.
 */
.cle-nav__scrim {
	position: fixed;
	z-index: 999;
	top: 0;
	left: 0;
	width: 0;
	height: 0;
	background: rgba(0, 0, 0, 0.4);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cle-nav__scrim[data-open="true"] {
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	opacity: 1;
	visibility: visible;
}

@media (max-width: 1199px) {
	.cle-nav__bar > .cle-nav__menu,
	.cle-nav__bar > .cle-nav__cta {
		display: none;
	}

	.cle-nav__toggle {
		display: inline-flex;
	}
}

/* -------------------------------------------------------------------------
 * 2. Scroll tools — back to top and the floating purchase button.
 * Both slide in once the viewport has passed the hero.
 * ---------------------------------------------------------------------- */

.cle-scroll-tools__top,
.cle-scroll-tools__cta {
	position: fixed;
	z-index: 100;
	visibility: hidden;
	opacity: 0;
	transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
}

.cle-scroll-tools__top {
	right: 20px;
	bottom: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 0.375rem;
	background-color: var(--cle-primary);
	color: #fff;
	cursor: pointer;
	transform: translateY(80px);
}

.cle-scroll-tools__top:hover,
.cle-scroll-tools__top:focus-visible {
	background-color: var(--cle-primary-hover);
}

.cle-scroll-tools__cta {
	right: 20px;
	bottom: 76px;
	padding: 0.5rem 1rem;
	border-radius: 0.375rem;
	background-color: var(--cle-success);
	color: #fff;
	font-family: var(--cle-font-body);
	font-size: 1.25rem;
	text-decoration: none;
	transform: translateX(120%);
}

.cle-scroll-tools__cta:hover,
.cle-scroll-tools__cta:focus-visible {
	color: #fff;
	filter: brightness(1.08);
}

.cle-scroll-tools.is-active .cle-scroll-tools__top,
.cle-scroll-tools.is-active .cle-scroll-tools__cta {
	visibility: visible;
	opacity: 1;
	transform: none;
}

@media (max-width: 767px) {
	.cle-scroll-tools__cta {
		font-size: 1rem;
	}
}
