/*
 * A-Star Core front-end styles.
 * Colours come from the A-Star theme when it's active, with fallbacks for other themes.
 * Most selectors use :where() so any theme can override them without fighting specificity.
 */

:root {
	--astar-brand: var(--wp--preset--color--brand, #1e4a38);
	--astar-on-brand: var(--wp--preset--color--on-brand, #ffffff);
	--astar-signal: var(--wp--preset--color--signal, #f4c430);
	--astar-on-signal: var(--wp--preset--color--on-signal, #1b2420);
	--astar-ink: var(--wp--preset--color--ink, #1b2420);
	--astar-muted: var(--wp--preset--color--muted, #4b5851);
	--astar-line: var(--wp--preset--color--line, #d3dbd6);
	--astar-surface: var(--wp--preset--color--surface, #f1f4f2);
	--astar-display: var(--wp--preset--font-family--display, inherit);
	--astar-radius: var(--wp--custom--radius, 4px);
	--astar-stripe: var(--wp--custom--stripe, 6px);
	--astar-error: #b42318;
	--astar-error-bg: #fef3f2;
}

/* Phone ------------------------------------------------------------------ */

:where(.astar-phone) {
	margin: 0;
	font-family: var(--astar-display);
	font-weight: 700;
	line-height: 1.1;
}

.astar-phone__link {
	color: inherit;
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}

:where(.astar-phone__link):hover .astar-phone__number,
:where(.astar-phone__link):focus-visible .astar-phone__number {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.15em;
}

:where(.astar-phone--large) {
	font-size: clamp(2.25rem, 6vw, 3.75rem);
	line-height: 1;
}

:where(.astar-phone--large) .astar-phone__label {
	display: block;
	margin-bottom: 0.35rem;
	font-family: var(--wp--preset--font-family--body, inherit);
	font-size: 1.125rem;
	font-weight: 500;
	letter-spacing: 0;
}

:where(.astar-phone--large) .astar-phone__number {
	display: inline-block;
	padding-bottom: 0.3rem;
	border-bottom: var(--astar-stripe) solid var(--astar-signal);
}

:where(.astar-phone--large) .astar-phone__link:hover .astar-phone__number,
:where(.astar-phone--large) .astar-phone__link:focus-visible .astar-phone__number {
	text-decoration: none;
	border-bottom-color: currentColor;
}

/* Grids ------------------------------------------------------------------ */

:where(.astar-services, .astar-projects) {
	display: grid;
	gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 3vw, 2rem);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}

@media (min-width: 900px) {
	:where(.astar-cols-1) { grid-template-columns: 1fr; }
	:where(.astar-cols-2) { grid-template-columns: repeat(2, 1fr); }
	:where(.astar-cols-3) { grid-template-columns: repeat(3, 1fr); }
	:where(.astar-cols-4) { grid-template-columns: repeat(4, 1fr); }
}

/* Services: a thick brand stripe on top, like the edge of a job sign. */
:where(.astar-service) {
	border-top: var(--astar-stripe) solid var(--astar-brand);
	padding-top: 1rem;
}

:where(.astar-service__image) {
	display: block;
	margin-bottom: 1rem;
}

:where(.astar-service__image img) {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--astar-radius);
}

:where(.astar-service__title) {
	margin: 0 0 0.5rem;
	font-family: var(--astar-display);
	font-size: 1.5rem;
	line-height: 1.15;
}

.astar-service__title a {
	color: inherit;
	text-decoration: none;
}

:where(.astar-service__title a):hover,
:where(.astar-service__title a):focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

:where(.astar-service__summary) {
	margin: 0;
	color: var(--astar-muted);
}

/* Past work */
:where(.astar-projects) {
	list-style: none;
	margin: 0;
	padding: 0;
}

.astar-project a {
	display: block;
	color: inherit;
	text-decoration: none;
}

:where(.astar-project__photo) {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--astar-radius);
	background: var(--astar-surface);
}

:where(.astar-project__title) {
	display: block;
	margin-top: 0.65rem;
	font-weight: 600;
	line-height: 1.3;
}

:where(.astar-project a):hover .astar-project__title,
:where(.astar-project a):focus-visible .astar-project__title {
	text-decoration: underline;
}

:where(.astar-project__place) {
	display: block;
	font-size: 0.875rem;
	color: var(--astar-muted);
}

/* Reviews ---------------------------------------------------------------- */

:where(.astar-reviews) {
	display: grid;
	gap: clamp(2rem, 4vw, 3rem);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

:where(.astar-review) {
	margin: 0;
}

:where(.astar-review__stars) {
	margin: 0 0 0.6rem;
	color: var(--astar-brand);
	font-size: 1.125rem;
	letter-spacing: 0.15em;
	line-height: 1;
}

:where(.astar-review__stars-off) {
	color: var(--astar-line);
}

:where(.astar-review__text) {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 1.1875rem;
	line-height: 1.5;
}

:where(.astar-review__text p) {
	margin: 0 0 0.75em;
}

:where(.astar-review__who) {
	margin-top: 0.5rem;
	font-size: 0.9375rem;
	color: var(--astar-muted);
}

:where(.astar-review__name) {
	font-weight: 600;
	color: var(--astar-ink);
}

/* Lists from Business Info ------------------------------------------------- */

:where(.astar-areas) {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

:where(.astar-areas li) {
	padding: 0.3rem 0.8rem;
	border: 2px solid currentColor;
	border-radius: var(--astar-radius);
	font-family: var(--astar-display);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.2;
}

:where(.astar-hours) {
	list-style: none;
	margin: 0;
	padding: 0;
}

:where(.astar-contact) {
	margin: 0;
}

:where(.astar-contact__row) {
	margin-bottom: 0.85rem;
}

:where(.astar-contact dt) {
	font-size: 0.875rem;
	opacity: 0.8;
}

:where(.astar-contact dd) {
	margin: 0;
	font-weight: 500;
}

:where(.astar-trust) {
	font-weight: 500;
}

/* Quote form --------------------------------------------------------------- */

:where(.astar-quote) {
	color: var(--astar-ink);
	scroll-margin-top: 2rem;
}

:where(.astar-quote__form) > * + * {
	margin-top: 1.25rem;
}

:where(.astar-quote__grid) {
	display: grid;
	gap: 1.25rem;
}

@media (min-width: 640px) {
	:where(.astar-quote__grid) {
		grid-template-columns: 1fr 1fr;
	}
}

:where(.astar-quote__field) {
	margin-bottom: 0;
}

:where(.astar-quote__grid) > .astar-quote__field {
	margin: 0;
}

:where(.astar-quote__field label) {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
}

:where(.astar-quote__req) {
	font-weight: 400;
	color: var(--astar-muted);
}

:where(.astar-quote input[type="text"], .astar-quote input[type="tel"], .astar-quote input[type="email"], .astar-quote select, .astar-quote textarea) {
	box-sizing: border-box;
	width: 100%;
	min-height: 3rem;
	padding: 0.7rem 0.85rem;
	border: 2px solid var(--astar-line);
	border-radius: var(--astar-radius);
	background: #ffffff;
	color: var(--astar-ink);
	font: inherit;
	font-size: 1.0625rem;
	line-height: 1.4;
}

:where(.astar-quote textarea) {
	min-height: 8rem;
	resize: vertical;
}

:where(.astar-quote input, .astar-quote select, .astar-quote textarea):focus {
	border-color: var(--astar-brand);
	outline: 3px solid var(--astar-brand);
	outline-offset: 1px;
}

:where(.astar-quote [aria-invalid="true"]) {
	border-color: var(--astar-error);
}

:where(.astar-quote__field-error) {
	margin: 0.35rem 0 0;
	color: var(--astar-error);
	font-size: 0.9375rem;
	font-weight: 500;
}

:where(.astar-quote__errors) {
	padding: 1rem 1.25rem;
	border-left: var(--astar-stripe) solid var(--astar-error);
	background: var(--astar-error-bg);
	color: var(--astar-ink);
}

:where(.astar-quote__errors p, .astar-quote__errors ul) {
	margin: 0;
}

:where(.astar-quote__errors ul) {
	margin-top: 0.5rem;
	padding-left: 1.25rem;
}

:where(.astar-quote__errors a) {
	color: var(--astar-error);
}

:where(.astar-quote__hint) {
	margin-bottom: 0;
	font-size: 0.9375rem;
	color: var(--astar-muted);
}

:where(.astar-quote__consent) {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.25rem 0.75rem;
	align-items: start;
}

:where(.astar-quote__consent input) {
	width: 1.375rem;
	height: 1.375rem;
	margin: 0.1rem 0 0;
	accent-color: var(--astar-brand);
}

:where(.astar-quote__consent .astar-quote__field-error, .astar-quote__consent .astar-quote__field-hint) {
	grid-column: 2;
}

:where(.astar-quote__field-hint) {
	display: block;
	margin: 0.35rem 0 0;
	font-size: 0.9375rem;
	font-weight: 400;
	color: var(--astar-muted);
}

:where(.astar-quote__consent .astar-quote__field-hint) {
	margin-top: 0;
}

:where(.astar-quote__note) {
	margin-bottom: 0;
	font-size: 0.9375rem;
	color: var(--astar-muted);
}

:where(.astar-quote__note a) {
	color: var(--astar-ink);
}

:where(.astar-quote__submit) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1.25rem;
}

:where(.astar-quote__promise) {
	margin: 0;
	color: var(--astar-muted);
}

/* Button fallback for themes without their own button styles. */
:where(.astar-button) {
	padding: 0.8rem 1.5rem;
	border: 0;
	border-radius: var(--astar-radius);
	background: var(--astar-signal);
	color: var(--astar-on-signal);
	font-family: var(--astar-display);
	font-size: 1.3125rem;
	font-weight: 700;
	line-height: 1.1;
	cursor: pointer;
}

:where(.astar-button):hover {
	background: var(--astar-ink);
	color: #ffffff;
}

:where(.astar-button):focus-visible {
	outline: 3px solid var(--astar-ink);
	outline-offset: 3px;
}

/* Hidden trap for spam bots. Real visitors never see or fill it. */
.astar-quote__trap {
	position: absolute !important;
	left: -10000px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

:where(.astar-quote--sent) {
	padding: 1.5rem 1.5rem 1.25rem;
	border-left: var(--astar-stripe) solid var(--astar-brand);
	background: var(--astar-surface);
}

:where(.astar-quote--sent p) {
	margin: 0 0 0.6rem;
}

:where(.astar-quote__sent-title) {
	font-family: var(--astar-display);
	font-size: 1.625rem;
	font-weight: 700;
	line-height: 1.15;
}

/* Editor-only reminder when Business Info is empty. */
.astar-hint {
	margin: 0;
	padding: 0.75rem 1rem;
	border: 2px dashed currentColor;
	border-radius: var(--astar-radius);
	opacity: 0.75;
	font-size: 0.9375rem;
}

/* Phone bar ---------------------------------------------------------------- */

.astar-mobile-bar {
	display: none;
}

@media (max-width: 781px) {
	.astar-mobile-bar {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 100;
		display: grid;
		grid-template-columns: 1.4fr 1fr;
		padding-bottom: env(safe-area-inset-bottom, 0);
		background: var(--astar-brand);
		box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.15);
	}

	.astar-mobile-bar a {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 3.5rem;
		padding: 0 0.75rem;
		font-family: var(--astar-display);
		font-size: 1.1875rem;
		font-weight: 700;
		line-height: 1.1;
		text-align: center;
		text-decoration: none;
	}

	.astar-mobile-bar--single {
		grid-template-columns: 1fr;
	}

	/* "Email" is a short word, so the two buttons share the bar evenly. */
	.astar-mobile-bar--email {
		grid-template-columns: 1fr 1fr;
	}

	.astar-mobile-bar--email.astar-mobile-bar--single {
		grid-template-columns: 1fr;
	}

	.astar-mobile-bar__call {
		background: var(--astar-brand);
		color: var(--astar-on-brand);
	}

	.astar-mobile-bar__quote {
		background: var(--astar-signal);
		color: var(--astar-on-signal);
	}

	.astar-mobile-bar a:focus-visible {
		outline: 3px solid var(--astar-on-brand);
		outline-offset: -6px;
	}

	body.has-astar-mobile-bar {
		padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
	}
}

@media print {
	.astar-mobile-bar {
		display: none !important;
	}
}

/* [astar_social]: plain text links to Facebook and Instagram (0.2.11). */
.astar-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.astar-social__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.astar-social__list li {
	margin: 0;
}

.astar-social__link {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	min-height: 44px;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.astar-social__link:hover {
	text-decoration-thickness: 2px;
}

.astar-social__link:focus-visible {
	outline: 3px solid currentColor;
	outline-offset: 2px;
	border-radius: 2px;
}

.astar-social__ext {
	flex: none;
}

/* Promotion ribbon (0.2.13): a light strip under the menu, centred. The words slide in from
   the right once when the page opens, then stay still. No movement for people who ask their
   device for reduced motion. No loop, no script. */
.astar-promo {
	background: var(--wp--preset--color--surface, #f2f4f8);
	color: var(--astar-ink);
	border-bottom: 1px solid var(--wp--preset--color--line, #d5dae5);
	padding-left: var(--wp--style--root--padding-left, 1.25rem);
	padding-right: var(--wp--style--root--padding-right, 1.25rem);
	overflow: hidden;
}

.astar-promo__inner {
	max-width: var(--wp--style--global--wide-size, 75rem);
	margin: 0 auto;
	padding: 0.85rem 0;
	font-size: 1rem;
	line-height: 1.45;
	text-align: center;
	overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: no-preference) {
	.astar-promo__inner {
		animation: astar-promo-in 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
	}
}

@keyframes astar-promo-in {
	/* Slide only, no fade, so the text never has low contrast while it moves. */
	from {
		transform: translateX(60vw);
	}
	to {
		transform: none;
	}
}

.astar-promo__link {
	display: inline-block;
	color: var(--wp--preset--color--bronze, #8a5a00);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	white-space: nowrap;
	padding: 0.15rem 0;
}

.astar-promo__link:hover {
	color: var(--astar-ink);
}

.astar-promo__link:focus-visible {
	outline: 3px solid var(--astar-brand);
	outline-offset: 2px;
	border-radius: 2px;
}

@media print {
	.astar-promo {
		display: none;
	}
}

/* Offer page table: a real table that stays readable on a phone. */
.astar-offer-table table {
	width: 100%;
	border-collapse: collapse;
}

.astar-offer-table th,
.astar-offer-table td {
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--wp--preset--color--line, #d5dae5);
	text-align: left;
	vertical-align: top;
}

.astar-offer-table thead th {
	border-bottom-width: 2px;
}

.astar-offer-table caption {
	caption-side: top;
	text-align: left;
	font-weight: 600;
	padding-bottom: 0.5rem;
}

@media (max-width: 600px) {
	/* Stays a real table (screen readers keep the column names); just tighter. */
	.astar-offer-table th,
	.astar-offer-table td {
		padding: 0.5rem 0.35rem;
		font-size: 0.9rem;
	}
}
