/**
 * NovaBP Superannuation — Full Suite of Wealth Management Services
 *
 * Section 7 of the Superannuation page: a centred header over a stack of wide
 * white cards. Every card pins at the same offset, so the next one slides up and
 * covers the one before it completely, fading it out as it goes — the
 * sticky-stacking treatment drawn part-way through in Figma 2104:10612.
 *
 * Depends on `novabp-tax-base` for tokens and the header primitives.
 *
 * Figma reference: node 2088:4917 (card 2101:9111 / 2104:11244, stacked state
 * 2104:10612)
 */

.nova-super-wealth {
	/*
	 * How far below the viewport top a pinned card settles. Every card shares it,
	 * which is what makes each one land exactly on top of the last.
	 */
	--nova-super-wealth-stack-top: 90px;

	background-color: var(--nova-super-wealth-bg, var(--nova-tax-surface));
}

/*
 * Figma clips the glow at the frame edge; it starts 16px outside it. The clip
 * lives on this wrapper rather than on the section, because sticky dies
 * silently under any ancestor whose overflow is not `visible` — `overflow:
 * hidden` on the section would stop the cards below from pinning at all. The
 * cards are siblings of this box, so it clips the wash and nothing else.
 */
.nova-super-wealth__glow-clip {
	position: absolute;
	z-index: 0;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

/*
 * The navy "Union" wash in the top-left corner. It is a gradient-filled vector
 * rather than a flat tint, so it is painted as an image instead of being
 * rebuilt as a CSS gradient.
 */
.nova-super-wealth__glow {
	position: absolute;
	inset-block-start: -17px;
	inset-inline-start: -16px;
	width: 653px;
	height: 502px;
	background-image: var(--nova-super-wealth-glow);
	background-repeat: no-repeat;
	background-position: left top;
	background-size: contain;
	opacity: var(--nova-super-wealth-glow-opacity, 0.2);
}

.nova-super-wealth__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--nova-super-wealth-gap, 80px);
}

.nova-super-wealth__header {
	--nova-tax-header-max: 800px;
}

/* ---------------------------------------------------------------------------
 * Sticky stack
 * ------------------------------------------------------------------------ */

/*
 * Equalise card heights (grid-auto-rows: 1fr) so that when cards stack stickily,
 * the covering card completely hides the card beneath it with no bottom edge showing.
 */
.nova-super-wealth__stack {
	display: grid;
	grid-auto-rows: 1fr;
	gap: 40px;
	width: 100%;
}

/*
 * The stacking itself. Every card pins on the same line, so each one arrives
 * over the card before it and covers it outright.
 *
 * The step is what would fan them out: each card rests `--i` steps further down
 * than the first, leaving exactly that much of the previous card visible. It
 * defaults to 0 for a full cover. `--i` is set inline per card by the widget
 * because CSS has no sibling index.
 *
 * The cards paint in document order, so a later card is already above an earlier
 * one and no z-index is needed.
 */
.nova-super-wealth__card {
	position: sticky;
	inset-block-start: calc(
		var(--nova-super-wealth-stack-top) + var(--i, 0) * var(--nova-super-wealth-step, 0px)
	);
	display: flex;
	align-items: stretch;
	gap: 60px;
	padding: 40px;
	border-radius: 20px;
	background-color: var(--nova-super-wealth-card-bg, var(--nova-tax-white));
	box-shadow: 0 4px 25px rgb(0 0 0 / 0.03);
}

/* ---------------------------------------------------------------------------
 * Card — left column
 * ------------------------------------------------------------------------ */

.nova-super-wealth__aside {
	display: flex;
	flex: 0 0 var(--nova-super-wealth-aside, 520px);
	flex-direction: column;
	justify-content: space-between;
	gap: 60px;
	width: var(--nova-super-wealth-aside, 520px);
	max-width: 100%;
}

.nova-super-wealth__intro {
	display: flex;
	flex-direction: column;
	gap: 32px;
}

.nova-super-wealth__title-group {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.nova-super-wealth .nova-super-wealth__card-title {
	font-family: var(--nova-tax-font);
	font-size: 36px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: -0.02em;
	text-transform: none;
	color: var(--nova-tax-heading);
}

.nova-super-wealth__card-sub {
	margin: 0;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--nova-tax-body);
}

.nova-super-wealth__pills {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nova-super-wealth__pill {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 6px 16px;
	border: 1px solid var(--nova-super-wealth-pill-border, #e3f8e2);
	border-radius: 100px;
	background-color: var(--nova-super-wealth-pill-bg, #f3f9f3);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.5;
	color: var(--nova-super-wealth-pill-text, var(--nova-tax-green));
}

.nova-super-wealth__pill .nova-tax-icon {
	width: 18px;
	height: 18px;
}

/*
 * Figma draws the photo at a fixed 500x280 inside the 520 column, so the plate
 * stops 20px short of the column's right edge while the copy above it runs the
 * full width. The cap reproduces that; the ratio holds the crop once the column
 * narrows past it and the plate goes back to filling the column.
 *
 * The URL arrives as a custom property rather than an inline `background-image`
 * because WP Rocket's lazyload rewrites the latter into `data-bg` and hands the
 * restore to its own observer — which does not fire for this card, leaving the
 * plate empty. The hero banner is painted the same way for the same reason.
 */
.nova-super-wealth__media {
	width: 100%;
	max-width: var(--nova-super-wealth-media-max, 500px);
	aspect-ratio: 500 / 280;
	border-radius: 12px;
	background-color: #f7f7f7;
	background-image: var(--nova-super-wealth-media);
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
}

/* ---------------------------------------------------------------------------
 * Card — right column
 * ------------------------------------------------------------------------ */

.nova-super-wealth__list {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	justify-content: center;
	gap: 32px;
	min-width: 0;
	margin: 0;
	padding: 20px 0 0;
	list-style: none;
}

.nova-super-wealth__item {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.nova-super-wealth__rule {
	width: 40px;
	height: 3px;
	background-color: var(--nova-super-wealth-rule, var(--nova-tax-green));
}

.nova-super-wealth .nova-super-wealth__item-title {
	font-family: var(--nova-tax-font);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: normal;
	text-transform: none;
	color: var(--nova-tax-heading);
}

.nova-super-wealth__item-copy {
	margin: 0;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--nova-tax-body);
}

/* ---------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------ */

@media (max-width: 1366px) {
	.nova-super-wealth {
		--nova-super-wealth-aside: 440px;
	}

	.nova-super-wealth__card {
		gap: 40px;
	}
}

/*
 * Stacked, a pinned card would be taller than most viewports and the pile would
 * trap the reader — so the sticky behaviour is dropped and the cards become an
 * ordinary column. The JS reads the same breakpoint before it writes any cover
 * value.
 */
@media (max-width: 1024px) {
	.nova-super-wealth__inner {
		--nova-super-wealth-gap: 48px;
	}

	.nova-super-wealth__stack {
		grid-auto-rows: auto;
	}

	/*
	 * A pinned card is taller than most viewports at this width, so the pile
	 * would trap the reader on one card at a time. They scroll normally instead.
	 */
	.nova-super-wealth__card {
		position: static;
		flex-direction: column;
		gap: 40px;
		padding: 32px;
	}

	/*
	 * The intro is the whole card width here rather than a 520 column, so the
	 * photo's 500px cap would strand it against the left edge under a much wider
	 * block of copy. It fills the card instead.
	 */
	.nova-super-wealth__aside {
		--nova-super-wealth-media-max: none;

		flex: 0 0 auto;
		width: 100%;
	}

	.nova-super-wealth .nova-super-wealth__card-title {
		font-size: 30px;
	}

	.nova-super-wealth__list {
		padding-block-start: 0;
	}

	.nova-super-wealth__glow {
		width: 420px;
		height: 320px;
	}
}

@media (max-width: 767px) {
	.nova-super-wealth__inner {
		--nova-super-wealth-gap: 40px;
	}

	.nova-super-wealth__card {
		gap: 32px;
		padding: 20px;
		border-radius: 16px;
	}

	.nova-super-wealth .nova-super-wealth__card-title {
		font-size: 26px;
	}

	.nova-super-wealth__list {
		gap: 24px;
	}

	.nova-super-wealth__item-copy {
		font-size: 16px;
	}
}

/*
 * Pinning is motion the reader did not ask for. Honouring the OS setting turns
 * the stack back into a plain list.
 */
@media (prefers-reduced-motion: reduce) {
	.nova-super-wealth__card {
		position: static;
	}
}
