/**
 * Pattern layouts (patterns/*.php): heroes, grids, bento cards, In short,
 * price lines, step tiles, splits, bands and decorations.
 *
 * Mobile first: one column, then wider layouts at 600, 768, 900, 1024 and
 * 1200px. Tokens only (assets/css/base.css, --pfa-*); colours come from the
 * surface a block sits on (base.css and core-group.css set --pfa-text-muted, --pfa-rule and
 * friends). Loaded on the site and in the editor, so patterns look the same
 * in both.
 *
 * Class names never contain "--": WordPress escapes it inside block
 * comments. Modifiers use one hyphen (pfa-grid-3, pfa-hero-home).
 *
 * Contents
 *   1. Sections and section heads
 *   2. Grids and splits
 *   3. Heroes
 *   4. Photos, photo card and chip, glass art
 *   5. Price lines and the In short box (facts)
 *   6. Cards: trust tiles, trust strip, service and path cards, next steps
 *   7. Step tiles
 *   8. Bands: statement, violet, next step, route-finder
 *   9. Small text: notes, honesty line, small print, inline links
 *  10. Line-art decoration
 *  11. Empty states: sections whose data is not there yet
 */

/* -------------------------------------------------------------------------
 * 1. Sections and section heads
 * ---------------------------------------------------------------------- */

.wp-block-group.pfa-section {
	box-sizing: border-box;
	padding-block: calc(var(--pfa-section-y) / 2);
}

/* 16px between the heading, its lead and the rest of the head: the gap under
   a heading everywhere (core-paragraph.css). */
.wp-block-group.pfa-section__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	row-gap: var(--pfa-space-4);
	margin-block-end: var(--pfa-space-6);
}

.wp-block-group.pfa-section__head > * {
	margin-block: 0;
}

/* A head that ends its section (a short text section) adds no space below:
   the section padding does that, as everywhere else. */
.wp-block-group.pfa-section__head:last-child {
	margin-block-end: 0;
}

.pfa-section__link {
	font-weight: 600;
}

/*
 * Reading sections on landing pages: text keeps the reading measure (37rem,
 * about 65 characters at 18px) but lines up with the left edge of the wide
 * grids above and below it. From 1024px the H2 and its lead move to a left
 * column and the rest to a right one (end of this section).
 */
.wp-block-group.pfa-section__body > * {
	max-width: var(--pfa-measure);
}

/* The urgent help page block lays its service cards across the wide grid. */
.wp-block-group.pfa-section__body > :is(.pfa-urgent-help--page, .wp-block-pfa-urgent-help:has(.pfa-urgent-help--page)) {
	max-width: none;
}

/* Cards, callouts and price tables (a card of their own): the measure plus
   the card's padding, so their edges line up. */
.wp-block-group.pfa-section__body > :is(.wp-block-group:is(.is-style-card, .is-style-card-lavender, .is-style-callout-note, .is-style-callout-important, .is-style-callout-medication), .pfa-price-table) {
	max-width: calc(var(--pfa-measure) + 2 * var(--pfa-space-6));
}

/* Data tables keep the 720px content width, so their headers do not wrap. */
.wp-block-group.pfa-section__body > .wp-block-table {
	max-width: var(--pfa-content);
}

/* A body that is only a price table (booking page, "What it costs") is not
   capped at the measure: its edges line up with the cards on the page. */
.wp-block-group.pfa-section > .pfa-section__head + .wp-block-group.pfa-section__body > .pfa-price-table:only-child {
	max-width: none;
}

.wp-block-group.pfa-section__body > :first-child {
	margin-block-start: 0;
}

/* A second heading in one reading section starts a new part: more space. */
.wp-block-group.pfa-section__body > h2:not(:first-child) {
	margin-block-start: var(--pfa-space-8);
}

/* The line under a grid: honesty line, "See all" links. Aligned with the grid. */
.wp-block-group.pfa-section__foot {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	justify-items: start;
	row-gap: var(--pfa-space-4);
	margin-block-start: var(--pfa-space-5);
}

.wp-block-group.pfa-section__foot > * {
	margin-block: 0;
}

.wp-block-group.pfa-section__foot > p {
	max-width: var(--pfa-measure);
}

/* Free text in a section head or foot keeps the reading measure; only grids
   run wide. Callouts in a foot get the same cap as callouts in a body. */
.wp-block-group.pfa-section__head > :not(.wp-block-heading, .pfa-section__link),
.wp-block-group.pfa-section__foot > :is(p, ul, ol, .wp-block-heading) {
	max-width: var(--pfa-measure);
}

.wp-block-group.pfa-section__foot > .wp-block-group:is(.is-style-card, .is-style-card-lavender, .is-style-callout-note, .is-style-callout-important, .is-style-callout-medication) {
	max-width: calc(var(--pfa-measure) + 2 * var(--pfa-space-6));
}

/* The urgent help note under a card grid (contact) runs the grid's whole
   width, so its edges line up with the cards above it; sized to its text it
   matched no column and stuck out past the card above. */
.wp-block-group.pfa-section__foot > .pfa-urgent-help--inline {
	justify-self: stretch;
}

/* The same for a callout in the foot of a card grid ("Who will assess you?"
   on clinicians): capped at 656px it left half the row empty beside it. */
.wp-block-group.pfa-grid + .wp-block-group.pfa-section__foot > .wp-block-group[class*="is-style-callout-"] {
	justify-self: stretch;
	max-width: none;
}

/* The side link sits beside the head from 1024px. Below that it stays under
   the lead: at tablet width it left the heading a 300px column (V26). */
@media (min-width: 1024px) {
	.wp-block-group.pfa-section__head:has(> .pfa-section__link) {
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: var(--pfa-space-6);
		align-items: end;
	}

	.wp-block-group.pfa-section__head > :not(.pfa-section__link) {
		grid-column: 1;
	}

	.wp-block-group.pfa-section__head > .pfa-section__link {
		grid-column: 2;
		grid-row: 1 / span 2;
		align-self: end;
	}

	/* A head with a third line (the home services head): the link stays level
	   with the last line instead of floating beside the lead. */
	.wp-block-group.pfa-section__head:has(> :nth-child(3):not(.pfa-section__link)) > .pfa-section__link {
		grid-row: 1 / span 3;
	}
}

/*
 * Two columns from 1024px, on the FAQ sections' lines: 5fr / 7fr with the
 * split gap (base.css). Before, every reading section kept to a 37rem column
 * on the left of the 1200px frame, with half the frame empty beside it.
 *
 * Reading sections: a body that opens with its H2 (or an H3, for a part that
 * follows a card grid) puts the heading, and the lead straight after it, in
 * the left column, and everything else in the right one, where text keeps
 * the reading measure and cards, callouts and tables fill the column.
 * Floats, not grid: the heading and lead stay one block of any height beside
 * text of any length, and the body contains them (flow-root). Not in
 * line-art bands, where the art takes the right. A body that holds a data
 * table (the NHS waits on area pages) gets the columns from 1200px only:
 * at 1024-1199px the right column (531-629px) wrapped the table's headers
 * onto 4-6 lines, so there it keeps one column and the table its 720px.
 * (:where keeps the specificity of the rules as they were.)
 */
@media (min-width: 1024px) {
	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:not(:has(> .wp-block-table))):has(> :is(h2, h3):first-child) {
		--pfa-head-col: calc((100% - var(--pfa-split-gap)) * 5 / 12);
		display: flow-root;
	}

	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:not(:has(> .wp-block-table))) > :is(h2, h3):first-child,
	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:not(:has(> .wp-block-table))) > :is(h2, h3):first-child + p.is-style-lead {
		float: left;
		clear: left;
		width: var(--pfa-head-col);
	}

	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:not(:has(> .wp-block-table))):has(> :is(h2, h3):first-child) > :not(:is(h2, h3):first-child, :is(h2, h3):first-child + p.is-style-lead) {
		margin-inline-start: calc(var(--pfa-head-col) + var(--pfa-split-gap));
	}

	/* The right column starts level with the heading. */
	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:not(:has(> .wp-block-table))) > :is(h2, h3):first-child + p.is-style-lead + *,
	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:not(:has(> .wp-block-table))) > :is(h2, h3):first-child + :not(p.is-style-lead) {
		margin-block-start: 0;
	}

	/* A foot under such a body (buttons, links) starts on the right column too. */
	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:not(:has(> .wp-block-table))):has(> :is(h2, h3):first-child) + .wp-block-group.pfa-section__foot {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		column-gap: var(--pfa-split-gap);
	}

	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:not(:has(> .wp-block-table))):has(> :is(h2, h3):first-child) + .wp-block-group.pfa-section__foot > * {
		grid-column: 2;
	}

	/* A card or callout that opens the body and holds the section's H2 (after
	   a diagnosis, consent, shared care) runs the full width with the same two
	   columns inside: its right column lines up with the page's (the box's
	   32px padding comes off the first column). A box after it (the shared
	   care callout) sits in the right column. */
	.wp-block-group.pfa-section > .wp-block-group.pfa-section__body:has(> .wp-block-group:first-child:is([class*="is-style-card"], [class*="is-style-callout-"]) > h2:first-child) {
		display: grid;
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		column-gap: var(--pfa-split-gap);
		align-items: start;
	}

	.wp-block-group.pfa-section > .wp-block-group.pfa-section__body:has(> .wp-block-group:first-child:is([class*="is-style-card"], [class*="is-style-callout-"]) > h2:first-child) > * {
		grid-column: 2;
		max-width: none;
	}

	.wp-block-group.pfa-section > .wp-block-group.pfa-section__body > .wp-block-group:first-child:is([class*="is-style-card"], [class*="is-style-callout-"]):has(> h2:first-child) {
		grid-column: 1 / -1;
		display: grid;
		grid-template-columns: calc((100% + 2 * var(--pfa-space-6) - var(--pfa-split-gap)) * 5 / 12 - var(--pfa-space-6)) minmax(0, 1fr);
		column-gap: var(--pfa-split-gap);
		align-items: start;
	}

	.wp-block-group.pfa-section > .wp-block-group.pfa-section__body > .wp-block-group:first-child:is([class*="is-style-card"], [class*="is-style-callout-"]):has(> h2:first-child) > * {
		grid-column: 2;
		max-width: var(--pfa-measure);
	}

	.wp-block-group.pfa-section > .wp-block-group.pfa-section__body > .wp-block-group:first-child:is([class*="is-style-card"], [class*="is-style-callout-"]) > h2:first-child {
		grid-column: 1;
		grid-row: 1 / span 20;
	}

	.wp-block-group.pfa-section > .wp-block-group.pfa-section__body > .wp-block-group:first-child:is([class*="is-style-card"], [class*="is-style-callout-"]) > h2:first-child + * {
		margin-block-start: 0;
	}

	/* The same columns in the booking card that opens the booking page ("How
	   to book", pfa/booking without online booking; with it, the calendar
	   keeps the card's whole width). */
	.wp-block-group.pfa-section > .pfa-booking-section__booking .pfa-booking--none .pfa-booking__card {
		display: grid;
		grid-template-columns: calc((100% + 2 * var(--pfa-space-6) - var(--pfa-split-gap)) * 5 / 12 - var(--pfa-space-6)) minmax(0, 1fr);
		column-gap: var(--pfa-split-gap);
		align-items: start;
	}

	.wp-block-group.pfa-section > .pfa-booking-section__booking .pfa-booking--none .pfa-booking__card > * {
		grid-column: 2;
	}

	.wp-block-group.pfa-section > .pfa-booking-section__booking .pfa-booking--none .pfa-booking__card > .pfa-booking__heading {
		grid-column: 1;
		grid-row: 1 / span 20;
	}

	.wp-block-group.pfa-section > .pfa-booking-section__booking .pfa-booking--none .pfa-booking__card > .pfa-booking__heading + * {
		margin-block-start: 0;
	}

	/* A head with a single card under it (one guide, a price row left with one
	   card, a body that is only a price table, the CQC panel on About): the
	   head on the left, the card filling the right, the foot under the head.
	   Never a lone card at half width. The section itself is the grid, framed
	   to the 1200px column; its children take the full track, so the
	   constrained layout's auto margins come to 0. */
	.wp-block-group.pfa-section:is(:has(> .pfa-section__head + .pfa-grid > :only-child), :has(> .pfa-section__head + .pfa-section__body > .pfa-price-table:only-child), :has(> .pfa-guides-section__list .pfa-guides__list > :only-child), :has(> .pfa-about-regulation__cqc)) {
		display: grid;
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		grid-template-rows: auto 1fr;
		column-gap: var(--pfa-split-gap);
		align-items: start;
		padding-inline: max(var(--pfa-gutter), (100% + 2 * var(--pfa-gutter) - var(--pfa-wide)) / 2);
	}

	.wp-block-group.pfa-section:is(:has(> .pfa-section__head + .pfa-grid > :only-child), :has(> .pfa-section__head + .pfa-section__body > .pfa-price-table:only-child), :has(> .pfa-guides-section__list .pfa-guides__list > :only-child), :has(> .pfa-about-regulation__cqc)) > * {
		grid-column: 2;
		width: 100%;
		max-width: none;
	}

	.wp-block-group.pfa-section:is(:has(> .pfa-section__head + .pfa-grid > :only-child), :has(> .pfa-section__head + .pfa-section__body > .pfa-price-table:only-child), :has(> .pfa-guides-section__list .pfa-guides__list > :only-child), :has(> .pfa-about-regulation__cqc)) > .pfa-section__head {
		grid-column: 1;
		grid-row: 1;
		margin-block-end: 0;
	}

	.wp-block-group.pfa-section:is(:has(> .pfa-section__head + .pfa-grid > :only-child), :has(> .pfa-section__head + .pfa-section__body > .pfa-price-table:only-child), :has(> .pfa-guides-section__list .pfa-guides__list > :only-child), :has(> .pfa-about-regulation__cqc)) > .pfa-section__head + * {
		grid-row: 1 / span 2;
		margin-block-start: 0;
	}

	.wp-block-group.pfa-section:is(:has(> .pfa-section__head + .pfa-grid > :only-child), :has(> .pfa-section__head + .pfa-section__body > .pfa-price-table:only-child), :has(> .pfa-guides-section__list .pfa-guides__list > :only-child), :has(> .pfa-about-regulation__cqc)) > .pfa-section__foot {
		grid-column: 1;
		grid-row: 2;
	}

	/* The lone card fills its column (the guides block caps it at 36rem; a
	   lone price table is never capped, see the start of this section). */
	.wp-block-group.pfa-section > .pfa-section__head + .pfa-grid:has(> :only-child),
	.pfa-guides-section .pfa-guides__list:has(> :only-child) {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* The reading-section columns above, from 1200px, for a body that holds a
   data table (one column at 1024-1199px, see above). Same rules. */
@media (min-width: 1200px) {
	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:has(> .wp-block-table)):has(> :is(h2, h3):first-child) {
		--pfa-head-col: calc((100% - var(--pfa-split-gap)) * 5 / 12);
		display: flow-root;
	}

	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:has(> .wp-block-table)) > :is(h2, h3):first-child,
	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:has(> .wp-block-table)) > :is(h2, h3):first-child + p.is-style-lead {
		float: left;
		clear: left;
		width: var(--pfa-head-col);
	}

	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:has(> .wp-block-table)):has(> :is(h2, h3):first-child) > :not(:is(h2, h3):first-child, :is(h2, h3):first-child + p.is-style-lead) {
		margin-inline-start: calc(var(--pfa-head-col) + var(--pfa-split-gap));
	}

	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:has(> .wp-block-table)) > :is(h2, h3):first-child + p.is-style-lead + *,
	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:has(> .wp-block-table)) > :is(h2, h3):first-child + :not(p.is-style-lead) {
		margin-block-start: 0;
	}

	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:has(> .wp-block-table)):has(> :is(h2, h3):first-child) + .wp-block-group.pfa-section__foot {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		column-gap: var(--pfa-split-gap);
	}

	.wp-block-group.pfa-section:not(.pfa-line-art) > .wp-block-group.pfa-section__body:where(:has(> .wp-block-table)):has(> :is(h2, h3):first-child) + .wp-block-group.pfa-section__foot > * {
		grid-column: 2;
	}
}

/* -------------------------------------------------------------------------
 * 2. Grids and splits
 * ---------------------------------------------------------------------- */

.wp-block-group.pfa-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--pfa-space-4);
}

.wp-block-group.pfa-grid > *,
.wp-block-group.pfa-split > *,
.wp-block-group.pfa-hero__grid > * {
	margin-block: 0;
}

/* Four-up grids (trust tiles): one per row on phones, where two narrow columns
   squeezed 18px text into a few words per line; two side by side from 560px. */
@media (min-width: 560px) {
	.wp-block-group.pfa-grid-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* On phones a trust tile reads in one line: icon on the left, words beside it. */
@media (max-width: 559px) {
	.wp-block-group.is-style-card.pfa-trust-tile {
		display: grid;
		grid-template-columns: 3rem minmax(0, 1fr);
		column-gap: var(--pfa-space-4);
		align-items: start;
	}
	.wp-block-group.pfa-trust-tile > .pfa-trust-tile__icon {
		grid-row: 1 / span 4;
		margin: 0;
	}
	.wp-block-group.pfa-trust-tile > * + * {
		margin-block-start: 0;
	}
	.wp-block-group.pfa-trust-tile > :not(.pfa-trust-tile__icon) + * {
		margin-block-start: var(--pfa-space-2);
	}
}

@media (min-width: 600px) {
	.wp-block-group.pfa-grid-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Two columns: a lone last card takes the whole row, so no half row is left
   empty (bento cards share rows). */
@media (min-width: 600px) and (max-width: 1023.98px) {
	.wp-block-group.pfa-grid-3 > :last-child:nth-child(odd) {
		grid-column: 1 / -1;
	}
}

@media (min-width: 768px) {
	.wp-block-group.pfa-grid {
		gap: var(--pfa-space-5);
	}

	.wp-block-group.pfa-grid-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* A two-up row whose card holds a price table (the /areas/ "What it costs" card beside the NHS card):
   one card per row from 768px, so the table keeps its width and the short card is not stretched
   empty; from 1024px each card puts its heading on the left and the rest on the right, like the
   full-row medication card. */
@media (min-width: 768px) {
	.wp-block-group.pfa-grid-2:has(> .is-style-card > .pfa-price-table) {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (min-width: 1024px) {
	.wp-block-group.pfa-grid.pfa-grid-2:has(> .is-style-card > .pfa-price-table) > .wp-block-group.is-style-card {
		display: grid;
		grid-template-columns: calc((100% + 2 * var(--pfa-space-6) - var(--pfa-split-gap)) * 5 / 12 - var(--pfa-space-6)) minmax(0, 1fr);
		grid-template-rows: auto auto 1fr;
		column-gap: var(--pfa-split-gap);
		align-items: start;
	}

	.wp-block-group.pfa-grid.pfa-grid-2:has(> .is-style-card > .pfa-price-table) > .wp-block-group.is-style-card > * {
		grid-column: 2;
		margin-block-start: 0;
	}

	.wp-block-group.pfa-grid.pfa-grid-2:has(> .is-style-card > .pfa-price-table) > .wp-block-group.is-style-card > h2 {
		grid-column: 1;
		grid-row: 1 / span 3;
	}

	.wp-block-group.pfa-grid.pfa-grid-2:has(> .is-style-card > .pfa-price-table) > .wp-block-group.is-style-card > * + * {
		margin-block-start: var(--pfa-space-4);
	}

	.wp-block-group.pfa-grid.pfa-grid-2:has(> .is-style-card > .pfa-price-table) > .wp-block-group.is-style-card > h2 + * {
		margin-block-start: 0;
	}
}

@media (min-width: 1024px) {
	.wp-block-group.pfa-grid-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.wp-block-group.pfa-grid-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Splits: two parts side by side from 900px. The gap is the split gap
   (base.css): 32px, 48px from 900px, 64px from 1200px. */
.wp-block-group.pfa-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--pfa-split-gap);
	align-items: center;
}

.wp-block-group.pfa-split-even,
.wp-block-group.pfa-split-aside,
.wp-block-group.pfa-split-form {
	align-items: start;
}

/* Photo and text at tablet width: a smaller portrait beside the text, so the
   photo no longer fills the screen above the heading (V32). Only when the
   photo comes first; with the text first the split stays one column. */
@media (min-width: 600px) and (max-width: 899.98px) {
	.pfa-split-image-text .wp-block-group.pfa-split:has(> .wp-block-image.pfa-photo-4x5:first-child) {
		grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
		gap: var(--pfa-space-6);
	}
}

@media (min-width: 900px) {
	.wp-block-group.pfa-split {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.wp-block-group.pfa-split-aside {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	}

	.wp-block-group.pfa-split-form {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	}
}

/* A split that follows a card grid in the same section is a new sub-topic:
   give it air (48px stacked, 64px once the split sits side by side). So is
   a reading part that opens with its own heading (London: "Going private
   with us" after the NHS area cards); a line that only adds to the grid
   stays close to it. */
.wp-block-group.pfa-grid + .wp-block-group.pfa-split,
.wp-block-group.pfa-grid + .wp-block-group.pfa-section__body:has(> .wp-block-heading:first-child) {
	margin-block-start: var(--pfa-space-7);
}

@media (min-width: 900px) {
	.wp-block-group.pfa-grid + .wp-block-group.pfa-split,
	.wp-block-group.pfa-grid + .wp-block-group.pfa-section__body:has(> .wp-block-heading:first-child) {
		margin-block-start: var(--pfa-space-8);
	}
}

/* Text in a split column keeps the reading measure. Below 900px a split is
   one column, and its text ran the full width (712px at 768) beside leads
   capped at 592px; from 900px the columns are narrower than the measure.
   Headings stay free, as in section heads; cards and callouts in a split
   keep their width. */
.wp-block-group.pfa-split > .wp-block-group:not([class*="is-style-"]) > :is(p, ul, ol) {
	max-width: var(--pfa-measure);
}

/* "Is this right for you?" (fit check), from 900px where the split has two
   columns: the two lists side by side ("It may suit you if" beside "... often
   come to us because of"), then the notes beside the "may not be the right
   place" callout. The callout used to sit alone top right, with the lists'
   whole height empty under it. The lists' group lends its children to the
   split's grid; the reading order in the page stays the same. */
@media (min-width: 900px) {
	.pfa-fit-check .wp-block-group.pfa-split {
		row-gap: 0;
		align-items: start;
	}

	.pfa-fit-check .wp-block-group.pfa-fit-check__suits {
		display: contents;
	}

	.pfa-fit-check .pfa-fit-check__suits > p:has(+ .is-style-ticks) {
		grid-column: 1;
		grid-row: 1;
	}

	.pfa-fit-check .pfa-fit-check__suits > .is-style-ticks {
		grid-column: 1;
		grid-row: 2;
	}

	.pfa-fit-check .pfa-fit-check__suits > p:has(+ .is-style-soft-bullets) {
		grid-column: 2;
		grid-row: 1;
		margin-block-start: 0;
	}

	.pfa-fit-check .pfa-fit-check__suits > .is-style-soft-bullets {
		grid-column: 2;
		grid-row: 2;
	}

	.pfa-fit-check .pfa-fit-check__suits > .is-style-soft-bullets ~ * {
		grid-column: 1;
	}

	.pfa-fit-check .pfa-fit-check__suits > .is-style-soft-bullets + * {
		margin-block-start: var(--pfa-space-6);
	}

	.pfa-fit-check .wp-block-group.pfa-split > .is-style-callout-note {
		grid-column: 2;
		grid-row: 3 / span 6;
		margin-block-start: var(--pfa-space-6);
	}

	/* A short ticks list beside a long list (autism pages: 3 ticks, 6
	   bullets): the long list spans two rows, so the notes follow the ticks
	   instead of starting under the long list (a 255-285px hole), and the
	   callout follows the long list. Not with four ticks (ADHD pages), where
	   the lists are about level and the callout stays beside the notes. */
	.pfa-fit-check:not(:has(.is-style-ticks > li:nth-child(4))) .wp-block-group.pfa-split {
		grid-template-rows: auto auto 1fr;
	}

	.pfa-fit-check:not(:has(.is-style-ticks > li:nth-child(4))) .pfa-fit-check__suits > .is-style-soft-bullets {
		grid-row: 2 / span 2;
	}

	.pfa-fit-check:not(:has(.is-style-ticks > li:nth-child(4))) .wp-block-group.pfa-split > .is-style-callout-note {
		grid-row: 4 / span 6;
	}
}

/* -------------------------------------------------------------------------
 * 3. Heroes
 * ---------------------------------------------------------------------- */

.wp-block-group.pfa-hero {
	box-sizing: border-box;
	padding-block: var(--pfa-space-6) var(--pfa-space-7);
}

.wp-block-group.pfa-hero__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--pfa-space-7);
	align-items: start;
}

.wp-block-group.pfa-hero__text > * {
	margin-block: 0;
}

.wp-block-group.pfa-hero__text > * + * {
	margin-block-start: var(--pfa-space-5);
}

.wp-block-group.pfa-hero__text > .is-style-pills + .wp-block-heading {
	margin-block-start: var(--pfa-space-5);
}

.wp-block-group.pfa-hero__text > .pfa-cta-note {
	margin-block-start: var(--pfa-space-3);
}

/* Plain hero paragraphs keep the measure, like the lead above them, and a
   callout under the hero text gets the body callout cap: below 1024px the
   hero is one column and both ran the full width. */
.wp-block-group.pfa-hero__text > p {
	max-width: var(--pfa-measure);
}

.wp-block-group.pfa-hero__grid > .wp-block-group[class*="is-style-callout-"] {
	max-width: calc(var(--pfa-measure) + 2 * var(--pfa-space-6));
}

.wp-block-heading.pfa-display {
	font-size: var(--pfa-fs-display);
	line-height: 1.05;
}

.wp-block-group.pfa-hero__art {
	display: grid;
	gap: var(--pfa-space-4);
	align-content: start;
}

.wp-block-group.pfa-hero__art > * {
	margin-block: 0;
}

/* Home: photo card and the "What happens next" card side by side, the same
   height (bento rule, brand p4 and p8); the photo fills its card. */
@media (min-width: 600px) {
	.wp-block-group.pfa-hero-home__art {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: stretch;
	}

	.pfa-hero-home .pfa-photo-card,
	.pfa-hero-home .pfa-photo-card > .wp-block-image,
	.pfa-hero-home .pfa-photo-card > .wp-block-image.pfa-photo img {
		height: 100%;
	}

	/* min-height too: the editor sets height: auto on the image inline. */
	.pfa-hero-home .pfa-photo-card > .wp-block-image.pfa-photo img {
		min-height: 100%;
		object-position: 50% 30%;
	}
}

@media (min-width: 1024px) {
	.wp-block-group.pfa-hero {
		padding-block: var(--pfa-space-8);
	}

	/* Equal columns with the split gap: the right column (In short card,
	   photo) lines up with the split columns and callouts below the hero. */
	.wp-block-group.pfa-hero__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--pfa-space-8) var(--pfa-split-gap);
		align-items: center;
	}

	/* The home hero has two cards beside its photo: one column until 1200px. */
	.wp-block-group.pfa-hero-home .pfa-hero__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--pfa-space-7);
	}

	/* A hero whose picture was removed keeps one readable column, on the
	   grid's left edge (the grid stays wide; only the track is capped). */
	.wp-block-group.pfa-hero__grid:has(> :only-child) {
		grid-template-columns: minmax(0, var(--pfa-measure));
	}

	/* Heroes whose picture column holds a card start from the top, so the
	   heading lines up with the top of the picture. */
	.wp-block-group.pfa-hero-service .pfa-hero__grid,
	.wp-block-group.pfa-hero-area .pfa-hero__grid,
	.wp-block-group.pfa-hero-hub .pfa-hero__grid {
		align-items: start;
	}
}

/* The home heading uses the display size, so its column is the wider one.
   The photo and the steps card stack beside it, from the top. */
@media (min-width: 1200px) {
	.wp-block-group.pfa-hero-home .pfa-hero__grid {
		grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
		align-items: start;
	}

	.wp-block-group.pfa-hero-home__art {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Urgent help on phones: the services follow the lead closely, so the first
   "Call 999" button is on the first screen of a small phone (360x640). */
@media (max-width: 767.98px) {
	.wp-block-group.pfa-hero.pfa-hero-urgent {
		padding-block-end: 0;
	}
}

/* -------------------------------------------------------------------------
 * 4. Photos, photo card and chip, glass art
 * Photos keep their shape whatever image an editor swaps in.
 * ---------------------------------------------------------------------- */

.wp-block-image.pfa-photo {
	margin: 0;
}

.wp-block-image.pfa-photo img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
}

.wp-block-image.pfa-photo-4x5 img {
	aspect-ratio: 4 / 5;
}

.wp-block-image.pfa-photo-3x2 img {
	aspect-ratio: 3 / 2;
}

/* The home photo card is shown wider and shorter (4:3) at every width, so it
   sits level with the steps card; the violet-band portrait only on phones. */
.pfa-hero-home .wp-block-image.pfa-photo-4x5 img {
	aspect-ratio: 4 / 3;
}

@media (max-width: 599px) {
	.pfa-violet-band .wp-block-image.pfa-photo-4x5 img {
		aspect-ratio: 4 / 3;
	}
}

.wp-block-group.pfa-photo-card {
	position: relative;
}

.wp-block-group.pfa-photo-card > * {
	margin-block: 0;
}

/* The tagline chip sits on a solid pill over the photo's lower edge. */
.wp-block-group.pfa-photo-card > .pfa-photo-chip {
	position: absolute;
	inset-block-end: var(--pfa-space-4);
	inset-inline-start: var(--pfa-space-4);
	z-index: 3;
	max-width: calc(100% - 2 * var(--pfa-space-4));
	margin: 0;
}

.wp-block-image.pfa-glass-art {
	box-sizing: border-box;
	margin: 0;
	padding: var(--pfa-space-6);
	border-radius: var(--pfa-radius-card);
	background: var(--pfa-lavender-wash) url("../images/brand/backgrounds/pfa-bg-serenity-640w.webp") center / cover no-repeat;
}

.wp-block-image.pfa-glass-art img {
	display: block;
	width: 100%;
	max-width: 26rem;
	height: auto;
	margin-inline: auto;
}

/* -------------------------------------------------------------------------
 * 5. Price lines and the In short box
 * ---------------------------------------------------------------------- */

.wp-block-group.pfa-price-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.125rem 0.4rem;
}

.wp-block-group.pfa-price-line.is-layout-flex {
	gap: 0.125rem 0.4rem;
	align-items: baseline;
}

.wp-block-group.pfa-price-line > * {
	margin: 0;
}

.pfa-price-line__amount {
	font-size: var(--pfa-fs-h3);
	font-weight: 700;
	font-variant-numeric: lining-nums;
	line-height: 1.2;
}

.pfa-price-line__label,
.pfa-price-line__note,
.pfa-price-stack__note {
	font-weight: 500;
}

.pfa-price-line-hero .pfa-price-line__amount {
	font-size: var(--pfa-fs-h2);
}

/* "ADHD assessments from £695, including your report.": the comma follows
   the amount with no gap (the note is a separate flex item, so a comma typed
   in it would sit a gap away). It takes the sentence's size and weight. No
   amount, no comma (the bound paragraph is removed when the price is
   missing). */
.pfa-price-line-hero .pfa-price-line__amount:has(+ .pfa-price-line__note)::after {
	content: ",";
	font-size: var(--pfa-fs-body);
	font-weight: 500;
}

p.pfa-price-line-ask {
	font-weight: 600;
}

/* Price lines stacked one under another (one line per price of a service, in
   an In short box or a card) sit close together, as one block. */
.wp-block-group.pfa-price-line + .wp-block-group.pfa-price-line {
	margin-block-start: var(--pfa-space-1);
}

/* The same in an In short value (group pfa-price-stack): the lines close
   together, then the note that closes the stack ("Each price is in total,
   including the report.") a little lower. Both note classes in use. */
.wp-block-group.pfa-price-stack > * {
	margin-block: 0;
}

.wp-block-group.pfa-price-stack > * + * {
	margin-block-start: var(--pfa-space-1);
}

.wp-block-group.pfa-price-stack > p:is(.pfa-price-line__note, .pfa-price-stack__note) {
	margin-block-start: var(--pfa-space-2);
}

/* In a stack, an amount-first line keeps its note beside the amount and the
   note wraps there, so the stack reads as an even list. A note that did not
   fit used to drop whole under its amount on some lines only. */
.wp-block-group.pfa-price-line.is-layout-flex:not(:has(> .pfa-price-line__label)):is(.pfa-price-stack > *, :has(+ .wp-block-group.pfa-price-line), .wp-block-group.pfa-price-line + *) {
	flex-wrap: nowrap;
}

.wp-block-group.pfa-price-line > .pfa-price-line__note {
	min-width: 0;
}

/* Label-first lines ("Adults, online £695 in total") where room is short:
   the label on its own line, then the amount and its note as one unit, as
   in the price table on phones. On phones in a stack, with 12px between
   entries, so each entry has one shape (the cost guide's In short); at
   1024-1199px in a reading section's right column (532px at 1024), where
   "per letter" was left alone under "Support letter ... £50". */
@media (max-width: 479px) {
	.wp-block-group.pfa-price-line:is(:has(+ .wp-block-group.pfa-price-line), .wp-block-group.pfa-price-line + .wp-block-group.pfa-price-line) > .pfa-price-line__label {
		flex-basis: 100%;
	}

	.wp-block-group.pfa-price-line:has(> .pfa-price-line__label) + .wp-block-group.pfa-price-line:has(> .pfa-price-line__label) {
		margin-block-start: var(--pfa-space-3);
	}
}

@media (min-width: 1024px) and (max-width: 1199.98px) {
	.wp-block-group.pfa-section__body > .wp-block-group.pfa-price-line > .pfa-price-line__label {
		flex-basis: 100%;
	}
}

/* A total line straight after a price table closes the table's card: no gap,
   square corners where they meet, and a Sapphire rule in line with the
   table's own padding (V51). The table keeps its round corners when the
   total is hidden for a missing price (section 11). */
.pfa-content > .pfa-price-table:has(+ .wp-block-group.pfa-price-line > .pfa-price-line__amount) {
	border-end-start-radius: 0;
	border-end-end-radius: 0;
}

.pfa-content > .pfa-price-table + .wp-block-group.pfa-price-line {
	--pfa-total-inset: var(--pfa-space-6);
	position: relative;
	margin-block-start: 0;
	padding: var(--pfa-space-4) var(--pfa-total-inset) var(--pfa-space-5);
	border-radius: 0 0 var(--pfa-radius-card) var(--pfa-radius-card);
	background: var(--pfa-arctic);
}

/* The rule is a pseudo-element, not a gradient background: contrast checkers read a
   gradient as the text's whole background. */
.pfa-content > .pfa-price-table + .wp-block-group.pfa-price-line::before {
	content: "";
	position: absolute;
	inset-block-start: 0;
	inset-inline: var(--pfa-total-inset);
	block-size: 2px;
	background: var(--pfa-sapphire);
}

/* The table is padded 24px at the sides on phones (price-table style.css). */
@media (max-width: 499px) {
	.pfa-content > .pfa-price-table + .wp-block-group.pfa-price-line {
		--pfa-total-inset: var(--pfa-space-5);
	}
}

/* Facts: label and value rows (In short box, company details). */
.wp-block-group.pfa-facts {
	display: grid;
	margin-block: var(--pfa-space-3) 0;
}

.wp-block-group.pfa-fact {
	display: grid;
	grid-template-columns: 5.5rem minmax(0, 1fr);
	gap: var(--pfa-space-1) var(--pfa-space-4);
	align-items: baseline;
	margin: 0;
	padding-block: var(--pfa-space-3);
}

/* Lines between rows (a hidden last row leaves no line behind). */
.wp-block-group.pfa-fact + .wp-block-group.pfa-fact {
	border-block-start: 1px solid var(--pfa-rule, var(--pfa-border));
}

.wp-block-group.pfa-fact > * {
	margin: 0;
}

.pfa-fact__label {
	font-size: var(--pfa-fs-small);
	font-weight: 600;
}

.wp-block-group.pfa-fact-wait {
	grid-template-columns: minmax(0, 1fr);
}

/* Company and registration facts have longer labels. */
.wp-block-group.pfa-facts-card .wp-block-group.pfa-fact {
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 480px) {
	.wp-block-group.pfa-facts-card .wp-block-group.pfa-fact {
		grid-template-columns: 9.5rem minmax(0, 1fr);
	}
}

.wp-block-group.pfa-in-short > .wp-block-buttons {
	margin-block-start: var(--pfa-space-5);
}

/* Narrow phones: the card keeps the 24px padding of every card, and each
   fact reads label above value, so values get the card's whole width
   instead of wrapping beside the 5.5rem label column. */
@media (max-width: 479px) {
	.wp-block-group.pfa-in-short .wp-block-group.pfa-fact {
		grid-template-columns: minmax(0, 1fr);
	}
}

.wp-block-group.pfa-in-short > .pfa-cta-note {
	margin-block-start: var(--pfa-space-3);
}

p.pfa-address {
	font-weight: 600;
	white-space: pre-line;
}

/* Card padding comes from core-group.css, which loads after this file. */
@media (min-width: 1024px) {
	.wp-block-group.pfa-hero__grid > .wp-block-group.is-style-card.pfa-in-short {
		padding: var(--pfa-space-7);
	}
}

/* -------------------------------------------------------------------------
 * 6. Cards
 * ---------------------------------------------------------------------- */

/* Cards whose link sits at the bottom, so links line up across a row. */
.wp-block-group:is(.pfa-service-card, .pfa-path-card) {
	display: flex;
	flex-direction: column;
	gap: var(--pfa-space-3);
}

.wp-block-group:is(.pfa-service-card, .pfa-path-card) > * {
	margin-block: 0;
}

.wp-block-group:is(.pfa-service-card, .pfa-path-card) > .pfa-card-link {
	margin-block-start: auto;
	padding-block-start: var(--pfa-space-2);
}

/* Price lines stacked in these cards sit 4px apart, as everywhere (section
   5): the card's 12px gap less 8px. */
.wp-block-group:is(.pfa-service-card, .pfa-path-card) > .wp-block-group.pfa-price-line + .wp-block-group.pfa-price-line {
	margin-block-start: calc(var(--pfa-space-1) - var(--pfa-space-3));
}

.wp-block-group.pfa-service-card > .wp-block-heading,
.wp-block-group.pfa-path-card > .wp-block-heading {
	font-size: var(--pfa-fs-h3);
}

/* Assessment price cards (a heading, a line and a price table, like the
   medication costs card) end with their link too: side by side, the cards
   share a height and their links line up. The card keeps its own spacing. */
.wp-block-group.pfa-assessment-prices {
	display: flex;
	flex-direction: column;
}

.wp-block-group.pfa-assessment-prices > .pfa-card-link {
	margin-block-start: auto;
	padding-block-start: var(--pfa-space-5);
}

/* The follow-up price card above the callout in "Your report" (after your
   diagnosis): 32px inside from 768px, as other cards, so its text lines up
   with the callout's (it kept the compact card's 24px, 13px out of line). */
@media (min-width: 768px) {
	.wp-block-group.pfa-after-report__aside > .pfa-price-card--compact {
		padding: var(--pfa-space-6);
	}
}

.wp-block-group.pfa-path-card-small {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--pfa-space-2) var(--pfa-space-4);
}

.wp-block-group.pfa-path-card-small > .pfa-card-link {
	margin-block-start: 0;
	padding-block-start: 0;
}

/* The small path cards sit one grid gap under the main ones (16px, 24px
   from 768px, section 2). */
.wp-block-group.pfa-path-cards__small {
	margin-block-start: var(--pfa-space-4);
}

@media (min-width: 768px) {
	.wp-block-group.pfa-path-cards__small {
		margin-block-start: var(--pfa-space-5);
	}
}

.wp-block-details.pfa-route-finder-toggle {
	margin-block-start: var(--pfa-space-5);
}

/* Trust tiles: icon, bold line, short text. 24px inside at every width, as
   other cards on phones (they stay at 24px from 768px, where cards get 32px). */
.wp-block-group.is-style-card.pfa-trust-tile {
	padding: var(--pfa-space-5);
}

.wp-block-group.pfa-trust-tile > * {
	margin-block: 0;
}

.wp-block-group.pfa-trust-tile > * + * {
	margin-block-start: var(--pfa-space-2);
}

.wp-block-image.pfa-trust-tile__icon {
	margin-block-end: var(--pfa-space-3);
}

.wp-block-image.pfa-trust-tile__icon img {
	display: block;
	width: 2.5rem;
	height: 2.5rem;
}

.wp-block-group.pfa-trust-tile p {
	font-size: var(--pfa-fs-small);
}

.wp-block-group.pfa-trust-tile .pfa-trust-tile__title {
	font-size: var(--pfa-fs-body);
	line-height: 1.35;
}

/* The CQC badge in a tile (V34): its title, spacing and link match the
   other tiles (the title is already Bold, like their <strong>). */
.wp-block-group.pfa-trust-tile .pfa-cqc__title {
	font-size: var(--pfa-fs-body);
	line-height: 1.35;
}

.wp-block-group.pfa-trust-tile .pfa-cqc__since {
	margin-block-start: var(--pfa-space-2);
}

.wp-block-group.pfa-trust-tile :is(.pfa-cqc__more, .pfa-cqc__link) {
	font-weight: 400;
}

@media (min-width: 768px) {
	.wp-block-image.pfa-trust-tile__icon img {
		width: 3rem;
		height: 3rem;
	}
}

/* Trust strip (pattern trust-strip, in the home hero under the buttons):
   three short facts, each a duotone icon (as the trust tiles), a bold line
   and a note or a "go" link. No card and no pills: a hairline above, then
   the facts. The reviews fact and the fact it replaces are printed by
   pfa_trust_strip_reviews_gate() (inc/patterns.php), so there are always
   three. Phones: one fact per row, icon on the left. */
.wp-block-group.pfa-hero__text > .pfa-trust-strip {
	margin-block-start: var(--pfa-space-5);
	padding-block-start: var(--pfa-space-4);
	border-block-start: 1px solid var(--pfa-rule);
}

.wp-block-group.pfa-trust-strip {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--pfa-space-3);
}

.wp-block-group.pfa-trust-strip__item {
	display: grid;
	grid-template-columns: 2rem minmax(0, 1fr);
	column-gap: var(--pfa-space-3);
	align-content: start;
}

.wp-block-group.pfa-trust-strip > *,
.wp-block-group.pfa-trust-strip__item > * {
	margin: 0;
}

.wp-block-group.pfa-trust-strip__item > * {
	grid-column: 2;
}

.wp-block-image.pfa-trust-strip__icon {
	grid-column: 1;
	grid-row: 1 / span 2;
}

.wp-block-image.pfa-trust-strip__icon img {
	display: block;
	width: 2rem;
	height: 2rem;
}

.wp-block-group.pfa-trust-strip p {
	font-size: var(--pfa-fs-label);
	line-height: 1.35;
}

/* The second line: a note in the muted ink, or a "go" link (section 9). The
   link keeps its 44px target; negative margins pull the target up and down
   so its words sit straight under the bold line and the row does not grow. */
.wp-block-group.pfa-trust-strip p:not(.pfa-trust-strip__title) {
	color: var(--pfa-text-muted, var(--pfa-ink-muted));
}

.wp-block-group.pfa-trust-strip p.pfa-link-only {
	margin-block: calc((var(--pfa-target) - 1.35em) / -2);
}

/* The words sit one half-gap inside the target at the top and bottom (what
   centring gives a one-line link, still 44px), so a link that wraps grows
   downwards: centred, its two lines rose into the bold line above and ran
   out of the strip below (1200-1225px). */
.wp-block-group.pfa-trust-strip p.pfa-link-only > a {
	align-items: flex-start;
	padding-block: calc((var(--pfa-target) - 1.35em) / 2);
	color: var(--pfa-link);
	font-weight: 600;
}

.wp-block-group.pfa-trust-strip p.pfa-link-only > a .pfa-arrow-tail::after {
	width: 1rem;
	height: 1rem;
	margin-inline-start: 0.25rem;
	vertical-align: -0.2em;
}

/* From 768px: the facts side by side in equal columns, the icon above the
   words, so each line fits the home hero's 651px text column at 1440
   ("Registered with the CQC" on one line) and the strip ends above the
   900px fold. */
@media (min-width: 768px) {
	.wp-block-group.pfa-trust-strip {
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
		gap: var(--pfa-space-4) var(--pfa-space-5);
	}

	.wp-block-group.pfa-trust-strip__item {
		grid-template-columns: minmax(0, 1fr);
		row-gap: var(--pfa-space-2);
	}

	.wp-block-group.pfa-trust-strip__item > *,
	.wp-block-image.pfa-trust-strip__icon {
		grid-column: 1;
		grid-row: auto;
	}

	.wp-block-image.pfa-trust-strip__icon img {
		width: 1.75rem;
		height: 1.75rem;
	}

	.wp-block-group.pfa-trust-strip__item > .pfa-trust-strip__title + * {
		margin-block-start: calc(var(--pfa-space-2) * -1);
	}

	.wp-block-group.pfa-trust-strip__item > .pfa-trust-strip__title + p.pfa-link-only {
		margin-block-start: calc((var(--pfa-target) - 1.35em) / -2 - var(--pfa-space-2));
	}
}

@media (forced-colors: active) {
	.wp-block-group.pfa-hero__text > .pfa-trust-strip {
		border-block-start-color: CanvasText;
	}
}

/* What happens next: compact numbered steps. The top padding (half of the
   2rem square less half the line height) puts the first line on the middle
   of its number square; the li stays a list item, so bold words and links
   keep flowing. */
.wp-block-list.is-style-steps.pfa-steps-compact > li {
	min-height: 2rem;
	padding-block-start: calc(1rem - 0.7em);
	padding-inline-start: 2.75rem;
	font-weight: 500;
	line-height: 1.4;
}

.wp-block-list.is-style-steps.pfa-steps-compact > li + li {
	margin-block-start: var(--pfa-space-3);
}

.wp-block-list.is-style-steps.pfa-steps-compact > li::before {
	width: 2rem;
	height: 2rem;
	border-radius: 8px;
	font-size: 0.875rem;
}

/* No joining line: between squares this close it showed as a stray dash. */
.wp-block-list.is-style-steps.pfa-steps-compact > li:not(:last-child)::after {
	display: none;
}

.wp-block-group.pfa-next-steps > .wp-block-list {
	margin-block-end: 0;
}

/* The medication costs card never shows a button (UX D13). */
.wp-block-group.pfa-medication-costs > * {
	margin-block-end: 0;
}

/* Its intro keeps the measure when the card runs wide (one column up to
   1023px); the table keeps the card's width. */
.wp-block-group.pfa-medication-costs > p {
	max-width: var(--pfa-measure);
}

/* -------------------------------------------------------------------------
 * 7. Step tiles (B8): Turquoise tiles with a large number
 * ---------------------------------------------------------------------- */

.wp-block-list.pfa-steps-tiles {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--pfa-space-3);
	margin: 0;
	padding: 0;
	list-style-type: "\200B";
	counter-reset: pfa-tile;
}

.wp-block-list.pfa-steps-tiles > li {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: var(--pfa-space-1);
	min-height: 9rem;
	margin: 0;
	padding: var(--pfa-space-5);
	border: 1px solid transparent;
	border-radius: var(--pfa-radius-card);
	background-color: var(--pfa-turquoise);
	color: var(--pfa-sapphire);
	font-size: var(--pfa-fs-small);
	line-height: 1.4;
	counter-increment: pfa-tile;
}

.wp-block-list.pfa-steps-tiles > li::before {
	content: counter(pfa-tile, decimal-leading-zero);
	content: counter(pfa-tile, decimal-leading-zero) / "";
	margin-block-end: var(--pfa-space-3);
	font-size: 2.25rem;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.wp-block-list.pfa-steps-tiles > li > strong:first-child {
	font-size: var(--pfa-fs-body);
	line-height: 1.3;
}

/* Narrow phones: one tile per row, the number beside the words (as the trust
   tiles on phones). Half a phone's width less the 24px padding of every card
   left about 118px, narrower than "Questionnaires" in the label. */
@media (max-width: 479px) {
	.wp-block-list.pfa-steps-tiles {
		grid-template-columns: minmax(0, 1fr);
	}

	.wp-block-list.pfa-steps-tiles > li {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		gap: var(--pfa-space-1) var(--pfa-space-3);
		align-content: start;
		min-height: 0;
	}

	.wp-block-list.pfa-steps-tiles > li::before {
		grid-row: 1 / span 2;
		margin-block-end: 0;
	}
}

@media (min-width: 768px) {
	.wp-block-list.pfa-steps-tiles {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: var(--pfa-space-4);
	}
}

/* From 1200px: one row when there are up to five. Six stay two rows of
   three: six across left each tile 187px, too narrow for its words. */
@media (min-width: 1200px) {
	.wp-block-list.pfa-steps-tiles:not(:has(> li:nth-child(6))) {
		grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
	}
}

.wp-block-group.pfa-steps-tiles-wrap {
	margin-block: 0 var(--pfa-space-5);
}

/* -------------------------------------------------------------------------
 * 8. Bands
 * ---------------------------------------------------------------------- */

/* Statement band: one big line on Royal Sapphire. */
.wp-block-heading.pfa-statement-band__title {
	font-size: var(--pfa-fs-display);
	line-height: 1.08;
}

.wp-block-group.pfa-statement-band > .is-style-lead {
	margin-block-start: var(--pfa-space-5);
}

/* Violet band: Iris Violet panel with text and a photo. */
.wp-block-group.pfa-violet-band__panel {
	gap: var(--pfa-space-6);
}

.wp-block-group.pfa-violet-band__text > * {
	margin-block: 0;
}

.wp-block-group.pfa-violet-band__text > * + * {
	margin-block-start: var(--pfa-space-5);
}

@media (min-width: 900px) {
	.wp-block-group.is-style-card-iris.pfa-violet-band__panel {
		padding: var(--pfa-space-8);
	}
}

/* Next step band. */
.wp-block-group.pfa-next-step-band__inner > * {
	max-width: var(--pfa-measure);
	margin-block: 0;
}

.wp-block-group.pfa-next-step-band__inner > * + * {
	margin-block-start: var(--pfa-space-5);
}

.wp-block-group.pfa-next-step-band__inner > .pfa-tagline + .wp-block-heading {
	margin-block-start: var(--pfa-space-3);
}

.wp-block-group.pfa-next-step-band__inner > .pfa-cta-note {
	margin-block-start: var(--pfa-space-3);
}

/* Tagline label: Soft Lavender on Royal Sapphire (4.78:1, small label). */
p.pfa-tagline {
	color: var(--pfa-em, currentColor);
	font-size: var(--pfa-fs-label);
	font-weight: 600;
	letter-spacing: 0.02em;
}

/* Route-finder band. */
.wp-block-group.pfa-route-finder-section__intro > :first-child {
	margin-block-start: 0;
}

.wp-block-group.pfa-route-finder-card {
	min-height: 18rem;
}

/* The route finder, cost estimator and callback form draw their own card.
   Inside a theme card or the hub toggle they use the wrapper's padding
   instead, so the content is not inset twice. Descendant, not child, so the
   editor preview (extra block wrappers) matches the site. */
.wp-block-group.is-style-card:is(.pfa-route-finder-card, .pfa-estimator-card, .pfa-callback-card) :is(.pfa-route-finder, .pfa-cost-estimator, .pfa-callback-form),
.wp-block-details.pfa-route-finder-toggle .pfa-route-finder {
	padding: 0;
	border-radius: 0;
	background: none;
}

/* -------------------------------------------------------------------------
 * 9. Small text: notes, honesty line, small print, inline links
 * ---------------------------------------------------------------------- */

p.pfa-cta-note,
p.pfa-small-print {
	color: var(--pfa-text-muted, var(--pfa-ink-muted));
	font-size: var(--pfa-fs-small);
	line-height: 1.55;
}

/* The outcome honesty line (an assessment may or may not lead to a diagnosis). */
p.pfa-honesty-line {
	max-width: var(--pfa-measure);
	font-weight: 600;
}

p.pfa-inline-links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--pfa-space-2) var(--pfa-space-5);
}

p.pfa-inline-links a {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	font-weight: 600;
}

/* A paragraph that is only a link (class added by inc/patterns.php): a 44px
   target, SemiBold like the other "go" links. */
p.pfa-link-only > a {
	display: inline-flex;
	align-items: center;
	min-height: var(--pfa-target);
	font-weight: 600;
}

/* Its page is not published yet, so the integrity module printed the words
   without the link: alone on a line they read as a broken link. Hidden until
   the page is live; inside a sentence the words stay. */
p.pfa-link-only:has(> .pfa-link-pending:only-child) {
	display: none;
}

/* The "go" arrow of the text-arrow button (core-button.css, which loads only
   with a Button block, hence the mask here too). inc/patterns.php keeps the
   last word and the arrow together, so the arrow never sits alone on a line.
   Scoped to the link: a link to a draft page prints plain words, no arrow. */
p.pfa-link-only {
	--pfa-mask-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
}

p.pfa-link-only > a .pfa-arrow-tail {
	white-space: nowrap;
}

p.pfa-link-only > a .pfa-arrow-tail::after {
	content: "";
	display: inline-block;
	width: 1.25rem;
	height: 1.25rem;
	margin-inline-start: 0.375rem;
	vertical-align: -0.3em;
	background-color: currentColor;
	-webkit-mask: var(--pfa-mask-arrow) center / contain no-repeat;
	mask: var(--pfa-mask-arrow) center / contain no-repeat;
}

@media (forced-colors: active) {
	p.pfa-link-only > a .pfa-arrow-tail::after {
		forced-color-adjust: none;
		background-color: LinkText;
	}
}

/* Plain cards in a grid that end with such a link: the link sits on the
   card's bottom edge, so the links in a row line up (as in service cards). */
.wp-block-group.pfa-grid > .wp-block-group[class*="is-style-card"]:has(> p.pfa-link-only:last-child) {
	display: flex;
	flex-direction: column;
}

.wp-block-group.pfa-grid > .wp-block-group[class*="is-style-card"] > p.pfa-link-only:last-child {
	margin-block-start: auto;
	padding-block-start: var(--pfa-space-3);
}

.wp-block-list.pfa-sources {
	font-size: var(--pfa-fs-small);
}

/* Guides: "Sources" is reference matter, so a smaller heading under a line,
   and the citations in secondary ink; links keep the link colours (V33). */
.pfa-guide__body .pfa-content > h2:has(+ .pfa-sources) {
	padding-block-start: var(--pfa-space-6);
	border-block-start: 1px solid var(--pfa-border);
	font-size: var(--pfa-fs-h4);
	letter-spacing: 0;
	line-height: 1.3;
}

.pfa-guide__body .wp-block-list.pfa-sources > li {
	color: var(--pfa-ink-muted);
}

/* -------------------------------------------------------------------------
 * 10. Line-art decoration (B6) on cards and bands
 * Decorative and behind the content. It never crosses text: on a card it sits
 * in space kept free at the bottom; on a band it only shows from 1200px,
 * where the reading column leaves the right-hand side empty. On a text-only
 * hero it shows whole, from 1200px, to the right of the reading column.
 * ---------------------------------------------------------------------- */

.wp-block-group.pfa-line-art {
	position: relative;
	isolation: isolate;
	overflow: hidden;
}

.wp-block-group.pfa-line-art::after {
	content: "";
	position: absolute;
	z-index: -1;
	display: none;
	aspect-ratio: 488.57 / 420.99;
	background-color: var(--pfa-line-art, color-mix(in srgb, var(--pfa-lavender) 75%, transparent));
	-webkit-mask: url("../images/brand/line-art/pfa-line-art.svg?v=2") center / contain no-repeat;
	mask: url("../images/brand/line-art/pfa-line-art.svg?v=2") center / contain no-repeat;
	pointer-events: none;
}

/* Cards: the mark sits in the lower corner, in space kept free for it. */
@media (min-width: 768px) {
	.wp-block-group.is-style-card-sapphire.pfa-line-art {
		padding-block-end: calc(var(--pfa-space-6) + 6.5rem);
	}

	/* Plain cards in the same row that end with a link (section 9) keep the
	   same space free, so their links line up with the line-art card's link.
	   Specific enough to beat core-group.css card padding, which loads later. */
	.wp-block-group.pfa-grid:has(> .is-style-card-sapphire.pfa-line-art) > .wp-block-group[class*="is-style-card"]:not(.pfa-line-art):has(> p.pfa-link-only:last-child) {
		padding-block-end: calc(var(--pfa-space-6) + 6.5rem);
	}

	.wp-block-group.is-style-card-sapphire.pfa-line-art::after {
		display: block;
		inset-block-end: -1.25rem;
		inset-inline-end: -0.75rem;
		width: 9rem;
	}
}

/* Bands: a larger mark to the right; the text keeps to the left 58%. */
@media (min-width: 1200px) {
	.wp-block-group:is(.is-style-band-sapphire, .is-style-band-lavender).pfa-line-art::after {
		display: block;
		inset-block-end: -14%;
		inset-inline-end: 3%;
		width: min(26rem, 32%);
	}

	.wp-block-group:is(.is-style-band-sapphire, .is-style-band-lavender).pfa-line-art :is(.pfa-section__body, .pfa-next-step-band__inner) > * {
		max-width: min(var(--pfa-measure), 58%);
	}
}

/* Text-only heroes (not urgent help): the whole mark, scaled to the hero's
   height and lined up with the wide column's right edge. No crop: the hero
   has no visible edge to crop against (V58). */
@media (min-width: 1200px) {
	.wp-block-group.pfa-hero:not(.pfa-hero-urgent):has(.pfa-hero__grid > :only-child) {
		position: relative;
		isolation: isolate;
	}

	.wp-block-group.pfa-hero:not(.pfa-hero-urgent):has(.pfa-hero__grid > :only-child)::after {
		content: "";
		position: absolute;
		z-index: -1;
		inset-block: var(--pfa-space-6);
		inset-inline-end: max(var(--pfa-gutter), calc((100% - var(--pfa-wide)) / 2));
		inline-size: 20rem;
		background-color: color-mix(in srgb, var(--pfa-lavender) 60%, transparent);
		-webkit-mask: url("../images/brand/line-art/pfa-line-art.svg?v=2") right center / contain no-repeat;
		mask: url("../images/brand/line-art/pfa-line-art.svg?v=2") right center / contain no-repeat;
		pointer-events: none;
	}
}

@media (forced-colors: active) {
	.wp-block-group.pfa-line-art::after {
		display: none;
	}
}

/* -------------------------------------------------------------------------
 * 11. Empty states (site only; the editor always shows the blocks)
 * A block that has nothing to show yet prints nothing, so its heading and
 * frame are hidden too: no clinicians published, fewer than three reviews,
 * no guides, no wait set, or a price that is not in the price list.
 * ---------------------------------------------------------------------- */

.wp-block-group.pfa-clinicians-section:not(:has(.pfa-clinicians-section__list > *)),
.wp-block-group.pfa-reviews-section:not(:has(.pfa-reviews-section__list > *)),
.wp-block-group.pfa-guides-section:not(:has(.pfa-guides-section__list > *)),
.wp-block-group.pfa-fact-wait:not(:has(*)) {
	display: none;
}

.wp-block-group.pfa-price-line:has(.pfa-price-line__note):not(:has(.pfa-price-line__amount)),
.wp-block-group.pfa-fact:has(.pfa-price-line__note):not(:has(.pfa-price-line__amount)) {
	display: none;
}

/* Integration fixes (19 Oct 2026) ------------------------------------------------ */

/* Price rows (V04). Cards take their own height (the plugin sets height: 100%,
   which stretched short cards into tall empty boxes); each row layout below
   decides how the cards share a row. */
.pfa-price-cards .pfa-grid > .pfa-price-card {
	height: auto;
}

/* Home (two price cards + medication card): the pair side by side, the
   medication card on its own full row, so it is never orphaned at 768px.
   Rows that open with a full card, or with an assessment price card and the
   follow-up card (ADHD hub and service pages), are laid out below. */
@media (min-width: 768px) {
	.pfa-price-cards .pfa-grid-3:not(:has(> .pfa-price-card--full, > .pfa-assessment-prices + .pfa-price-card--compact)) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: stretch;
	}

	.pfa-price-cards .pfa-grid-3:not(:has(> .pfa-price-card--full, > .pfa-assessment-prices + .pfa-price-card--compact)) > .pfa-medication-costs {
		grid-column: 1 / -1;
	}
}

/* Tablets: the home page's two assessment price cards stack until 1024px, as the ADHD hub rows do,
   so each price table has room for its names on one line. */
@media (min-width: 768px) and (max-width: 1023.98px) {
	.pfa-price-cards .pfa-grid-3:not(:has(> .pfa-price-card--full, > .pfa-assessment-prices + .pfa-price-card--compact)) {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* That full-row medication card, from 1024px: the heading and intro on the
   left, the table on the right, on the FAQ sections' lines, so each service
   sits near its price (across the whole row they were 850px apart). The
   last row takes any extra height, so the intro stays under its heading. */
@media (min-width: 1024px) {
	.pfa-price-cards .pfa-grid-3:not(:has(> .pfa-price-card--full, > .pfa-assessment-prices + .pfa-price-card--compact)) > .pfa-medication-costs {
		display: grid;
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		grid-template-rows: auto auto 1fr;
		column-gap: var(--pfa-split-gap);
		align-items: start;
	}

	.pfa-price-cards .pfa-grid-3:not(:has(> .pfa-price-card--full, > .pfa-assessment-prices + .pfa-price-card--compact)) > .pfa-medication-costs > * {
		grid-column: 1;
	}

	.pfa-price-cards .pfa-grid-3:not(:has(> .pfa-price-card--full, > .pfa-assessment-prices + .pfa-price-card--compact)) > .pfa-medication-costs > .pfa-price-table {
		grid-column: 2;
		grid-row: 1 / -1;
		margin-block-start: 0;
	}
}

/* 600 to 767px: price rows stay one column; two cards side by side would be
   too narrow for the booking button. Same specificity as the pfa-grid-3 rule
   in section 2, so it stays after it. */
@media (min-width: 600px) and (max-width: 767.98px) {
	.pfa-price-cards .pfa-grid-3 {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ADHD hub and service pages (a full card, or an assessment price card, then
   the follow-up card and the medication card), and a full card beside the
   medication card: one column to 1023px. */
@media (min-width: 600px) and (max-width: 1023.98px) {
	.pfa-price-cards .pfa-grid-3:has(> .pfa-price-card--full, > .pfa-assessment-prices + .pfa-price-card--compact),
	.pfa-price-cards .pfa-grid-2:has(> .pfa-medication-costs) {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* From 1024px: the first card with the follow-up card under it, and the
   medication card beside both, so the two columns end level. (Stretched
   beside the medication card on its own, the full card ended with 140-172px
   of empty card.) */
@media (min-width: 1024px) {
	.pfa-price-cards .pfa-grid-3:has(> .pfa-price-card--full, > .pfa-assessment-prices + .pfa-price-card--compact) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: stretch;
	}

	.pfa-price-cards .pfa-grid-3:has(> .pfa-price-card--full, > .pfa-assessment-prices + .pfa-price-card--compact) > .pfa-medication-costs {
		grid-column: 2;
		grid-row: 1 / span 2;
	}
}

/* Autism hub and service pages (adult full card + child compact card): one
   column to 1023px, as the ADHD rows (in a 2fr column the child card, now
   the taller one, was 275px wide at 768px and its button lost its arrow).
   From 1024px two equal columns of one height: the cards end level and
   their links, pinned to the bottom (plugin), line up. */
@media (min-width: 768px) and (max-width: 1023.98px) {
	.pfa-price-cards .pfa-grid-2:has(> .pfa-price-card--full):has(> .pfa-price-card--compact) {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (min-width: 1024px) {
	.pfa-price-cards .pfa-grid-2:has(> .pfa-price-card--full):has(> .pfa-price-card--compact) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-items: stretch;
	}
}

/* A price table placed inside a card or callout is part of it: no second card
   background or padding, so the table gets the full width of the box (V13). */
:is(.is-style-card, .pfa-card, .pfa-price-card, .wp-block-group[class*="is-style-callout-"]) .pfa-price-table {
	padding: 0;
	border-radius: 0;
	background: transparent;
}

/* In a narrow card or callout, the price column takes only the room it needs.
   The summary has its own full-width row (plugin render.php). */
:is(.is-style-card, .pfa-card, .wp-block-group[class*="is-style-callout-"]) .pfa-price-table__price {
	min-width: 0;
	white-space: nowrap;
}

/* The unit is one short line under the amount ("per appointment"); the
   on-request text ("Ask us for the current price") may wrap. */
.pfa-price-table__price .pfa-price__unit {
	white-space: nowrap;
}

.pfa-price-table__price .pfa-price__ask {
	white-space: normal;
}
