/*
 * Styles every section block shares, loaded before each block's own style.css: buttons, icons,
 * and the wordmark (03-UI-SPEC.md Part B, Color and Branding rules).
 */

.local-service-icon {
	flex: none;
}

/* The theme styles `.wp-element-button` as the accent button; these modifiers recolour it. */
.local-service-button {
	gap: var(--wp--preset--spacing--sm);
	box-sizing: border-box;
}

/* Outline buttons: transparent, a 1px `contrast` border, and `contrast` text. */
.local-service-button.local-service-button--outline {
	border-color: var(--wp--preset--color--contrast);
	background: transparent;
	color: var(--wp--preset--color--contrast);
}

/* The inverted button on `primary` bands: `on-primary` fill with `primary` text. */
.local-service-button.local-service-button--inverted {
	border-color: var(--wp--preset--color--on-primary);
	background: var(--wp--preset--color--on-primary);
	color: var(--wp--preset--color--primary);
}

/* Buttons on photos: white text and a 1px white border over the scrim. */
.local-service-button.local-service-button--on-photo {
	border-color: #fff;
	background: transparent;
	color: #fff;
}

.local-service-button:hover .local-service-button__label {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* The wordmark: the site-title block, whose design styles set its face and weight, or the logo.
 * A name that wraps splits into lines of even length, so no word is left alone on the second. */
.local-service-wordmark .wp-block-site-title {
	margin: 0;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

.local-service-wordmark .wp-block-site-title a {
	display: inline-block;
	text-decoration: none;
}

.local-service-wordmark--logo {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.local-service-wordmark__logo {
	display: block;
	width: auto;
	max-width: 200px;
	height: auto;
	max-height: 48px;
}

/* Text that only assistive technology reads, such as "Rated 4.8 out of 5". */
.local-service-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/*
 * Homepage sections (03-UI-SPEC.md Part B, "Section variants"): each is a full-width band whose
 * top and bottom padding is the design's `section` preset and whose content stops at the theme's
 * wide size. Two plain sections in a row share one padding instead of stacking two, and a band
 * (`--band`: `primary`, `base-alt`, or a photo) always keeps both.
 */
.local-service-section {
	--local-service-section-pad: var(--wp--style--root--padding-left, clamp(16px, 4vw, 32px));
	padding-block: var(--wp--preset--spacing--section);
	color: var(--wp--preset--color--contrast);
}

.local-service-section.alignfull,
.local-service-trust-strip.alignfull {
	margin-block: 0;
}

.local-service-section:not(.local-service-section--band) + .local-service-section:not(.local-service-section--band) {
	padding-top: 0;
}

.local-service-section__inner {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--wp--style--global--wide-size, 1200px) + 2 * var(--local-service-section-pad));
	margin-inline: auto;
	padding-inline: var(--local-service-section-pad);
}

.local-service-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--md) var(--wp--preset--spacing--lg);
	margin-bottom: var(--wp--preset--spacing--xl);
}

.local-service-section__intro {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--sm);
	min-width: 0;
	max-width: 720px;
}

.local-service-section__title,
.local-service-section__sentence {
	margin: 0;
	overflow-wrap: break-word;
}

.local-service-section__title {
	color: inherit;
}

.local-service-section__sentence {
	max-width: var(--wp--custom--measure, 36em);
}

.local-service-section__more {
	margin: var(--wp--preset--spacing--xl) 0 0;
}

.local-service-section__more-link {
	display: inline-flex;
	align-items: center;
	gap: var(--wp--preset--spacing--xs);
	min-height: 44px;
	font-weight: var(--wp--custom--weight--strong, 700);
}

@media (min-width: 1024px) {
	.local-service-section__head {
		margin-bottom: var(--wp--preset--spacing--2-xl);
	}
}

/* Star ratings: 5 icons, the rounded rating filled, and the rating as hidden text. */
.local-service-stars {
	display: inline-flex;
	align-items: center;
}

.local-service-stars__icons {
	display: inline-flex;
	gap: var(--wp--preset--spacing--xs);
}

.local-service-stars__star {
	display: inline-flex;
}

.local-service-stars__star .local-service-icon {
	fill: currentColor;
}

.local-service-stars__star.is-empty .local-service-icon {
	fill: none;
}

/*
 * Carousels (the services slider and the reviews): a row that scrolls with snapping and moves
 * only when the visitor scrolls or presses Previous or Next. carousel.js shows the buttons when
 * the row overflows; `prefers-reduced-motion` turns the smooth scroll off.
 */
/* The track is the containing block of every absolutely positioned descendant, such as the
 * hidden rating text, so the track clips them instead of letting them widen the page. */
.local-service-carousel__track {
	position: relative;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: thin;
}

.local-service-carousel__track > ul {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.local-service-carousel__track > ul > li {
	flex: none;
	scroll-snap-align: start;
}

.local-service-carousel__controls {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--sm);
}

.local-service-carousel__controls[hidden] {
	display: none;
}

.local-service-carousel__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid currentColor;
	border-radius: var(--wp--custom--radius--control, 4px);
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.local-service-carousel__button[aria-disabled="true"] {
	opacity: 0.4;
	cursor: default;
}

.local-service-carousel__position {
	margin: 0;
	min-width: 4.5em;
	font-size: var(--wp--preset--font-size--small);
	text-align: center;
	font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
	.local-service-carousel__track {
		scroll-behavior: auto;
	}
}

.local-service-carousel__track:focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
}

/*
 * A carousel row that runs to the right edge of the viewport: the first card lines up with the
 * section's content, and the next cards stay visible past the content edge, which shows the
 * visitor that the row scrolls. The section is a size container, so `100cqw` is its width.
 */
.local-service-carousel--bleed {
	container-type: inline-size;
}

.local-service-carousel--bleed .local-service-carousel__track {
	--local-service-bleed: max(var(--local-service-section-pad), (100cqw - var(--wp--style--global--wide-size, 1200px)) / 2);
	margin-inline: calc(-1 * var(--local-service-bleed));
	padding-inline: var(--local-service-bleed);
	scroll-padding-inline: var(--local-service-bleed);
}

/*
 * Inner pages (03-UI-SPEC.md Part B, "Inner pages"): the `page` template sets the post content in
 * the 720px column under the page header. A page of prose gets the section padding above its
 * first block and below its last, and a page that starts or ends with a section block leaves that
 * padding to the section.
 */
.local-service-page__content > :first-child:not(.alignfull) {
	margin-block-start: var(--wp--preset--spacing--section);
}

.local-service-page__content > :last-child:not(.alignfull) {
	margin-block-end: var(--wp--preset--spacing--section);
}

/* The 720px column starts at the page header's left edge, the left edge of the wide size, so the
 * title and the prose under it share one line instead of the prose sitting in the middle. */
.local-service-page__content.is-layout-constrained > :not(.alignfull):not(.alignwide):not(.alignleft):not(.alignright) {
	margin-left: max(0px, calc((100% - var(--wp--style--global--wide-size, 1200px)) / 2)) !important;
}

/*
 * Form fields, shared by the request card, the contact form, and the booking form (03-UI-SPEC.md
 * Part B, "Forms"): labels above 48px fields in `small` at the second weight, "(optional)" in the
 * label of an optional field, a 144px textarea, and an error line with an alert icon under an
 * invalid field, whose border grows to 2px.
 */
.local-service-form {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--md);
}

.local-service-form__field {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--sm);
}

.local-service-form__label {
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--wp--custom--weight--strong, 700);
	line-height: 1.45;
}

.local-service-form__control {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	padding: 0 var(--wp--preset--spacing--md);
	border: 1px solid var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--control, 8px);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font: inherit;
}

.local-service-form__control[aria-invalid="true"] {
	border-width: 2px;
}

.local-service-form__error {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--xs);
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.45;
}

.local-service-form__error[hidden] {
	display: none;
}

.local-service-form__optional {
	font-weight: 400;
}

/* A pill radius suits a one-line field only, so a textarea keeps at most 24px. */
textarea.local-service-form__control {
	border-radius: min(var(--wp--custom--radius--control, 8px), 24px);
	min-height: 144px;
	padding-block: var(--wp--preset--spacing--sm);
	resize: vertical;
}

select.local-service-form__control {
	padding-inline-end: var(--wp--preset--spacing--xl);
}

.local-service-form__actions {
	margin-top: var(--wp--preset--spacing--sm);
}

/*
 * The reCAPTCHA checkbox sits between the last field and the submit button; the form's gap spaces
 * it at md on both sides. `forms.js` renders it compact below 304px, so it never widens the card.
 * Until Google's script fills it, or when the script does not load, the container takes no space.
 */
.local-service-form__recaptcha {
	min-width: 0;
	max-width: 100%;
}

.local-service-form__recaptcha:empty {
	display: none;
}

/* The submit button while the form sends: `forms.js` sets aria-disabled and ignores clicks. */
.local-service-form__submit[aria-disabled="true"] {
	cursor: progress;
}

/*
 * The honeypot field (D-171): visible to a bot that fills every input and to nobody else. The
 * wrapper is `aria-hidden`, so assistive technology skips it as well.
 */
.local-service-form__trap {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/*
 * The message that replaces a sent form (05-UI-SPEC.md Part C, "Tokens"): `base-alt` with a 1px
 * `line` border, `contrast` text at the body size, the first sentence at the second weight, and
 * the 20px circle-check icon in `contrast`. The panel keeps the width of the form it replaces.
 */
.local-service-form__panel,
.local-service-form__failure {
	display: flex;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--sm);
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: var(--wp--preset--spacing--lg);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: min(var(--wp--custom--radius--control, 8px), 24px);
	background: var(--wp--preset--color--base-alt);
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.55;
}

/*
 * The error panel above the submit button (05-UI-SPEC.md Part C, "Tokens") uses the heavier 2px
 * `contrast` border, so the colour never carries the meaning. The plugin prints it hidden, and
 * `forms.js` shows it; the `display` above would otherwise override the `hidden` attribute.
 */
.local-service-form__failure {
	border: 2px solid var(--wp--preset--color--contrast);
}

.local-service-form__failure[hidden] {
	display: none;
}

/* The panel moves focus to itself, so it needs no outline of the browser's own beyond the focus ring. */
.local-service-form__failure:focus-visible,
.local-service-form__panel:focus-visible {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
}

/* The panel's text takes the width the icon leaves. */
.local-service-form__failure .local-service-form__panel-text {
	flex: 1 1 auto;
	min-width: 0;
}

/* The field lines that a form without JavaScript lists under the error heading. */
.local-service-form__panel-list {
	margin: var(--wp--preset--spacing--xs, 4px) 0 0;
	padding-left: 1.25em;
}

.local-service-form__panel-icon {
	flex: none;
	display: inline-flex;
	padding-top: 2px;
}

.local-service-form__panel-text {
	margin: 0;
}

.local-service-form__panel-lead {
	font-weight: var(--wp--custom--weight--strong, 700);
}

/*
 * A location's contact details: the address, phone, email, hours, and map link, each line after
 * a 20px icon in `primary`.
 */
.local-service-location {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--md);
}

.local-service-location__title {
	margin: 0;
	font-family: var(--wp--custom--font--heading-small, var(--wp--custom--font--heading, inherit));
	font-size: var(--wp--preset--font-size--medium);
	font-weight: var(--wp--custom--weight--title, var(--wp--custom--weight--heading, 700));
	line-height: 1.3;
}

.local-service-location__title a {
	color: inherit;
}

.local-service-location__list {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--sm);
	margin: 0;
	padding: 0;
	list-style: none;
}

.local-service-location__line {
	display: flex;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--sm);
}

.local-service-location__line > .local-service-icon {
	margin-top: 0.2em;
	color: var(--wp--preset--color--primary);
}

.local-service-location__value {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* An email address that does not fit its column (the location card, the footer) breaks where the
 * line is full, never at a hyphen, which a reader would take for part of the address. A browser
 * prefers the break after a hyphen, so every character becomes a break opportunity instead. */
.local-service-location__email,
.local-service-email {
	word-break: break-all;
}

/* The domain of a location card's address, after the `<wbr>` that follows the `@` (quick task
 * 261015-ksg). As one inline block, it moves to the next line whole when the address does not fit,
 * so the address breaks only after the `@`; it breaks inside only when the domain alone is wider
 * than the card. A link's underline does not reach an inline block, so the span takes the link's. */
.local-service-location__email-domain {
	display: inline-block;
	text-decoration: inherit;
}

/* When the address breaks after the `@`, its two lines belong together, so they sit at the
 * `small` size's line height instead of the body's 1.6. The link is an inline block, because an
 * inline link's lines keep the taller line height of the list item around it. */
.local-service-location__email {
	display: inline-block;
	line-height: 1.45;
}

/* In the footer's columns and the Contact page's location cards, an email address is set in the
 * `small` size, so a typical address fits on one line. The item sidebar's 320px card sets its
 * email one size smaller in the block's own style.css. */
.local-service-email,
.local-service-location__email {
	font-size: var(--wp--preset--font-size--small);
}

.local-service-location__value address {
	font-style: normal;
}

.local-service-location__hours {
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * The item layout of the service, service-area, and location templates: the prose and the item
 * sidebar in one grid inside the wide size. It lives here rather than in the item sidebar's
 * style.css, because a password-protected item's sidebar renders nothing, so WordPress never
 * loads that file, and the password form would lose the column and the padding. Below 1024
 * pixels the post content's blocks become grid items of their own (`display: contents`), so the
 * sidebar card can sit after the first prose section: the blocks from the second `h2` on move
 * after it with `order`. From 1024 pixels the prose takes a 720px column and the sidebar a 320px
 * column on the right.
 */
.local-service-item {
	--local-service-item-pad: var(--wp--style--root--padding-left, clamp(16px, 4vw, 32px));
	display: grid;
	grid-template-columns: minmax(0, 720px);
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--wp--style--global--wide-size, 1200px) + 2 * var(--local-service-item-pad));
	margin-inline: auto;
	padding: var(--wp--preset--spacing--section) var(--local-service-item-pad);
}

.local-service-item.wp-block-group {
	margin-block: 0;
}

.local-service-item > .local-service-item__content {
	display: contents;
}

.local-service-item > .local-service-item__content > h2 ~ h2,
.local-service-item > .local-service-item__content > h2 ~ h2 ~ * {
	order: 2;
}

/* A plain section after the item shares its padding, as two plain sections in a row do. */
.local-service-item + .local-service-section:not(.local-service-section--band) {
	padding-top: 0;
}

@media (min-width: 1024px) {
	.local-service-item {
		grid-template-columns: minmax(0, 720px) 320px;
		column-gap: var(--wp--preset--spacing--2-xl);
		justify-content: space-between;
		align-items: start;
	}

	.local-service-item > .local-service-item__content {
		display: block;
		grid-column: 1;
		grid-row: 1;
		min-width: 0;
	}
}

/*
 * The fields of a content group item (Plan 06-09, D-197): a description list of labels and values, which the group list prints under
 * each item and the group fields block prints on the single page of an item.
 */
.local-service-group-fields {
	display: grid;
	gap: var(--wp--preset--spacing--xs);
	margin: 0;
}

.local-service-group-fields__row {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--sm);
}

.local-service-group-fields__label {
	font-weight: var(--wp--custom--weight--strong, 700);
}

.local-service-group-fields__value {
	margin: 0;
}

.local-service-group-fields__value p {
	margin: 0;
}

.local-service-group-fields-block {
	max-width: var(--wp--custom--measure, 36em);
	margin-inline: auto;
	padding-block: var(--wp--preset--spacing--lg);
}
