/* "Find Better Lawyer Matches, Faster." join CTA — shared by blog posts and glossary terms. */

.sd-intro-cta,
.sd-mobile-join-cta {
	--sd-cta-pink: #a96fed;
	--sd-cta-blue: #6545e7;
	--sd-cta-pink-rgb: 169, 111, 237;
	--sd-cta-blue-rgb: 101, 69, 231;
	--sd-cta-navy-rgb: 23, 19, 38;
}

@property --sd-cta-angle {
	syntax: "<angle>";
	initial-value: 90deg;
	inherits: false;
}

/* Desktop: dark navy card inside the article body. */
.sd-intro-cta {
	position: relative;
	isolation: isolate;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	margin: 34px 0 6px;
	padding: 30px 32px;
	overflow: hidden;
	border: 1px solid rgba(var(--sd-cta-blue-rgb), 0.22);
	border-radius: 22px;
	background:
		radial-gradient(circle at 0% 0%, rgba(var(--sd-cta-pink-rgb), 0.22), transparent 38%),
		radial-gradient(circle at 100% 100%, rgba(var(--sd-cta-blue-rgb), 0.22), transparent 42%),
		linear-gradient(135deg, #171326 0%, #211936 55%, #171326 100%);
	box-shadow: 0 18px 40px rgba(var(--sd-cta-navy-rgb), 0.22);
	color: #ffffff;
	container: sd-intro-cta / inline-size;
}

/* Title size follows the copy column width so the headline always fits on one line (text is ~16.5em wide). */
.sd-intro-cta__copy {
	min-width: 0;
	container-type: inline-size;
}

.sd-intro-cta__title {
	margin: 0;
	color: #ffffff;
	font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	font-size: min(34px, 5.9cqi);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.01em;
	white-space: nowrap;
}

.sd-intro-cta__accent {
	background: linear-gradient(90deg, #d9c6ff 0%, var(--sd-cta-pink) 45%, #8358ea 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.sd-intro-cta__button {
	display: inline-block;
	margin-left: 26px;
	text-decoration: none !important;
	transition: transform 0.18s ease;
}

/*
 * The frame must stay inline-flex (atomic inline) so an inherited link underline can't reach the label,
 * and it carries the pill shape because glossary-tooltip.css zeroes padding/radius on article links.
 * Pseudos paint behind the label inside the frame's own stacking context: 2px animated border + glow.
 */
.sd-intro-cta__button-frame {
	position: relative;
	isolation: isolate;
	display: inline-flex;
	padding: 2px;
	border-radius: 999px;
}

.sd-intro-cta__button-frame::before,
.sd-intro-cta__button-frame::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: inherit;
	background: conic-gradient(
		from var(--sd-cta-angle),
		#211936,
		var(--sd-cta-blue),
		var(--sd-cta-pink),
		#ffffff,
		var(--sd-cta-pink),
		var(--sd-cta-blue),
		#211936
	);
	animation: sd-cta-rotate 3s linear infinite;
}

.sd-intro-cta__button-frame::after {
	filter: blur(10px);
	opacity: 0.45;
}

.sd-intro-cta__button-label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 54px;
	padding: 14px 28px;
	border-radius: inherit;
	background: #1c1730;
	color: #ffffff;
	text-decoration: none;
	font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
	font-size: 16px;
	font-weight: 800;
	white-space: nowrap;
	transition: background 0.18s ease;
}

.sd-intro-cta__button:hover {
	transform: translateY(-1px);
}

.sd-intro-cta__button:hover .sd-intro-cta__button-label {
	background: #2a2045;
}

.sd-intro-cta__button:focus-visible {
	outline: 2px solid var(--sd-cta-pink);
	outline-offset: 3px;
}

/* Narrow cards (glossary column, small desktops): a slimmer button leaves more room for the headline. */
@container sd-intro-cta (max-width: 700px) {
	.sd-intro-cta__button {
		margin-left: 16px;
	}

	.sd-intro-cta__button-label {
		min-height: 48px;
		padding: 12px 20px;
		gap: 8px;
		font-size: 15px;
	}
}

@keyframes sd-cta-rotate {
	0% {
		--sd-cta-angle: 0deg;
	}
	100% {
		--sd-cta-angle: 360deg;
	}
}

/* Mobile: the in-article card is replaced by the same design as a sticky bar. */
.sd-mobile-join-cta {
	display: none;
}

@media (max-width: 980px) {
	.sd-intro-cta {
		display: none;
	}

	.sd-mobile-join-cta {
		display: flex;
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		z-index: 99980;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		box-sizing: border-box;
		width: auto;
		padding: 12px 12px 12px 18px;
		overflow: hidden;
		isolation: isolate;
		border: 1px solid rgba(var(--sd-cta-blue-rgb), 0.22);
		border-radius: 18px;
		background:
			radial-gradient(circle at 0% 0%, rgba(var(--sd-cta-pink-rgb), 0.22), transparent 38%),
			radial-gradient(circle at 100% 100%, rgba(var(--sd-cta-blue-rgb), 0.22), transparent 42%),
			linear-gradient(135deg, #171326 0%, #211936 55%, #171326 100%);
		box-shadow: 0 12px 30px rgba(var(--sd-cta-navy-rgb), 0.32);
		color: #ffffff;
	}

	/* One line always: the copy box is a size container and the font scales to fit beside the button. */
	.sd-mobile-join-cta__copy {
		margin: 0;
		flex: 1 1 auto;
		min-width: 0;
		container-type: inline-size;
		color: #ffffff;
		font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
		line-height: 1.2;
		font-weight: 700;
	}

	.sd-mobile-join-cta__line {
		display: block;
		font-size: min(18px, 5.9cqi);
		white-space: nowrap;
	}

	.sd-mobile-join-cta__button {
		flex: 0 0 auto;
		display: inline-block;
		text-decoration: none !important;
	}

	.sd-mobile-join-cta__button .sd-intro-cta__button-label {
		min-height: 42px;
		padding: 9px 14px;
		font-size: 13px;
	}

	.sd-mobile-join-cta__button:focus-visible {
		outline: 2px solid var(--sd-cta-pink);
		outline-offset: 3px;
	}
}

@media (max-width: 380px) {
	.sd-mobile-join-cta {
		left: 8px;
		right: 8px;
		gap: 10px;
		padding: 10px 10px 10px 14px;
	}

	.sd-mobile-join-cta__button .sd-intro-cta__button-label {
		padding: 8px 12px;
		font-size: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sd-intro-cta__button-frame::before,
	.sd-intro-cta__button-frame::after {
		animation: none;
	}
}
