/**
 * Lead magnet "Free Tools" side banner — inc/lead-magnets/side-banner.php.
 *
 * Measurements are the Figma WDM_2 "Lead_Magnet_V6_*" frames (desktop 1920,
 * mobile 412). Standalone sheet, loaded only where the banner renders.
 *
 * One deliberate deviation: the V6 panel is a 15% lime tint over a background
 * blur, drawn only over the dark hero. Over a white section that tint is
 * almost white and the lime headline/white copy disappear, so the tint sits on
 * a dark translucent base. Over dark sections it reads like the mock.
 */

.wdm-lmsb {
	--lmsb-lime: #d3fb52;
	--lmsb-ink: #0b0b0b;
	--lmsb-ease: cubic-bezier(0.22, 1, 0.36, 1);
	font-family: "Onest", sans-serif;
}

.wdm-lmsb button {
	font-family: inherit;
	margin: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.wdm-lmsb :focus-visible {
	outline: 2px solid var(--lmsb-lime);
	outline-offset: 2px;
}

/* ---------- Edge tab (collapsed) ---------- */

.wdm-lmsb__tab {
	position: fixed;
	z-index: 99990; /* below the sticky header / mobile menu (999999) */
	top: 50%;
	right: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	width: 64px;
	height: 244px;
	padding: 14px 0 16px;
	border: 0;
	border-radius: 20px 0 0 20px;
	background: var(--lmsb-lime);
	color: var(--lmsb-ink);
	box-shadow: -8px 6px 30px rgba(0, 0, 0, 0.35);
	transform: translate(0, -50%);
	transition: transform 0.45s var(--lmsb-ease), box-shadow 0.2s ease;
	animation: wdm-lmsb-in 0.6s var(--lmsb-ease) 1.2s backwards;
}

.wdm-lmsb__tab:hover {
	box-shadow: -10px 6px 34px rgba(0, 0, 0, 0.45);
}

.wdm-lmsb__tab:focus-visible {
	outline-color: var(--lmsb-ink);
	outline-offset: -4px;
}

.wdm-lmsb.is-open .wdm-lmsb__tab {
	transform: translate(110%, -50%);
}

@keyframes wdm-lmsb-in {
	from {
		transform: translate(110%, -50%);
	}
}

.wdm-lmsb__tab-book {
	display: block;
	width: 45px;
	height: 61px;
	padding-left: 2px;
}

.wdm-lmsb__tab-label {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	font-size: 12px;
	font-weight: 800;
	line-height: 15px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
}

.wdm-lmsb__tab-pull {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--lmsb-ink);
	color: #fff;
	transition: transform 0.2s ease;
}

.wdm-lmsb__tab:hover .wdm-lmsb__tab-pull {
	transform: translateX(-2px);
}

/* ---------- Panel (expanded) ---------- */

.wdm-lmsb__panel {
	position: fixed;
	z-index: 1000000; /* over the sticky header; the capture modal (1000001) still wins */
	top: 50%;
	right: 0;
	display: flex;
	flex-direction: column;
	gap: 18px;
	box-sizing: border-box;
	width: 430px;
	max-height: calc(100vh - 24px);
	max-height: calc(100dvh - 24px);
	padding: 24px 26px 26px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: 28px 0 0 28px;
	background:
		linear-gradient(rgba(211, 251, 82, 0.15), rgba(211, 251, 82, 0.15)),
		rgba(14, 17, 10, 0.72);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow: -14px 10px 48px rgba(0, 0, 0, 0.4);
	color: #fff;
	visibility: hidden;
	transform: translate(105%, -50%);
	transition: transform 0.45s var(--lmsb-ease), visibility 0s linear 0.45s;
}

.wdm-lmsb.is-open .wdm-lmsb__panel {
	visibility: visible;
	transform: translate(0, -50%);
	transition: transform 0.45s var(--lmsb-ease), visibility 0s;
}

.wdm-lmsb__close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.1);
	color: #fff;
	transition: background-color 0.2s ease;
}

.wdm-lmsb__close:hover {
	background: rgba(0, 0, 0, 0.3);
}

.wdm-lmsb__hero {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
}

.wdm-lmsb__hero-book {
	display: block;
	flex: 0 0 104px;
	height: 140px;
}

.wdm-lmsb__copy {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.wdm-lmsb .wdm-lmsb__headline {
	margin: 0;
	color: var(--lmsb-lime);
	font-size: 24px;
	font-weight: 600;
	line-height: 30px;
	letter-spacing: -0.02em;
	text-transform: none;
}

.wdm-lmsb .wdm-lmsb__meta {
	margin: 0;
	color: #fff;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	letter-spacing: -0.02em;
}

.wdm-lmsb__list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wdm-lmsb__list li {
	margin: 0;
	padding: 0;
}

.wdm-lmsb__list li::before {
	content: none;
}

.wdm-lmsb__row {
	display: flex;
	align-items: center;
	gap: 12px;
	box-sizing: border-box;
	width: 100%;
	padding: 11px 14px 11px 12px;
	border: 0;
	border-radius: 14px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	text-align: left;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.wdm-lmsb--clickable .wdm-lmsb__row:hover {
	background: rgba(0, 0, 0, 0.88);
	transform: translateX(-2px);
}

.wdm-lmsb__tile {
	display: flex;
	flex: 0 0 32px;
	align-items: center;
	justify-content: center;
	height: 32px;
	border-radius: 9px;
	background: var(--lmsb-lime);
	color: #000;
}

.wdm-lmsb__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.wdm-lmsb__title {
	font-size: 15px;
	font-weight: 600;
	line-height: 21px;
	letter-spacing: -0.02em;
}

.wdm-lmsb__desc {
	color: #b3b3b3;
	font-size: 13px;
	font-weight: 400;
	line-height: 18px;
	letter-spacing: -0.02em;
}

.wdm-lmsb__cta {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 15px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--lmsb-lime);
	color: #000;
	font-size: 16px;
	font-weight: 600;
	line-height: 24px;
	letter-spacing: -0.02em;
	text-decoration: none;
	transition: filter 0.2s ease;
}

.wdm-lmsb__cta:hover,
.wdm-lmsb__cta:focus,
.wdm-lmsb__cta:visited {
	color: #000;
	text-decoration: none;
}

.wdm-lmsb__cta:hover {
	filter: brightness(0.94);
}

.wdm-lmsb__cta:focus-visible {
	outline-color: #fff;
}

.wdm-lmsb__scrim {
	display: none;
}

/* ---------- Book cover (drawn at 103x142 "units", scaled per slot) ---------- */

.wdm-lmsb-book {
	--u: 1px;
	--spine: 16;
	position: relative;
	display: block;
	width: calc(108 * var(--u));
	height: calc(142 * var(--u));
	line-height: 1;
	pointer-events: none;
}

.wdm-lmsb-book--hero {
	--u: 1px;
	margin-top: -1px;
	transform: rotate(-4deg);
}

.wdm-lmsb-book--tab {
	--u: 0.4px;
	--spine: 7.5;
}

.wdm-lmsb-book__pages {
	position: absolute;
	top: calc(5 * var(--u));
	left: calc(6 * var(--u));
	width: calc(102 * var(--u));
	height: calc(136 * var(--u));
	border-radius: calc(2 * var(--u)) calc(5 * var(--u)) calc(5 * var(--u)) calc(2 * var(--u));
	background: #f4f4f4;
	box-shadow: inset calc(-1 * var(--u)) 0 0 #d6d6d6;
}

.wdm-lmsb-book__cover {
	position: absolute;
	top: 0;
	left: 0;
	width: calc(103 * var(--u));
	height: calc(142 * var(--u));
	overflow: hidden;
	border-radius: calc(3 * var(--u)) calc(6 * var(--u)) calc(6 * var(--u)) calc(3 * var(--u));
	background: #0a0a0a;
	box-shadow: calc(6 * var(--u)) calc(10 * var(--u)) calc(24 * var(--u)) rgba(0, 0, 0, 0.35);
}

.wdm-lmsb-book__cover > span {
	position: absolute;
	display: block;
}

.wdm-lmsb-book__glow {
	top: calc(72 * var(--u));
	left: calc(39 * var(--u));
	width: calc(96 * var(--u));
	height: calc(96 * var(--u));
	border-radius: 50%;
	background: rgba(211, 251, 82, 0.22);
}

.wdm-lmsb-book__spine {
	top: 0;
	left: 0;
	width: calc(var(--spine) * var(--u));
	height: 100%;
	background: #d3fb52;
}

.wdm-lmsb-book__cover > .wdm-lmsb-book__tag {
	top: calc(16 * var(--u));
	left: calc(15 * var(--u));
	display: flex;
	align-items: center;
	justify-content: center;
	width: calc(41 * var(--u));
	height: calc(19 * var(--u));
	border-radius: 999px;
	background: #d3fb52;
	color: #0a0a0a;
	font-size: calc(8 * var(--u));
	font-weight: 800;
	letter-spacing: 0.06em;
}

.wdm-lmsb-book__title {
	top: calc(42 * var(--u));
	left: calc(16 * var(--u));
	color: #fff;
	font-size: calc(12 * var(--u));
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.03em;
	white-space: nowrap;
}

.wdm-lmsb-book__bar {
	border-radius: calc(2 * var(--u));
	background: #d3fb52;
}

.wdm-lmsb-book__bar--1 {
	top: calc(109 * var(--u));
	left: calc(22 * var(--u));
	width: calc(9 * var(--u));
	height: calc(14 * var(--u));
	opacity: 0.4;
}

.wdm-lmsb-book__bar--2 {
	top: calc(99 * var(--u));
	left: calc(34 * var(--u));
	width: calc(10 * var(--u));
	height: calc(23 * var(--u));
	opacity: 0.65;
}

.wdm-lmsb-book__bar--3 {
	top: calc(85 * var(--u));
	left: calc(46 * var(--u));
	width: calc(11 * var(--u));
	height: calc(36 * var(--u));
}

.wdm-lmsb-book__rise {
	top: calc(82 * var(--u));
	left: calc(60 * var(--u));
	width: calc(24 * var(--u));
	height: calc(3.5 * var(--u));
	border-radius: calc(2 * var(--u));
	background: #d3fb52;
	transform: rotate(-27deg);
}

/* ---------- Mobile (V6 MOB frames, 412 wide) ---------- */

@media (max-width: 767.98px) {
	.wdm-lmsb__tab {
		width: 54px;
		height: 200px;
		padding: 12px 0 13px;
		border-radius: 16px 0 0 16px;
		box-shadow: -6px 5px 24px rgba(0, 0, 0, 0.35);
	}

	.wdm-lmsb__tab-book {
		width: 37px;
		height: 50px;
	}

	.wdm-lmsb-book--tab {
		--u: 0.324px;
	}

	.wdm-lmsb__tab-label {
		font-size: 10px;
		line-height: 13px;
	}

	.wdm-lmsb__tab-pull {
		width: 28px;
		height: 28px;
	}

	.wdm-lmsb__tab-pull svg {
		width: 18px;
		height: 18px;
	}

	.wdm-lmsb__scrim {
		position: fixed;
		z-index: 999999;
		inset: 0;
		display: block;
		background: rgba(0, 0, 0, 0.55);
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.3s ease, visibility 0s linear 0.3s;
	}

	.wdm-lmsb.is-open .wdm-lmsb__scrim {
		opacity: 1;
		visibility: visible;
		transition: opacity 0.3s ease, visibility 0s;
	}

	.wdm-lmsb__panel {
		gap: 16px;
		width: 348px;
		max-width: calc(100vw - 24px);
		padding: 20px 20px 22px;
		border-radius: 24px 0 0 24px;
		box-shadow: -12px 8px 40px rgba(0, 0, 0, 0.45);
	}

	.wdm-lmsb__close {
		top: 14px;
		right: 14px;
		width: 32px;
		height: 32px;
	}

	.wdm-lmsb__hero {
		gap: 14px;
	}

	.wdm-lmsb__hero-book {
		flex-basis: 84px;
		height: 113px;
	}

	.wdm-lmsb-book--hero {
		--u: 0.81px;
	}

	.wdm-lmsb__copy {
		gap: 5px;
	}

	.wdm-lmsb .wdm-lmsb__headline {
		font-size: 20px;
		line-height: 26px;
	}

	.wdm-lmsb .wdm-lmsb__meta {
		font-size: 13px;
		line-height: 18px;
	}

	.wdm-lmsb__row {
		padding: 10px 12px;
	}

	.wdm-lmsb__cta {
		gap: 9px;
		padding: 14px 20px;
		font-size: 15px;
		line-height: 22px;
	}

	.wdm-lmsb__cta svg {
		width: 15px;
		height: 15px;
	}
}

/* Short landscape phones: keep the tab clear of the header and chat bubble. */
@media (max-height: 420px) {
	.wdm-lmsb__tab {
		height: 64px;
		padding: 16px 0;
		justify-content: center;
	}

	.wdm-lmsb__tab-book,
	.wdm-lmsb__tab-label {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wdm-lmsb__tab,
	.wdm-lmsb__panel,
	.wdm-lmsb__scrim,
	.wdm-lmsb__row,
	.wdm-lmsb__tab-pull {
		animation: none;
		transition-duration: 0s;
		transition-delay: 0s;
	}
}

@media print {
	.wdm-lmsb {
		display: none;
	}
}
