/*
 * Component styles.
 *
 * Lives here rather than in theme.json's `styles.css` because that is a single
 * JSON string: every change shows as one modified line, which defeats the
 * repo's diffability rule and made it impossible to split across commits.
 *
 * theme.json still owns every design *token* (colours, type, spacing). This
 * file only styles components that core blocks cannot express, and it consumes
 * those tokens through var(--wp--preset--*) so a restyle is still a theme.json
 * edit. Plain CSS, no build step.
 *
 * Loaded on the front end and in the editor — see inc/setup.php.
 */

.wplb-mobile-cta {
	display: none;
}

@media (max-width:600px) {
	body {
		padding-bottom: 5rem;
	}
	.wplb-mobile-cta {
		display: block;
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 100;
		padding: 0.5rem;
		padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
		background-color: var(--wp--preset--color--light);
		box-shadow: 0 -2px 12px rgba(0,0,0,0.12);
	}
	.wplb-mobile-cta .wp-block-buttons {
		display: flex;
		gap: 0.5rem;
		margin: 0;
	}
	.wplb-mobile-cta .wp-block-button {
		flex: 1;
		margin: 0;
	}
	.wplb-mobile-cta .wp-block-button__link {
		display: block;
		text-align: center;
	}
}

.wplb-icon {
	display: block;
}

/*
 * Service card icons as a medallion rather than a bare glyph: a tinted panel
 * gives the icon presence and ties it to the palette, and the card hover
 * inverts it so the whole card reads as one object.
 *
 * Scoped to the direct child deliberately. .wplb-card is shared with
 * testimonials, whose stars sit inside .wplb-stars — this leaves them, the
 * footer contact icons and the trust badges exactly as they were.
 *
 * The glyph stays 32px: the badge is 56px with 12px of padding, so nothing
 * about the icons themselves changes. Corner shape comes from a token each
 * style variation overrides — square in Craft, round in Care — because a fixed
 * radius here would fight two of the three.
 */
.wplb-card>.wplb-icon {
	box-sizing: border-box;
	width: 3.5rem;
	height: 3.5rem;
	padding: 0.75rem;
	border-radius: var(--wp--custom--icon-badge-radius, 12px);
	color: var(--wp--preset--color--light);
	background: var(--wp--preset--color--primary);
}

/*
 * Hover borrows the button's own state — accent panel, dark glyph — so a card
 * and a CTA behave the same way under the cursor instead of each inventing a
 * language. Solid fills, not a tint: the card sits on `muted`, and a 10%
 * primary wash measured 1.05:1 against it, i.e. invisible.
 */
.wplb-card:hover>.wplb-icon {
	color: var(--wp--preset--color--dark);
	background: var(--wp--preset--color--accent);
}

:where(a,.wp-element-button):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/*
 * CTA presence. These buttons carry the conversions, so they get depth at rest,
 * a deeper shadow on hover and a real press on click — the difference between a
 * coloured rectangle and something that looks pressable.
 *
 * The shadow is a neutral tint rather than a palette colour so it holds under
 * every style variation, and it is never a focus indicator: that stays with the
 * :focus-visible rule above, which a shadow must not replace.
 */
.wp-element-button {
	box-shadow: 0 1px 2px rgb(0 0 0 / 12%), 0 3px 10px rgb(0 0 0 / 10%);
}

.wp-element-button:hover {
	box-shadow: 0 2px 4px rgb(0 0 0 / 14%), 0 10px 24px rgb(0 0 0 / 20%);
}

.wp-element-button:active {
	box-shadow: 0 1px 2px rgb(0 0 0 / 16%);
}

/*
 * Outline CTAs stay visibly secondary — no shadow, since depth on a
 * transparent button reads as a mistake — then fill like the primary on
 * hover, so the pair is a clear first and second choice.
 *
 * `a.wp-element-button` on purpose: core wraps its outline rule in :where(),
 * which contributes no specificity, but the pattern markup is hand-written and
 * an element selector keeps this winning even if a class is added there later.
 */
.wp-block-button.is-style-outline a.wp-element-button {
	border-width: 2px;
	box-shadow: none;
	/*
	 * Core's outline style does not just add a border — it replaces the padding
	 * theme.json set with its own em-based values, so an outline CTA renders a
	 * different height from the filled one beside it (measured 60px vs 64px).
	 * Restore the theme's padding, less the border, so both have the same outer
	 * height whatever the spacing scale is set to.
	 */
	padding: calc(var(--wp--preset--spacing--30) - 2px) calc(var(--wp--preset--spacing--50) - 2px);
}

.wp-block-button.is-style-outline a.wp-element-button:hover,
.wp-block-button.is-style-outline a.wp-element-button:focus {
	border-color: var(--wp--preset--color--accent);
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--dark);
}

/*
 * On a dark section the outline CTA takes the accent on its label and border
 * instead of filling: a solid accent panel is the primary CTA's job, and
 * repeating it makes the secondary shout as loudly as the primary.
 *
 * Scoped by .has-light-color — an outline button inheriting light text is on a
 * dark background by definition. Not applied everywhere on purpose: against a
 * light section accent-on-background measures about 2:1, so there the fill
 * above stays, which is legible at 7.6:1.
 */
.has-light-color .wp-block-button.is-style-outline a.wp-element-button:hover,
.has-light-color .wp-block-button.is-style-outline a.wp-element-button:focus {
	border-color: var(--wp--preset--color--accent);
	background-color: transparent;
	color: var(--wp--preset--color--accent);
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
	.wp-element-button {
		transition: transform .15s ease,background-color .15s ease,box-shadow .15s ease,border-color .15s ease;
	}
	.wp-element-button:hover {
		transform: translateY(-2px);
	}
	/* Press returns it to the resting plane, so the click feels physical. */
	.wp-element-button:active {
		transform: translateY(0);
	}
	.wplb-card>.wplb-icon {
		transition: background-color .18s ease,color .18s ease;
	}
	.wplb-card {
		transition: transform .18s ease,box-shadow .18s ease;
	}
	.wplb-card:hover {
		transform: translateY(-4px);
		box-shadow: 0 10px 30px rgba(0,0,0,0.10);
	}
	.wplb-media li .wp-block-post-featured-image {
		transition: transform .18s ease,box-shadow .18s ease;
	}
	.wplb-media li:hover .wp-block-post-featured-image {
		transform: translateY(-4px);
		box-shadow: 0 10px 30px rgba(0,0,0,0.18);
	}
	.wplb-media li .wp-block-post-featured-image img {
		transition: transform .5s ease;
	}
	.wplb-media li:hover .wp-block-post-featured-image img {
		transform: scale(1.04);
	}
}

.wplb-card {
	height: 100%;
}

/*
 * A service card's photo runs edge to edge across its top, pulled out over the
 * card's own padding (the spacing presets the Services pattern sets). The
 * constrained layout centres its children with !important margins, so this
 * has to answer in kind. Logical properties keep it right in RTL.
 */
.wplb-card:has(> .wplb-card-photo) {
	overflow: hidden;
}
.wplb-card > .wplb-card-photo {
	margin-block-start: calc(-1 * var(--wp--preset--spacing--50));
	margin-inline: calc(-1 * var(--wp--preset--spacing--40)) !important;
	max-width: none;
}

.wplb-even-rows {
	grid-auto-rows: 1fr;
}

/*
 * Card titles run one or two lines, which left every excerpt starting at a
 * different height. Reserving two lines of the title's own line-height lines
 * the excerpts up across the whole grid, not just within a row. Two, not
 * three: the grid caps at three columns, so cards are wide enough that a
 * service name rarely needs a third line, and a three-line reserve left a
 * visible gap under every title.
 *
 * Only once the grid has more than one column — two 16rem columns plus the gap
 * need ~36rem — because in a single column there is nothing to line up with and
 * the reserve would be a bare gap under every short title.
 *
 * ponytail: a title that needs a third line pushes its own excerpt down;
 * `grid-template-rows: subgrid` on the cards is the exact fix if that happens.
 */
@media (min-width: 36rem) {
	.wplb-card-title,
	.wplb-media li :is(h2, h3) {
		min-height: 2lh;
	}
}

/* The place sits close under the title it belongs to. */
.wplb-media li .wplb-place {
	margin-block: var(--wp--preset--spacing--20) 0;
}

.wplb-media li .wp-block-post-featured-image {
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.wplb-media li .wp-block-post-featured-image img {
	display: block;
	width: 100%;
}

:is(h1,h2,h3) {
	text-wrap: balance;
}

.wplb-area-links,.wplb-profiles {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

/*
 * Footer link lists: padding takes each link to the 24px minimum tap height
 * (WCAG 2.2, 2.5.8) instead of the 17px of its text, and replaces the gap so
 * the list keeps its spacing.
 */
.wplb-area-links {
	gap: 0;
}

.wplb-area-links a,
.wplb-legal a {
	display: inline-block;
	padding-block: 0.25rem;
}

.wplb-profiles a {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.wplb-footer-col {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}

.wplb-footer-col>* {
	margin-block: 0;
}

/*
 * Footer contact lines: the icon is a scanning anchor for someone hunting one
 * value, not a label — the number, address and email speak for themselves.
 * align-items:start rather than center so a wrapping address keeps its icon on
 * the first line; the nudge re-centres it on that line.
 */
.wplb-contact-line {
	display: flex;
	align-items: start;
	gap: 0.5em;
}

.wplb-contact-line .wplb-icon {
	flex-shrink: 0;
	/* Track the text exactly: the small size is fluid, the SVG attribute is not. */
	width: 1em;
	height: 1em;
	/*
	 * Align the icon's top with the top of the text, not the top of the line
	 * box — half the leading sits above the glyphs. The calc derives that from
	 * whatever line-height applies, so a style variation stays aligned; 0.35em
	 * is the same figure for the 1.7 body line-height, for browsers with no lh.
	 */
	margin-block-start: 0.35em;
	margin-block-start: calc((1lh - 1em) / 2);
}

.wplb-hero-form .wplb-form__row {
	margin-bottom: 0.75rem;
}

.wplb-hero-form label {
	font-size: var(--wp--preset--font-size--small);
}

/*
 * The consent box is sized and positioned in em of its own font, so the whole
 * row has to carry the hero form's smaller type or the box would be measured
 * against the body size and sit low.
 */
.wplb-hero-form .wplb-form__consent {
	font-size: var(--wp--preset--font-size--small);
}

.wplb-hero-form .wp-element-button {
	width: 100%;
}

/*
 * No gap between header, main and footer. Core spaces every top-level part by
 * the block gap (24px), which showed as a strip of page background under the
 * header line and between the last dark section and the dark footer. Each
 * template's main already brings its own padding; the front page starts and
 * ends with full-width sections.
 */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

.wplb-stars {
	display: flex;
	gap: 2px;
	min-height: 16px; /* An unrated card's empty row matches a star row. */
}

/*
 * A grid, so badges line up in columns — with auto-fit tracks rather than the
 * max-content ones this used to have. max-content never wraps, so a badge
 * carrying a real sentence of detail made the row wider than the viewport and
 * the centred grid bled off both edges; a minmax track wraps the detail and
 * fits as many columns as there is room for, at any badge count.
 *
 * align-items:start on both axes: every badge starts at the top of its row
 * whatever its height, and the icon sits on the first line rather than
 * floating to the middle of a three-line block.
 */
.wplb-badges {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
	align-items: start;
	gap: var(--wp--preset--spacing--40) var(--wp--preset--spacing--60);
}

.wplb-badges li {
	display: flex;
	align-items: start;
	gap: 0.65rem;
}

.wplb-badges svg {
	flex: none;
	/* Centre the icon on the label's first line, not on the line box. */
	margin-block-start: 0.1em;
}

.wplb-badges strong {
	display: block;
	line-height: 1.3;
}

.wplb-badges small {
	display: block;
	opacity: 0.75;
	font-size: var(--wp--preset--font-size--small);
}

.wplb-stars svg {
	fill: currentColor;
	color: var(--wp--preset--color--accent);
}

.wplb-review-by {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	font-size: var(--wp--preset--font-size--small);
}

.wplb-review-by small {
	opacity: 0.75;
}

/*
 * Review cards share the grid's rows (stars / quote / byline), so each part
 * starts at the same height across a row of cards: a byline that wraps to two
 * lines no longer starts higher than its neighbours. Browsers without subgrid
 * keep the stacked card, quotes still aligned by the stars row.
 */
@supports (grid-template-rows: subgrid) {
	.wplb-card:has(> .wplb-review-by) {
		display: grid;
		grid-template-rows: subgrid;
		grid-row: span 2;
		align-content: start;
	}

	.wplb-card:has(> .wplb-stars) {
		grid-row: span 3;
	}
}

.wplb-avatar {
	flex: none;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	display: grid;
	place-items: center;
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--light);
	font-weight: 700;
}

.wplb-ba {
	margin: 0;
	--wplb-pos: 50%;
}

.wplb-ba__frame {
	position: relative;
	overflow: hidden;
	border-radius: 10px;
	aspect-ratio: 4/3;
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Set by the pattern when most pairs were shot upright. */
.wplb-ba.is-portrait .wplb-ba__frame {
	aspect-ratio: 3/4;
}

.wplb-ba__frame img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wplb-ba__before {
	clip-path: inset(0 calc(100% - var(--wplb-pos)) 0 0);
}

.wplb-ba__divider {
	position: absolute;
	inset-block: 0;
	inset-inline-start: var(--wplb-pos);
	width: 2px;
	background: var(--wp--preset--color--light);
	box-shadow: 0 0 0 1px rgba(0,0,0,.25);
	pointer-events: none;
}

.wplb-ba__label {
	position: absolute;
	inset-block-end: 0.5rem;
	inset-inline-start: 50%;
	transform: translateX(-50%);
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	background: rgba(0,0,0,.6);
	color: #fff;
	font-size: var(--wp--preset--font-size--small);
	pointer-events: none;
}

.wplb-ba__range {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: ew-resize;
}

.wplb-ba__range:focus-visible {
	opacity: 1;
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.wplb-ba figcaption {
	margin-top: 0.5rem;
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
}

@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		@keyframes wplb-reveal {
			from {
				opacity: 0;
				transform: translateY(18px);
			}
			to {
				opacity: 1;
				transform: none;
			}
		}
		/*
		 * forwards, not both: `backwards` would apply the 0% keyframe during the
		 * before phase, which is every section a visitor has not scrolled to yet.
		 * Anything that paints the page without scrolling — a full-page
		 * screenshot, Lighthouse's final frame, print, a crawler that renders
		 * beyond the viewport — then sees the page blank below the first screen.
		 * Without it, an unreached section renders normally and the fade still
		 * runs as it enters, because entry 0% is the moment it first appears.
		 */
		main > .wp-block-group:not(:first-child),main > .wp-block-cover:not(:first-child),main > section:not(:first-child) {
			animation: wplb-reveal linear forwards;
			animation-timeline: view();
			animation-range: entry 0% entry 40%;
		}
	}
}

.wplb-form__row {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	margin: 0 0 1rem;
}

.wplb-form input,.wplb-form textarea {
	/* width:100% plus padding and a border overflowed the row by 26px, which
	   put a 2px horizontal scroll on the whole page at phone widths. */
	box-sizing: border-box;
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--dark) 40%, transparent);
	border-radius: 6px;
	font: inherit;
	color: inherit;
	background-color: var(--wp--preset--color--light);
}

.wplb-form input:focus-visible,.wplb-form textarea:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.wplb-form__consent {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	margin: 0 0 1rem;
}

.wplb-form__consent input {
	flex: none;
	/* Sized, because the general rule above would stretch it to the row. */
	inline-size: 1em;
	block-size: 1em;
	padding: 0;
	/*
	 * Line the box up with the top of the label's first line, not the top of
	 * its line box — half the leading sits above the glyphs. Same calc as the
	 * contact icons; 0.35em is that figure for the 1.7 body line-height, for
	 * browsers with no lh unit.
	 */
	margin-block-start: 0.35em;
	margin-block-start: calc((1lh - 1em) / 2);
}

.wplb-form__hp {
	position: absolute;
	inset-inline-start: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wplb-notice {
	display: none;
	margin-top: 1rem;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	background-color: var(--wp--preset--color--muted);
}

.wplb-notice:target {
	display: block;
}

.wplb-notice--ok {
	border-inline-start: 4px solid var(--wp--preset--color--primary);
}

.wplb-notice--err {
	border-inline-start: 4px solid var(--wp--preset--color--accent);
}

.wplb-breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1.5rem;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--small);
}

.wplb-breadcrumbs li+li::before {
	content: '/';
	opacity: 0.5;
	margin-inline-end: 0.5rem;
}

/*
 * "How it works" — the one section that breaks the page's rhythm.
 * Numbered steps down a rule, with the heading sticky beside them.
 */
.wplb-sticky {
	position: sticky;
	top: var(--wp--preset--spacing--60);
}

.wplb-steps {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wplb-steps li {
	display: flex;
	gap: var(--wp--preset--spacing--40);
	padding-bottom: var(--wp--preset--spacing--60);
	/* Accent-tinted rail: the sequence should read as part of the brand, not as a hairline. */
	border-inline-start: 2px solid color-mix(in srgb, var(--wp--preset--color--accent) 30%, transparent);
	padding-inline-start: var(--wp--preset--spacing--40);
	margin-inline-start: 1.5rem;
}

.wplb-steps li:last-child {
	padding-bottom: 0;
	border-inline-start-color: transparent;
}

/*
 * The badge carries the step's icon, which the step data has held all along.
 * Its ring is the band's own background colour, so it masks the rail behind
 * the circle instead of letting a line run through it.
 */
.wplb-steps__badge {
	flex: none;
	box-sizing: border-box;
	width: 3rem;
	height: 3rem;
	margin-inline-start: calc(-1.5rem - var(--wp--preset--spacing--40));
	border-radius: 50%;
	display: grid;
	place-items: center;
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--dark);
	box-shadow: 0 0 0 6px var(--wp--preset--color--dark);
}

.wplb-steps__index {
	display: block;
	margin-bottom: 0.15rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 2px;
	color: var(--wp--preset--color--accent);
}

.wplb-steps__body strong {
	display: block;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.3;
	margin-bottom: 0.35rem;
}

/* The titles carry the scan; the explanation sits one step back from them. */
.wplb-steps__body strong + span {
	opacity: 0.78;
}

@media (max-width: 781px) {
	.wplb-sticky {
		position: static;
	}
}

/* Language switcher (Polylang). A <ul>, so the bullets and indent need clearing;
   no pill or border, which would fight the square button corners in Craft.
   Polylang 3.9 wraps the list in a <nav> (class on the nav, default layout
   vertical), so the inner <ul> gets the same row treatment. */
.wp-block-polylang-language-switcher,
.wp-block-polylang-language-switcher > ul {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Polylang 3.9's own sheet sets the nav to width:100% and its default
   vertical layout to flex-direction:column, loading after this file; two
   classes keep the switcher a compact row in the header. */
.wp-block-polylang-language-switcher.pll-switcher {
	width: auto;
}
.wp-block-polylang-language-switcher.pll-switcher > ul {
	flex-direction: row;
}

.wp-block-polylang-language-switcher .lang-item {
	margin: 0;
}

.wp-block-polylang-language-switcher a {
	display: flex;
	align-items: center;
	gap: 0.4em;
	/* 16x11px flags are far below a usable target, so the link carries the size. */
	min-height: 2rem;
	padding-inline: 0.5em;
	border-block-end: 2px solid transparent;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.05em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--dark);
	opacity: 0.55;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.wp-block-polylang-language-switcher .current-lang a {
	border-block-end-color: var(--wp--preset--color--accent);
	opacity: 1;
}

.wp-block-polylang-language-switcher a:hover,
.wp-block-polylang-language-switcher a:focus-visible {
	opacity: 1;
}

/* Polylang inlines a physical margin-left on the label; the flex gap replaces it. */
.wp-block-polylang-language-switcher a span {
	margin: 0 !important;
}

.wp-block-polylang-language-switcher img {
	display: block;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgb(0 0 0 / 12%);
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-polylang-language-switcher a {
		transition: none;
	}
}

/*
 * FAQ accordion. core/details renders a bare <details>: the browser's own
 * triangle, no open state, and an instant jump. These rows are often the last
 * thing read before someone calls, so they get a real control and a reveal
 * that does not snap.
 *
 * All of it is CSS on the native element, so find-in-page, keyboard order and
 * screen-reader semantics are exactly what the browser gives for free.
 */
.wplb-faq-item {
	/* Reserved at rest so the open accent cannot shift the text sideways. */
	border: 1px solid rgb(0 0 0 / 8%);
	border-inline-start: 3px solid transparent;
}

.wplb-faq-item:hover {
	border-color: rgb(0 0 0 / 16%);
}

.wplb-faq-item[open] {
	border-inline-start-color: var(--wp--preset--color--primary);
	box-shadow: 0 6px 24px rgb(0 0 0 / 7%);
}

/*
 * display:flex drops Chrome's marker, list-style Firefox's, and the
 * ::-webkit-details-marker rule Safari's. All three are needed.
 */
.wplb-faq-item > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
	cursor: pointer;
	font-weight: 600;
	list-style: none;
}

.wplb-faq-item > summary::-webkit-details-marker {
	display: none;
}

.wplb-faq-item > summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/*
 * The control: two bars drawn as gradients, so open collapses the vertical one
 * and a plus becomes a minus. No glyph, no rotation, nothing that has to be
 * mirrored in RTL.
 */
.wplb-faq-item > summary::after {
	content: "";
	flex: 0 0 auto;
	width: 0.75em;
	height: 0.75em;
	background:
		linear-gradient(currentColor,currentColor) center / 100% 2px no-repeat,
		linear-gradient(currentColor,currentColor) center / 2px 100% no-repeat;
	opacity: 0.55;
}

.wplb-faq-item[open] > summary::after {
	background-size: 100% 2px,0 100%;
	opacity: 1;
}

.wplb-faq-item > summary + * {
	margin-block-start: var(--wp--preset--spacing--30);
}

@media (prefers-reduced-motion: no-preference) {
	.wplb-faq-item {
		transition: border-color .18s ease,box-shadow .18s ease;
	}
	.wplb-faq-item > summary::after {
		transition: background-size .18s ease,opacity .18s ease;
	}
	/*
	 * Height-to-auto only animates where interpolate-size is supported; without
	 * it the rules below are skipped and the panel toggles instantly, which is
	 * today's behaviour.
	 */
	@supports (interpolate-size: allow-keywords) {
		:root {
			interpolate-size: allow-keywords;
		}
		.wplb-faq-item::details-content {
			overflow: hidden;
			block-size: 0;
			transition: block-size .25s ease,content-visibility .25s allow-discrete;
		}
		.wplb-faq-item[open]::details-content {
			block-size: auto;
		}
	}
}

/*
 * The footer's legal row: notice on one side, legal links on the other, which
 * is where people look for them. Below the two-column width they stack, and a
 * stack reads better centred than ragged against one edge.
 */
@media (max-width: 600px) {
	.wplb-legal {
		justify-content: center;
		text-align: center;
	}
}

/*
 * Header on phones: one row of logo, language and menu. The site title hides
 * when a logo is present (the logo carries the name), and the call button
 * gives way to the sticky .wplb-mobile-cta bar, which shows at the same width.
 */
@media (max-width: 600px) {
	.wplb-header {
		padding-block: var(--wp--preset--spacing--20) !important;
	}
	.wplb-header > .wp-block-group,
	.wplb-header > .wp-block-group > .wp-block-group {
		flex-wrap: nowrap;
	}
	.wplb-header__brand {
		min-width: 0;
	}
	/* Two classes: core's .wp-block-buttons.is-layout-flex sets display:flex. */
	body:not(.wplb-logo-mark) .wplb-header__brand:has(.wp-block-site-logo img) .wp-block-site-title,
	.wplb-header .wplb-header__call {
		display: none;
	}
	/* A symbol logo (WPLB_LOGO_SHOWS_NAME false) keeps the name beside it, smaller. */
	.wplb-logo-mark .wplb-header .wp-block-site-title {
		font-size: 1rem;
		line-height: 1.2;
	}
	.wplb-header .wp-block-site-logo img {
		width: auto !important;
		max-height: 3rem;
	}
}

/*
 * The header stacks above the page. Without this, a dropdown menu opened
 * under the hero's text layer, which the kits lift with z-index to sit above
 * their artwork.
 */
.wplb-header {
	position: relative;
	z-index: 10;
}

/* Dropdowns wide enough that a service name reads on one line. */
.wplb-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__submenu-container {
	min-width: 18rem !important;
}

/*
 * Header above phone width: one row. With a longer menu the right-hand group
 * outgrew the row and the whole menu dropped under the logo. Holding the row
 * on one line lets the site title wrap to two lines first, which costs far
 * less than a second row; the right-hand group still wraps internally if it
 * must, on narrow tablets.
 */
@media (min-width: 601px) {
	.wplb-header > .wp-block-group,
	.wplb-header__brand {
		flex-wrap: nowrap;
	}
	.wplb-header__brand,
	.wplb-header__name,
	.wplb-header__brand .wp-block-site-title {
		min-width: 0;
	}
	.wplb-header__brand .wp-block-site-logo {
		flex-shrink: 0;
	}
	/*
	 * The logo is sized by height, not the block's fixed width: a wide
	 * wordmark and a near-square mark both sit in the same header height,
	 * where a square mark at the 180px width stood 160px tall.
	 */
	.wplb-header .wp-block-site-logo img {
		width: auto !important;
		max-height: 5rem;
	}
	.wplb-header > .wp-block-group > .wp-block-group:last-child {
		justify-content: flex-end;
	}
}
/*
 * Phone menu overlay: everything aligned to the start edge. The header asks
 * the navigation to justify right, which in the overlay set short items to
 * the right while long ones wrapped back to the left. A submenu's items are
 * indented under their parent instead.
 */
.wplb-header .wp-block-navigation__responsive-container.is-menu-open :is(.wp-block-navigation__container, .wp-block-page-list, .wp-block-navigation-item) {
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
	align-items: flex-start;
}
.wplb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	text-align: start;
}
.wplb-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	padding-inline-start: var(--wp--preset--spacing--40) !important;
}

/* Wide screens: the menu side keeps its width, so only the title gives way. */
@media (min-width: 1200px) {
	.wplb-header > .wp-block-group > .wp-block-group:last-child {
		flex-shrink: 0;
	}
}

/*
 * No projects yet: visitors see neither the empty #work section nor the
 * buttons that point at it. Logged-in users still see the how-to note.
 */
body:not(.logged-in) #work:has(.wp-block-query-no-results),
body:not(.logged-in):has(#work .wp-block-query-no-results) .wp-block-button:has(> a[href="#work"]) {
	display: none;
}

/*
 * Price list: name and detail on the inline-start side, price on the end side,
 * a hairline between rows. Logical properties only, so RTL clones mirror it.
 */
.wplb-prices {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	max-width: 48rem;
}
.wplb-prices li {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--wp--preset--spacing--40);
	padding-block: var(--wp--preset--spacing--30);
	border-block-end: 1px solid var(--wp--preset--color--muted);
}
.wplb-prices small {
	display: block;
	opacity: 0.75;
}
.wplb-price {
	flex-shrink: 0;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--large);
}

/*
 * "Open now" pill, filled in by assets/js/open-now.js. The display rule skips
 * [hidden] so the badge stays invisible until the script says it is open.
 * The dot is a fixed green on purpose: it is a status signal, not brand colour.
 */
.wplb-open-now:not([hidden]) {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	width: fit-content;
	padding: 0.25em 0.85em;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: var(--wp--preset--font-size--small);
}
.wplb-open-now::before {
	content: "";
	width: 0.6em;
	height: 0.6em;
	border-radius: 50%;
	background: #2fa35a;
}

/*
 * Contact column actions span the column, like the form fields: the call
 * button, the messaging row (equal halves) and the form's submit button all
 * share one left and one right edge. The form rule also covers the `form` hero.
 */
.wplb-call .wp-block-button,
.wplb-messaging .wp-block-button {
	flex: 1 1 0;
}
.wplb-call .wp-block-button__link,
.wplb-messaging .wp-block-button__link,
.wplb-form button[type="submit"] {
	width: 100%;
}

/*
 * Capabilities datasheet (patterns/specs.php). Neutral here: a grid of
 * label / value pairs. The construction kit turns each cell into a
 * dimensioned drawing.
 */
.wplb-specs {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: var(--wp--preset--spacing--50);
	margin: 0 auto;
}
.wplb-spec {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}
.wplb-spec dt {
	order: 2;
	font-weight: 600;
}
.wplb-spec dd {
	margin: 0;
}
.wplb-spec__value {
	order: 1;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 700;
	line-height: 1;
}
.wplb-spec__detail {
	order: 3;
	font-size: var(--wp--preset--font-size--small);
	opacity: 0.75;
}

/*
 * Emergency triage (patterns/triage.php): one native <details> per problem.
 * The marker is drawn here so it can flip with logical properties.
 */
.wplb-triage {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	max-width: 48rem;
	margin-inline: auto;
}
.wplb-triage__item {
	background: var(--wp--preset--color--light);
	border: 1px solid rgb(0 0 0 / 10%);
	border-radius: 10px;
	padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
}
.wplb-triage__item summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	cursor: pointer;
	font-weight: 700;
	list-style: none;
}
.wplb-triage__item summary::-webkit-details-marker {
	display: none;
}
.wplb-triage__item summary::after {
	content: "+";
	flex-shrink: 0;
	font-size: 1.4em;
	line-height: 1;
}
.wplb-triage__item[open] summary::after {
	content: "−";
}
.wplb-triage__steps {
	margin-block: var(--wp--preset--spacing--30);
	padding-inline-start: 1.4em;
}
.wplb-triage__steps li + li {
	margin-block-start: 0.35em;
}
.wplb-triage__call {
	margin: var(--wp--preset--spacing--40) 0 0;
}

/*
 * Weekly schedule (patterns/schedule.php): seven rows, closed days dimmed,
 * today marked by assets/js/open-now.js.
 */
.wplb-schedule-section .wplb-open-now:not([hidden]) {
	/* Block-level so the auto margins centre it; inline-flex ignores them. */
	display: flex;
	margin-inline: auto !important;
}
.wplb-schedule {
	max-width: 32rem;
	margin: var(--wp--preset--spacing--40) auto var(--wp--preset--spacing--50);
}
.wplb-schedule__day {
	display: flex;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	border-block-end: 1px solid var(--wp--preset--color--muted);
}
.wplb-schedule__day dd {
	margin: 0;
	font-variant-numeric: tabular-nums;
}
.wplb-schedule__day.is-closed {
	opacity: 0.55;
}
.wplb-schedule__day.is-today {
	font-weight: 700;
	background: var(--wp--preset--color--muted);
}

/*
 * Related work on a service page (wplb_render_related_projects). Reuses the
 * .wplb-media card markup, so the hover lift and every kit's corners apply.
 */
.wplb-related {
	margin-block: var(--wp--preset--spacing--70);
}
.wplb-related__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: var(--wp--preset--spacing--40);
	list-style: none;
	margin: var(--wp--preset--spacing--40) 0 0;
	padding: 0;
}
.wplb-related__grid figure {
	margin: 0;
}
.wplb-related__grid img {
	aspect-ratio: 4 / 3;
	object-fit: cover;
	height: auto;
}
.wplb-related__grid h3 {
	margin: var(--wp--preset--spacing--20) 0 0;
}
.wplb-related__grid h3 a {
	text-decoration: none;
	color: inherit;
}

/*
 * Uploaded video: a phone clip filmed upright would otherwise be taller than
 * the screen, so it is capped at most of the viewport and centred.
 */
.wp-block-video video {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 80vh;
	margin-inline: auto;
	border-radius: 8px;
	background: var(--wp--preset--color--dark);
}
.wp-block-video figcaption {
	text-align: center;
}

/*
 * Click-to-play YouTube (inc/video.php): a local thumbnail with a play button
 * in the video's own shape, swapped for the player on click.
 */
.wplb-yt__frame {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 8px;
	background: var(--wp--preset--color--dark);
}
.wplb-yt.is-vertical .wplb-yt__frame {
	aspect-ratio: 9 / 16;
	max-width: 22rem;
	margin-inline: auto;
}
.wplb-yt__play,
.wplb-yt__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.wplb-yt__play img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.wplb-yt__button {
	position: absolute;
	inset: 50% auto auto 50%;
	width: 4.25rem;
	height: 3rem;
	translate: -50% -50%;
	border-radius: 0.8rem;
	background: rgb(0 0 0 / 70%);
	transition: background-color 0.15s ease;
}
.wplb-yt__button::after {
	content: "";
	position: absolute;
	inset: 50% auto auto 54%;
	translate: -50% -50%;
	border-block: 0.6rem solid transparent;
	/* Physical on purpose: a play symbol points right in RTL too. */
	border-left: 1rem solid #fff;
}
.wplb-yt__play:hover .wplb-yt__button,
.wplb-yt__play:focus-visible .wplb-yt__button {
	background: var(--wp--preset--color--accent);
}

/* Project cards whose project holds a video: a play badge in the corner. */
.wplb-has-video {
	position: relative;
}
.wplb-has-video::after {
	content: "";
	position: absolute;
	inset-block-end: 0.75rem;
	inset-inline-start: 0.75rem;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: rgb(0 0 0 / 65%) no-repeat 56% 50% / 0.9rem url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12'%3E%3Cpath d='M0 0l10 6-10 6z' fill='%23fff'/%3E%3C/svg%3E");
	pointer-events: none;
}

/*
 * Sections fade up as they scroll into view. Pure CSS (scroll-driven
 * animation), no script: browsers without it, and visitors who ask for
 * reduced motion, simply see the page as it is. The contents move, not the
 * band, so coloured backgrounds never flash; the hero (first section) is
 * left alone so the first paint is never delayed.
 */
@supports (animation-timeline: view()) {
	@media (prefers-reduced-motion: no-preference) {
		main > .alignfull:not(:first-child) > * {
			animation: wplb-reveal linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 60%;
		}
	}
}
@keyframes wplb-reveal {
	from {
		opacity: 0;
		transform: translateY(1.5rem);
	}
}

/* Footer credit moves to the next line as a whole rather than splitting its name off. */
.wplb-credit {
	white-space: nowrap;
}

/*
 * Trade line under the business name (WPLB_DESCRIPTOR): small capitals that
 * read as part of the name block, not a second heading. Text colour, not the
 * accent: gold on the light header falls below readable contrast at this size.
 * Hidden on phones, where the name already takes two lines beside the logo.
 */
.wplb-header__name {
	gap: 0.15rem !important;
}
.wplb-header__descriptor {
	margin: 0;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-wrap: balance;
	opacity: 0.8;
}
@media (max-width: 600px) {
	.wplb-header__descriptor {
		display: none;
	}
}

/*
 * Hero line of area-page links: on the hero's own text colour, so it reads
 * on the dark overlay and on the light split hero alike; padded to the same
 * 24px tap height as the footer links.
 */
.wplb-area-inline a {
	color: inherit;
	display: inline-block;
	padding-block: 0.25rem;
}

/*
 * Area page jobs list: one pin line per job, in the place-line style, above
 * the photo cards.
 */
.wplb-area-jobs {
	list-style: none;
	margin: var(--wp--preset--spacing--40) 0 0;
	padding: 0;
	display: grid;
	gap: var(--wp--preset--spacing--20);
	max-width: 48rem;
}
