/*
 * Varnify Card: the front page below the first screen.
 *
 * The line set at full size, the fees under their own heading row, the
 * folded leaflet opened flat and the print laid edge to edge: the sections
 * that give the page its rhythm after the slate, each a different shape
 * (a band of type, a heading row over a spread, one object in the middle,
 * a print across the whole page). Loaded after style.css only on a page
 * that renders one of them (varnify_card_front_style() in functions.php),
 * and always in the editor.
 */

/* ---------------------------------------------------------------------------
   A line at full size

   The first thing past the slate: one sentence, the phrase it turns on set
   as large as the page allows, the way a printer pulls a proof of a single
   line in the biggest type in the case. The words around it are in the
   reading serif. Three castings, from the headline's block styles:
   - the default, a consultant's: the phrase in the reading serif, heavy
     and tight, pressed into the stone (shade on its top wall, light on its
     lower lip), the impression deepening as it comes into view. Not the
     card's wide face: wide heavy type at this size is Chair's;
   - Quiet (a therapist's): one light roman, centred, the phrase a shade of
     the ink, and space instead of weight;
   - Engraved (a practice's): centred between double rules, the phrase in
     spaced capitals, as a firm's letterhead is engraved.
   Every size is a clamp(), the phrase wraps (balanced) rather than being
   fitted, so a long phrase or a wide font of the owner's still fits.
   --------------------------------------------------------------------------- */

.varnify-card-statement {
	padding-top: clamp(64px, 8vw, 132px);
}

.varnify-card-statement__line {
	max-width: none;
	margin: 0;
	font-family: var(--vc-text);
	font-size: clamp(24px, 1.6vw + 15px, 46px);
	font-weight: 400;
	line-height: 1.14;
	letter-spacing: -0.018em;
	text-wrap: balance;
	overflow-wrap: break-word;
}

.varnify-card-statement__line mark,
.varnify-card-statement__line .varnify-card-mark {
	display: block;
	margin: 0.08em 0 0.1em -0.04em;
	background: none;
	color: inherit;
	font-family: var(--vc-text);
	font-size: clamp(58px, 12.4vw, 190px);
	font-stretch: normal;
	font-weight: 640;
	line-height: 0.92;
	letter-spacing: -0.04em;
	text-wrap: balance;
	text-shadow:
		0 0.022em 0 rgb(255 255 255 / 0.95),
		0 -0.014em 0 rgb(40 34 22 / 0.34);
}

/* The impression deepens as the line comes into view: shadow only, so the
   letters never move and their contrast never changes. */
@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.varnify-card-statement__line:not([class*="is-style-"]) mark {
			animation: varnify-card-press linear both;
			animation-timeline: view();
			animation-range: entry 30% cover 42%;
		}
	}
}

@keyframes varnify-card-press {
	from {
		text-shadow:
			0 0 0 rgb(255 255 255 / 0),
			0 0 0 rgb(40 34 22 / 0);
	}
}

/* Quiet. */
.varnify-card-statement:has(.is-style-varnify-card-quiet) {
	padding-top: clamp(80px, 11vw, 176px);
	padding-bottom: clamp(16px, 3vw, 48px);
}

.varnify-card-statement__line.is-style-varnify-card-quiet {
	color: var(--vc-grey);
	text-align: center;
}

.varnify-card-statement__line.is-style-varnify-card-quiet mark {
	margin: 0.12em auto 0.16em;
	font-family: var(--vc-text);
	font-size: clamp(48px, 8.6vw, 140px);
	font-stretch: normal;
	font-weight: 400;
	line-height: 1;
	letter-spacing: -0.035em;
	color: color-mix(in oklab, var(--vc-ink) 84%, var(--vc-black));
	text-shadow: none;
}

/* Engraved. */
.varnify-card-statement__line.is-style-varnify-card-engraved {
	position: relative;
	padding: clamp(28px, 3.4vw, 52px) 0;
	color: var(--vc-grey);
	text-align: center;
}

.varnify-card-statement__line.is-style-varnify-card-engraved::before,
.varnify-card-statement__line.is-style-varnify-card-engraved::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 5px;
	border-block: 1px solid var(--vc-black);
	transform-origin: 50% 50%;
}

.varnify-card-statement__line.is-style-varnify-card-engraved::before {
	top: 0;
}

.varnify-card-statement__line.is-style-varnify-card-engraved::after {
	bottom: 0;
}

.varnify-card-statement__line.is-style-varnify-card-engraved mark {
	margin: 0.14em -0.12em 0.18em 0;
	font-family: var(--vc-text);
	font-size: clamp(40px, 8.8vw, 140px);
	font-stretch: normal;
	font-variant-caps: normal;
	font-variant-numeric: lining-nums;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: color-mix(in oklab, var(--vc-ink) 88%, var(--vc-black));
	text-shadow: none;
}

/* The double rules are drawn across as the line comes into view. */
@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		.varnify-card-statement__line.is-style-varnify-card-engraved::before,
		.varnify-card-statement__line.is-style-varnify-card-engraved::after {
			animation: varnify-card-rule linear both;
			animation-timeline: view();
			animation-range: entry 20% cover 40%;
		}
	}
}

@keyframes varnify-card-rule {
	from {
		transform: scaleX(0.08);
	}
}

@media (min-width: 960px) {
	.varnify-card-statement + .varnify-card-proof {
		padding-top: clamp(72px, 7vw, 120px);
	}
}


/* ---------------------------------------------------------------------------
   Services: the fee card
   --------------------------------------------------------------------------- */

.varnify-card-services__head h2 {
	max-width: 12ch;
}

.varnify-card-services__lead {
	max-width: 34ch;
	margin: 18px 0 0;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.45;
	color: var(--vc-grey);
}

.varnify-card-services__photo {
	margin: 40px 0 0;
}

.varnify-card-services__photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.varnify-card-services__photo figcaption,
.varnify-card-photoband figcaption {
	margin-top: 12px;
	font-size: 15px;
	line-height: 1.45;
	color: var(--vc-grey);
}

/* The fees: each engagement on a card of its own, the price on the card's
   tab, the three laid one under another. */
.varnify-card-feecard {
	position: relative;
	margin-top: 64px;
}

.varnify-card-feecard__tab {
	display: none;
}

.varnify-card-rows {
	display: grid;
	gap: 52px;
}

.varnify-card-row {
	position: relative;
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
	padding: clamp(22px, 2.6vw, 34px) clamp(20px, 3vw, 40px) clamp(22px, 2.6vw, 32px);
	background: var(--vc-card);
	box-shadow: var(--vc-flat);
	--vc-e: 5px;
}

.varnify-card-row:nth-child(2) {
	margin-left: clamp(0px, 3vw, 40px);
}

.varnify-card-row:nth-child(3) {
	margin-left: clamp(0px, 1.5vw, 20px);
}

.varnify-card-row > * {
	margin: 0;
}

.varnify-card-row h3 {
	font-size: clamp(20px, 1.2vw + 11px, 25px);
	font-weight: 620;
	line-height: 1.2;
	text-shadow: var(--vc-press);
}

/* The price, printed on the card's face beside the engagement's name, in
   the ink, the way a rate card sets it: no tab. On a narrow card it goes
   under the name. */
@media (min-width: 600px) {
	.varnify-card-row {
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: 28px;
		align-items: baseline;
	}

	.varnify-card-row > :not(h3, .varnify-card-row__price) {
		grid-column: 1 / -1;
	}
}

/* A long price ("Settlement agreements from £400 + VAT") wraps in its
   own column rather than crowding the engagement's name. */
.varnify-card-row__price {
	max-width: 15em;
	text-wrap: balance;
	color: var(--vc-ink);
	font-family: var(--vc-face);
	font-size: clamp(17px, 0.4vw + 14px, 20px);
	font-stretch: 108%;
	font-weight: 650;
	font-variant-numeric: tabular-nums lining-nums;
	line-height: 1.2;
	text-align: right;
	text-shadow: var(--vc-press);
}

@media (max-width: 599px) {
	.varnify-card-row__price {
		text-align: left;
	}
}

.varnify-card-row__desc {
	max-width: 52ch;
	font-size: 17px;
	line-height: 1.5;
	color: var(--vc-grey);
}

.varnify-card-services__note {
	margin: 20px 0 0;
	font-size: 15px;
	color: var(--vc-grey);
}

.varnify-card-pay {
	margin-top: 40px;
	font-size: 15px;
	line-height: 1.5;
}

.varnify-card-pay__title {
	margin: 0 0 10px;
	font-size: 17px;
}

/* How to pay reads as one note, not a list of labels: each item runs on
   after the last, its first words set as the clause heads of printed
   terms, in the card's face, roman, and closed with a full stop. */
.varnify-card-pay {
	max-width: 52ch;
}

.varnify-card-pay__item {
	display: inline;
	margin: 0;
	color: var(--vc-grey);
}

.varnify-card-pay__item + .varnify-card-pay__item::before {
	content: " ";
}

.varnify-card-pay__item strong {
	font-family: var(--vc-face);
	font-size: 0.93em;
	font-stretch: 104%;
	font-weight: 640;
	color: var(--vc-black);
}

.varnify-card-pay__item strong::after {
	content: ".";
}

@media (max-width: 600px) {
	.varnify-card-row__price {
		left: 16px;
		right: auto;
		max-width: calc(100% - 32px);
		white-space: normal;
		line-height: 1.2;
	}
}

/* From a desktop the fees open with a heading row across the whole
   measure, set large, the lead at its far end and a rule pressed blind
   under both; then a spread: the fee card (or the schedule, or the soft
   card) on the left page, the print and How to pay on the right. */
@media (min-width: 960px) {
	.varnify-card-services__head {
		position: relative;
		display: flex;
		grid-column: 1 / -1;
		grid-row: 1;
		align-items: flex-end;
		justify-content: space-between;
		gap: 48px;
		padding-bottom: 30px;
	}

	.varnify-card-services__head::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		height: 3px;
		background: var(--vc-groove);
		box-shadow: inset 0 1px 0 var(--vc-groove-edge), 0 1px 0 var(--vc-groove-light);
	}

	.varnify-card-services__head h2 {
		max-width: 14ch;
		font-size: clamp(56px, 6.4vw, 104px);
		line-height: 0.96;
		letter-spacing: -0.03em;
	}

	.varnify-card-services__lead {
		flex: 0 1 30ch;
		margin: 0 0 0.4em;
	}

	.varnify-card-feecard {
		grid-column: 1 / 8;
		grid-row: 2 / span 2;
		align-self: start;
		margin-top: 64px;
	}

	.varnify-card-services__photo {
		grid-column: 9 / -1;
		grid-row: 2;
		margin-top: 64px;
	}

	.varnify-card-services__photo img {
		aspect-ratio: 4 / 5;
	}

	.varnify-card-pay {
		grid-column: 9 / -1;
		grid-row: 3;
		margin-top: 36px;
	}
}


/* ---------------------------------------------------------------------------
   How I work: the leaflet opened flat

   One object in the middle of the page: the heading centred over the
   folded leaflet, laid flat across the measure, with nothing beside it. A
   print the owner adds to the section is laid out by
   style.css as before.
   --------------------------------------------------------------------------- */

.varnify-card-how:not(:has(> .varnify-card-how__print)) > h2 {
	text-align: center;
}

.varnify-card-how:not(:has(> .varnify-card-how__print)) > h2,
.varnify-card-how--first > h2 {
	text-wrap: balance;
}

@media (min-width: 960px) {
	.varnify-card-how:not(:has(> .varnify-card-how__print)) > h2 {
		font-size: clamp(56px, 6.4vw, 104px);
		line-height: 0.96;
		letter-spacing: -0.03em;
	}

	.varnify-card-how:not(:has(> .varnify-card-how__print)) > .varnify-card-steps {
		max-width: 1180px;
		margin: 64px auto 0;
	}
}

/* Your first session (a therapist's) takes the same opening: the heading
   centred and large, then a spread: the session's card on the left page
   and the print of the room on the right, beside it, not under it (the
   mirror of Where we would meet, which follows it). */
@media (min-width: 960px) {
	.varnify-card-how--first:has(> .varnify-card-how__print) > h2 {
		grid-column: 1 / -1;
		grid-row: 1;
		margin-bottom: 64px;
		font-size: clamp(56px, 6.4vw, 104px);
		line-height: 0.96;
		letter-spacing: -0.03em;
		text-align: center;
	}

	.varnify-card-how--first > .varnify-card-how__print {
		grid-column: 6 / -1;
		grid-row: 2;
		align-self: center;
	}

	.varnify-card-how--first > .varnify-card-how__print img {
		aspect-ratio: 4 / 3;
	}

	.varnify-card-how--first:has(> .varnify-card-how__print) > .varnify-card-first {
		grid-column: 1 / 6;
		grid-row: 2;
		align-self: center;
		margin: 0 16px 0 0 !important;
		rotate: -0.6deg;
	}
}


/* ---------------------------------------------------------------------------
   Print, wide
   --------------------------------------------------------------------------- */

.varnify-card-photoband {
	padding-top: var(--vc-section);
}

.varnify-card-photoband img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* Laid edge to edge (the pattern sets it full width): the slip is pinned
   at the measure's right edge, not the screen's, and a warm print's
   handled corners are square where the print runs off the page. */
.varnify-card-photoband.alignfull figcaption {
	margin-right: var(--vc-gutter);
}

.varnify-card-front .varnify-card-photoband.alignfull img {
	border-radius: 0;
}

/* The print runs the full measure, and its caption is written on a slip
   laid over its foot, the way a print is labelled in a client file. */
.varnify-card-photoband figcaption {
	--vc-e: 4px;
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: fit-content;
	max-width: min(32ch, calc(100% - 32px));
	margin: -26px 16px 0 auto;
	padding: 14px 18px 16px;
	background: var(--vc-card);
	box-shadow: var(--vc-flat);
	color: var(--vc-black);
	font-size: 16px;
	line-height: 1.45;
	text-align: left;
	rotate: 0.8deg;
}

@media (min-width: 960px) {
	.varnify-card-photoband img {
		aspect-ratio: 12 / 5;
	}

	.varnify-card-photoband.alignfull img {
		aspect-ratio: 21 / 8;
		max-height: 82vh;
	}

	.varnify-card-photoband figcaption {
		margin: -64px 6% 0 auto;
		padding: 20px 26px 22px;
		font-size: 19px;
	}
}
