/*
 * WordPress-side additions to the compiled Tailwind build in app.css.
 * Keep design tokens in app.css; this file only covers markup WordPress
 * generates and a few components that had no utility equivalent.
 */

/* Subtle blueprint grid behind hero sections. */
.ab-grid-bg {
	background-image: linear-gradient(hsl(var(--foreground)) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--foreground)) 1px, transparent 1px);
	background-size: 60px 60px;
}

/* Keep the fixed header below the admin bar when logged in. */
.admin-bar [data-site-header] {
	top: 32px;
}
@media (max-width: 782px) {
	.admin-bar [data-site-header] {
		top: 46px;
	}
}

html {
	scroll-behavior: smooth;
}
[id] {
	scroll-margin-top: 6rem;
}

/* Form placeholder: stands in for embedded forms until one is added. */
.ab-form-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 2rem;
	border: 2px dashed hsl(var(--border));
	border-radius: 1rem;
	background: hsl(var(--secondary) / 0.4);
	color: hsl(var(--muted-foreground));
	text-align: center;
}
.ab-form-placeholder svg {
	color: hsl(var(--primary));
	margin-bottom: 0.25rem;
}
.ab-form-placeholder__label {
	font-weight: 600;
	color: hsl(var(--foreground));
}
.ab-form-placeholder__hint {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.12em;
}

/* FAQ accordion built on <details>. */
.ab-faq > summary {
	cursor: pointer;
	list-style: none;
}
.ab-faq > summary::-webkit-details-marker {
	display: none;
}
.ab-faq[open] > summary svg {
	transform: rotate(180deg);
}

/* Editor content on project and legal pages. */
.ab-prose > * + * {
	margin-top: 1rem;
}
.ab-legal > * + * {
	margin-top: 2.5rem;
}
.ab-legal h2 {
	font-size: 1.25rem;
	line-height: 1.75rem;
	font-weight: 600;
	color: hsl(var(--foreground));
	margin-bottom: 0.75rem;
}
.ab-legal h2 + * {
	margin-top: 0;
}
.ab-legal a {
	color: hsl(var(--primary));
}
.ab-legal a:hover {
	text-decoration: underline;
}

/* Scroll reveal (only when JS is running, so content never stays hidden). */
.ab-js [data-reveal] {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.6s ease-out, transform 0.6s ease-out, border-color 0.5s;
}
.ab-js [data-reveal].is-visible {
	opacity: 1;
	transform: none;
}
.ab-js [data-reveal].is-visible.hover\:-translate-y-1:hover {
	transform: translateY(-0.25rem);
}
@media (prefers-reduced-motion: reduce) {
	.ab-js [data-reveal] {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* Project filter. */
[data-project-grid] > [hidden] {
	display: none;
}

/*
 * Contact Form 7, styled to match the original estimate form.
 * CF7's class: option can't carry Tailwind's bracket/colon classes, so the
 * generated controls are styled here with the same design tokens.
 */
.wpcf7 .ab-lead-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	text-align: left;
}
.wpcf7 .ab-field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.wpcf7 .ab-field__label {
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1;
}
.wpcf7 .wpcf7-form-control-wrap {
	display: block;
}
.wpcf7 input.wpcf7-text,
.wpcf7 input.wpcf7-tel,
.wpcf7 input.wpcf7-email,
.wpcf7 textarea.wpcf7-textarea {
	display: flex;
	width: 100%;
	height: 2.5rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid hsl(var(--input));
	border-radius: calc(var(--radius) - 2px);
	background: hsl(var(--background));
	color: hsl(var(--foreground));
	font: inherit;
	font-size: 1rem;
	line-height: 1.5rem;
}
.wpcf7 textarea.wpcf7-textarea {
	height: auto;
	min-height: 5rem;
}
@media (min-width: 768px) {
	.wpcf7 input.wpcf7-text,
	.wpcf7 input.wpcf7-tel,
	.wpcf7 input.wpcf7-email,
	.wpcf7 textarea.wpcf7-textarea {
		font-size: 0.875rem;
	}
}
.wpcf7 .wpcf7-form-control::placeholder {
	color: hsl(var(--muted-foreground));
	opacity: 1;
}
.wpcf7 .wpcf7-form-control:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}

/* Consent box. */
.wpcf7 .ab-consent {
	padding: 1rem;
	border: 1px solid hsl(var(--border));
	border-radius: 0.75rem;
	background: hsl(var(--secondary) / 0.4);
}
.wpcf7 .ab-consent .wpcf7-list-item {
	display: block;
	margin: 0;
}
.wpcf7 .ab-consent label {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	cursor: pointer;
}
.wpcf7 .ab-consent input[type="checkbox"] {
	flex-shrink: 0;
	width: 1rem;
	height: 1rem;
	margin: 0.25rem 0 0;
	accent-color: hsl(var(--primary));
}
.wpcf7 .ab-consent .wpcf7-list-item-label {
	font-size: 0.75rem;
	line-height: 1.625;
	color: hsl(var(--muted-foreground));
}
.wpcf7 .ab-consent a {
	color: hsl(var(--primary));
	text-decoration: underline;
}

/* Submit button (matches the hero / xl / full-width button). */
.wpcf7 .ab-submit {
	position: relative;
}
.wpcf7 input.wpcf7-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 3.5rem;
	padding: 0 2.5rem;
	border: 0;
	border-radius: 0.75rem;
	background: hsl(var(--primary));
	color: hsl(var(--primary-foreground));
	font: inherit;
	font-size: 1.125rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 0 40px hsl(150 25% 45% / 0.3);
	transition: all 0.3s;
}
.wpcf7 input.wpcf7-submit:hover {
	background: hsl(var(--primary) / 0.9);
	box-shadow: 0 0 60px hsl(150 25% 45% / 0.4);
	transform: scale(1.05);
}
.wpcf7 input.wpcf7-submit:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}
.wpcf7 input.wpcf7-submit:disabled {
	opacity: 0.5;
	pointer-events: none;
}
.wpcf7 .ab-submit .wpcf7-spinner {
	position: absolute;
	top: 50%;
	right: 1rem;
	margin: -12px 0 0;
}

/* Validation and response messages. */
.wpcf7 .wpcf7-not-valid-tip {
	margin-top: 0.5rem;
	font-size: 0.875rem;
	color: hsl(var(--destructive));
}
.wpcf7 .wpcf7-not-valid {
	border-color: hsl(var(--destructive));
}
.wpcf7 form .wpcf7-response-output {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem;
	border: 1px solid hsl(var(--destructive) / 0.4);
	border-radius: 0.75rem;
	background: hsl(var(--destructive) / 0.06);
	color: hsl(var(--destructive));
	font-size: 0.875rem;
}
/* Field tips already explain validation errors; the card swaps on success. */
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.sent .wpcf7-response-output,
.wpcf7 form.init .wpcf7-response-output {
	display: none;
}
