/*
 * sd/guarantee — the risk-free guarantee as a trust mark: the site's raised green check seal
 * (assets/icons/seal-check-raised.svg, the seal the pricing pages already use), large, pinned over
 * the top edge of a sheet of paper that carries the promise and its terms.
 *
 * The panel is the hand-cut paper sheet the testimonials' end card uses (box-drawn.svg): a shape
 * whose edges are cut by hand, with a glimmer of an edge and a faint short shadow that follow the
 * cut. The seal straddles the sheet's top edge; its shadow is the icon drop (`shadow.icon-drop`).
 * The seal is the one raised thing here.
 */
.sd-guarantee {
	--sd-guarantee-ink: var(--wp--preset--color--sd-deep-midnight);
	--sd-guarantee-soft: color-mix(in srgb, var(--wp--preset--color--sd-deep-midnight) 72%, transparent);
	--sd-guarantee-seal: clamp(104px, 12vw, 152px);
	--sd-guarantee-pad: clamp(28px, 4vw, 56px);
	position: relative;
	isolation: isolate;
	display: grid;
	justify-items: start;
	margin-top: calc(var(--sd-guarantee-seal) / 2);
	padding: calc(var(--sd-guarantee-seal) / 2 + var(--wp--preset--spacing--30)) var(--sd-guarantee-pad) var(--sd-guarantee-pad);
	color: var(--sd-guarantee-ink);
}

/* The sheet: white paper, its edges cut by hand (a mask). */
.sd-guarantee::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--wp--preset--color--white);
	-webkit-mask: url("../../assets/decorations/box-drawn.svg") center / 100% 100% no-repeat;
	mask: url("../../assets/decorations/box-drawn.svg") center / 100% 100% no-repeat;
}

/* A mask would clip a shadow, so the same shape sits underneath as a white picture and casts the
   sheet's fine edge and short shadow. */
.sd-guarantee::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;
	background: url("../../assets/decorations/box-drawn-paper.svg") center / 100% 100% no-repeat;
	filter: drop-shadow(0 0 0.5px rgb(1 29 43 / 0.16)) drop-shadow(0 1px 1px rgb(1 29 43 / 0.05)) drop-shadow(0 4px 6px rgb(1 29 43 / 0.04));
}

/* The seal straddles the sheet's top edge at the left, half on the paper and half off it, turned a little:
   pinned on, not printed. The sheet leaves room above itself and inside its top for it. */
.sd-guarantee__mark {
	position: absolute;
	top: 0;
	left: var(--sd-guarantee-pad);
	z-index: 1;
	translate: 0 -50%;
	rotate: -6deg;
}

.sd-guarantee .sd-guarantee__seal {
	display: block;
	width: var(--sd-guarantee-seal);
	height: auto;
	filter: var(--wp--custom--shadow--icon-drop);
}

.sd-guarantee__body {
	display: grid;
	gap: var(--wp--preset--spacing--20);
	min-width: 0;
	max-width: 40rem;
}

.sd-guarantee .sd-guarantee__label {
	margin: 0;
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--fixed-12);
	font-style: normal;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--pricing-action);
}

.sd-guarantee .sd-guarantee__heading {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--heading-3);
	font-style: normal;
	font-weight: 700;
	line-height: 0.98;
	letter-spacing: 0;
	text-transform: none;
	text-wrap: balance;
	color: var(--sd-guarantee-ink);
}

.sd-guarantee__text {
	display: grid;
	gap: 0.6em;
	margin-top: var(--wp--preset--spacing--20);
}

.sd-guarantee .sd-guarantee__para {
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--fixed-18);
	font-style: normal;
	font-weight: 500;
	line-height: 1.5;
	letter-spacing: -0.01em;
	text-wrap: pretty;
	color: var(--sd-guarantee-ink);
}

.sd-guarantee .sd-guarantee__close {
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--fixed-16);
	font-style: italic;
	font-weight: 500;
	line-height: 1.45;
	color: var(--sd-guarantee-soft);
}

/* ---- Photos ----
   Two photos stacked at the sheet's right, in the site's photo style (rounded, turned, a soft
   drop, no border): the top one reaches over the sheet's top edge, and both hang past its right
   edge. Beside the words only where there is room; on narrower screens they are left out. */
.sd-guarantee__photos {
	display: none;
}

@media (width >= 62rem) {
	.sd-guarantee {
		grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
		align-items: center;
		column-gap: clamp(28px, 4vw, 64px);
	}

	.sd-guarantee__photos {
		position: relative;
		display: block;
		align-self: stretch;
		justify-self: stretch;
		min-height: 300px;
		margin-top: calc(-1 * (var(--sd-guarantee-seal) / 2 + var(--wp--preset--spacing--30)) - 40px);
		margin-right: calc(-1 * var(--sd-guarantee-pad) - clamp(0px, 4vw - 40px, 28px));
		margin-bottom: calc(-1 * var(--sd-guarantee-pad) + 12px);
	}

	.sd-guarantee .sd-guarantee__photo {
		position: absolute;
		width: 74%;
		height: auto;
		aspect-ratio: 3 / 2;
		object-fit: cover;
		border-radius: var(--wp--custom--radius--md);
		box-shadow: var(--wp--custom--shadow--photo-marquee), var(--wp--custom--shadow--photo-marquee-drop);
	}

	.sd-guarantee .sd-guarantee__photo--top {
		top: 0;
		right: 0;
		z-index: 1;
		rotate: 4deg;
	}

	.sd-guarantee .sd-guarantee__photo--under {
		bottom: 0;
		left: 0;
		rotate: -5deg;
	}
}

/* ---- Card ----
   The promise on a raised paper card, centred, with the seal pinned over its top edge. The terms are
   read as steps: each paragraph is one step, its opening bold words the step's name, numbered in the
   kit's raised paper pills and set three to a row under a hairline. No photos. */
.sd-guarantee--card {
	--sd-guarantee-seal: clamp(72px, 7vw, 96px);
	--sd-guarantee-pad: clamp(24px, 5vw, 72px);
	grid-template-columns: minmax(0, 1fr);
	justify-items: center;
	margin-top: calc(var(--sd-guarantee-seal) / 2);
	padding: calc(var(--sd-guarantee-seal) / 2 + var(--wp--preset--spacing--40)) var(--sd-guarantee-pad) clamp(28px, 4vw, 56px);
	border-radius: var(--wp--custom--radius--band, var(--wp--custom--radius--lg));
	background: linear-gradient(var(--wp--preset--color--white), color-mix(in srgb, var(--wp--preset--color--sd-cream) 60%, var(--wp--preset--color--white)));
	box-shadow: var(--wp--custom--shadow--paper), 0 18px 30px -22px color-mix(in srgb, var(--wp--preset--color--sd-deep-midnight) 22%, transparent);
	text-align: center;
}

.sd-guarantee--card::before,
.sd-guarantee--card::after {
	content: none;
}

.sd-guarantee--card .sd-guarantee__mark {
	left: 50%;
	translate: -50% -50%;
}

.sd-guarantee--card .sd-guarantee__body {
	justify-items: center;
	width: 100%;
	max-width: none;
}

.sd-guarantee--card .sd-guarantee__label {
	font-family: var(--wp--preset--font-family--script);
	font-size: var(--wp--preset--font-size--fixed-18);
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.05em;
	text-transform: none;
	color: color-mix(in srgb, var(--wp--preset--color--sd-deep-midnight) 62%, transparent);
}

.sd-guarantee--card .sd-guarantee__heading {
	max-width: 18ch;
	font-size: clamp(var(--wp--preset--font-size--fixed-40), 4.4vw, 4rem);
	line-height: 0.96;
}

.sd-guarantee--card .sd-guarantee__text {
	counter-reset: sd-guarantee-step;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--40) clamp(24px, 4vw, 56px);
	width: 100%;
	margin-top: clamp(24px, 3vw, 40px);
	padding-top: clamp(24px, 3vw, 40px);
	border-top: 1px solid var(--wp--preset--color--paper-edge);
	text-align: start;
}

.sd-guarantee--card .sd-guarantee__para {
	counter-increment: sd-guarantee-step;
	position: relative;
	padding-inline-start: calc(var(--wp--preset--spacing--45) + var(--wp--preset--spacing--20));
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--fixed-16);
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: 0;
	color: var(--sd-guarantee-soft);
}

.sd-guarantee--card .sd-guarantee__para::before {
	content: counter(sd-guarantee-step);
	position: absolute;
	inset-block-start: 0;
	inset-inline-start: 0;
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: var(--wp--preset--spacing--v-5-9);
	height: var(--wp--preset--spacing--v-5-9);
	padding-block-start: 3px;
	border-radius: var(--wp--custom--radius--full);
	background: linear-gradient(var(--wp--preset--color--white), var(--wp--preset--color--sd-cream));
	box-shadow: var(--wp--custom--shadow--raised-quiet);
	font-family: var(--wp--preset--font-family--script);
	font-size: var(--wp--preset--font-size--fixed-22);
	line-height: 1;
	color: var(--wp--preset--color--secondary);
}

.sd-guarantee--card .sd-guarantee__para strong {
	display: block;
	margin-block-end: var(--wp--preset--spacing--10);
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--fixed-28);
	font-weight: 700;
	line-height: 1;
	color: var(--sd-guarantee-ink);
}

.sd-guarantee--card .sd-guarantee__photos {
	display: none;
}

@media (width >= 56rem) {
	.sd-guarantee--card .sd-guarantee__text {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/*
 * Strip variant: the guarantee set straight on the page under something else (the packages). At the
 * left a raised badge with the green seal and the label. Beside it the promise in bold and the terms under it. On a phone the stamp
 * sits above the words.
 */
.sd-guarantee.sd-guarantee--strip {
	--sd-stamp: var(--wp--preset--color--sd-go, #2f7d32);

	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: var(--wp--preset--spacing--10) var(--wp--preset--spacing--50);
	max-width: none;
	margin: 0;
	/* The near-white tile (content kit, card style Tile), so it pairs with a card beside it. */
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	border-radius: 1.375rem;
	background: linear-gradient(180deg, #fcfbf9, #f9f7f3);
	box-shadow: 0 0 0 1px rgb(29 45 53 / 0.07), inset 0 1px 0 #fff;
	rotate: none;
	text-align: start;
}

.sd-guarantee.sd-guarantee--strip::before,
.sd-guarantee.sd-guarantee--strip::after {
	content: none;
}

.sd-guarantee--strip .sd-guarantee__body {
	display: contents;
}

/* The seal is drawn inside the stamp, so the two are one badge. */
.sd-guarantee--strip .sd-guarantee__mark {
	display: none;
}

/* The badge: Strong's Risk Free Guarantee badge (assets/badges/risk-free-guarantee.svg, its glow taken
   out), which carries its own lettering. It sits a little off straight with the site's own soft drop
   under it, as the seals and raised keys have. The label's words stay in the page for readers and
   search, set invisibly small under the picture. */
.sd-guarantee.sd-guarantee--strip .sd-guarantee__label {
	grid-column: 1;
	grid-row: 1 / span 2;
	/* One number sizes the badge; its height and the rosette's middle follow from the artwork. */
	--sd-badge-w: 7.25rem;
	--sd-badge-h: calc(var(--sd-badge-w) * 151 / 124);

	width: var(--sd-badge-w);
	height: var(--sd-badge-h);
	margin: -0.5rem 0;
	padding: 0;
	border: 0;
	outline: 0;
	overflow: visible;
	background: url("../../assets/badges/risk-free-guarantee.svg?v=6") center / contain no-repeat;
	box-shadow: none;
	/* The depth is drawn into the badge (a ring, a lit inner edge, a darker lip under the card); the
	   shadow is only a tight line of contact. */
	filter: drop-shadow(0 1px 1px rgb(1 29 43 / 0.1));
	color: transparent;
	font-size: 1px;
	line-height: 1;
	rotate: -2.5deg;
	user-select: none;
}

.sd-guarantee.sd-guarantee--strip .sd-guarantee__heading {
	grid-column: 2;
	align-self: end;
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--fixed-22);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0;
}

.sd-guarantee--strip .sd-guarantee__text {
	grid-column: 2;
	align-self: start;
	display: block;
	max-width: 44rem;
	margin: 0;
	padding: 0;
	border: 0;
}

.sd-guarantee.sd-guarantee--strip .sd-guarantee__para {
	display: block;
	margin: 0;
	padding: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--fixed-18);
	line-height: 1.5;
	color: color-mix(in srgb, var(--wp--preset--color--sd-deep-midnight) 78%, transparent);
}

.sd-guarantee.sd-guarantee--strip .sd-guarantee__para::before {
	content: none;
}

/* The optional button under the terms: the site's quiet button, in the text's column. */
.sd-guarantee--strip .sd-guarantee__more {
	grid-column: 2;
	margin: var(--wp--preset--spacing--30) 0 0;
}

.sd-guarantee:not(.sd-guarantee--strip) .sd-guarantee__more {
	display: none;
}

/* Beside the text, the badge hangs from the heading: the middle of its tick rosette sits on the middle
   of the heading, however many lines the heading runs to. Its margins cancel its height, so it takes
   no room in the heading's row and is centred on it; --sd-badge-eye is how far down the badge the
   rosette's middle is. */
@media (width >= 48rem) {
	.sd-guarantee.sd-guarantee--strip .sd-guarantee__label {
		--sd-badge-eye: calc(var(--sd-badge-h) * 0.329);

		grid-row: 1;
		align-self: center;
		margin-block: calc(-1 * var(--sd-badge-eye)) calc(var(--sd-badge-eye) - var(--sd-badge-h));
	}

	/* The badge no longer holds the strip open, so the strip keeps room for it under the heading. */
	.sd-guarantee.sd-guarantee--strip {
		min-height: 7rem;
		/* Heading and terms sit as close as the card's beside it, so the two paragraphs share lines. */
		row-gap: 0;
	}
}

@media (width < 48rem) {
	.sd-guarantee.sd-guarantee--strip {
		grid-template-columns: minmax(0, 1fr);
		justify-items: start;
		gap: var(--wp--preset--spacing--20);
		padding: var(--wp--preset--spacing--40);
	}

	.sd-guarantee.sd-guarantee--strip .sd-guarantee__label,
	.sd-guarantee.sd-guarantee--strip .sd-guarantee__heading,
	.sd-guarantee--strip .sd-guarantee__more,
	.sd-guarantee--strip .sd-guarantee__text {
		grid-column: 1;
		grid-row: auto;
	}

	.sd-guarantee.sd-guarantee--strip .sd-guarantee__label {
		margin-block-end: var(--wp--preset--spacing--20);
	}
}

/*
 * Beside a card in a Split, neither is a tile: both sit straight on the page, with the site's faint
 * drawn divider standing between them (lying between them once the Split stacks).
 */
.wp-block-stronger-split.wp-block-stronger-split:has(> .sd-guarantee--strip) {
	/* Both start on the same line: the two headings level, the stamp's top with them. */
	align-items: start;
	/* Two equal halves, with room either side of the divider. */
	gap: var(--wp--preset--spacing--80);
	padding-block-start: var(--wp--preset--spacing--20);
}

/* The badge rises above its heading, so from the width where it sits beside the text the pair starts
   lower, leaving the badge clear air under the pricing tray. */
@media (width >= 48rem) {
	.wp-block-stronger-split.wp-block-stronger-split:has(> .sd-guarantee--strip) {
		padding-block-start: var(--wp--preset--spacing--60);
	}
}

.wp-block-stronger-split > .sd-guarantee.sd-guarantee--strip,
.wp-block-stronger-split:has(> .sd-guarantee--strip) > .wp-block-stronger-card.is-style-tile {
	padding: var(--wp--preset--spacing--30) 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

.wp-block-stronger-split > .sd-guarantee.sd-guarantee--strip {
	align-items: start;
	padding-inline-start: var(--wp--preset--spacing--30);
}

/* The card beside it runs the same height, its heading level with the promise and its button on the
   same line as the guarantee's, whichever side has more text. */
@media (width >= 48rem) {
	.wp-block-stronger-split:has(> .sd-guarantee--strip .sd-guarantee__more) > .wp-block-stronger-card.is-style-tile {
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
		align-self: stretch;
	}

	.wp-block-stronger-split:has(> .sd-guarantee--strip .sd-guarantee__more) > .wp-block-stronger-card.is-style-tile > .wp-block-stronger-stack {
		flex: 1 1 auto;
		justify-content: flex-start;
	}

	.wp-block-stronger-split:has(> .sd-guarantee--strip .sd-guarantee__more) > .wp-block-stronger-card.is-style-tile .wp-block-buttons:last-child {
		margin-block-start: auto;
	}
}

/* In its half the terms take the width they are given. */
.wp-block-stronger-split > .sd-guarantee--strip .sd-guarantee__text {
	max-width: none;
}

.wp-block-stronger-split > .sd-guarantee.sd-guarantee--strip .sd-guarantee__heading {
	align-self: start;
}

.wp-block-stronger-split:has(> .sd-guarantee--strip) > .wp-block-stronger-card.is-style-tile {
	position: relative;
	overflow: visible;
	align-self: stretch;
	display: flex;
	align-items: flex-start;
}

.wp-block-stronger-split:has(> .sd-guarantee--strip) > .wp-block-stronger-card.is-style-tile::before {
	content: "";
	position: absolute;
	/* It starts up behind whatever the pair sits under (the packages tray), and comes down from there. */
	inset: -3.5rem auto 0 calc(var(--wp--preset--spacing--80) / -2 - 2px);
	/* A fine line of ink cut to the drawn shape (a mask), as the Cells rules are: sharp at any height. */
	width: 4px;
	background: color-mix(in srgb, var(--wp--preset--color--sd-deep-midnight) 20%, transparent);
	-webkit-mask: url("../../assets/decorations/divider-drawn-vertical.svg") center / 100% 100% no-repeat;
	mask: url("../../assets/decorations/divider-drawn-vertical.svg") center / 100% 100% no-repeat;
	pointer-events: none;
}

/* The card's words take the guarantee's: an opening bold phrase is its heading, on a line of its own,
   and the rest is the same size and ink as the guarantee's terms. */
.wp-block-stronger-split:has(> .sd-guarantee--strip) > .wp-block-stronger-card.is-style-tile p {
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--fixed-18);
	line-height: 1.5;
	color: color-mix(in srgb, var(--wp--preset--color--sd-deep-midnight) 78%, transparent);
}

.wp-block-stronger-split:has(> .sd-guarantee--strip) > .wp-block-stronger-card.is-style-tile p > strong:first-child {
	display: block;
	font-size: var(--wp--preset--font-size--fixed-22);
	font-weight: 700;
	line-height: 1.3;
	color: var(--wp--preset--color--sd-deep-midnight);
}

/* The tray above is lifted over the divider's top end. */
.wp-block-stronger-stack:has(> .wp-block-stronger-split > .sd-guarantee--strip) > .sd-packages .sd-packages__tray {
	position: relative;
	z-index: 1;
}

@media (width < 64rem) {
	.wp-block-stronger-split.wp-block-stronger-split:has(> .sd-guarantee--strip) {
		gap: var(--wp--preset--spacing--50);
	}

	.wp-block-stronger-split > .sd-guarantee.sd-guarantee--strip {
		padding-inline-start: 0;
	}

	.wp-block-stronger-split:has(> .sd-guarantee--strip) > .wp-block-stronger-card.is-style-tile::before {
		inset: calc(var(--wp--preset--spacing--50) / -2 - 2px) 0 auto;
		width: auto;
		height: 4px;
		-webkit-mask-image: url("../../assets/decorations/divider-drawn.svg");
		mask-image: url("../../assets/decorations/divider-drawn.svg");
	}
}
