/*
 * Digger & Demo — theme CSS.
 * Only what theme.json and block styles can't express: focus rings, block-style geometry,
 * the phone header and call bar, and Gravity Forms skinning. Loaded on the front end and in the editor.
 */

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
:where([id]) { scroll-margin-top: 24px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { height: auto; }

/* ---------- Focus (2px clay on light, yellow on dark) ---------- */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--clay);
	outline-offset: 2px;
}
:where(.is-style-section-iron, .is-style-section-topsoil, .has-iron-background-color, .has-topsoil-background-color, .dd-dark)
	:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline-color: var(--wp--preset--color--digger-yellow);
}
/* Inputs inside the paper form card on a dark section are on a light ground again. */
:where(.dd-dark, .is-style-section-iron) .is-style-card :where(input, select, textarea, button):focus-visible {
	outline-color: var(--wp--preset--color--clay);
}

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--digger-yellow);
	color: var(--wp--preset--color--iron);
}

/* ---------- Dark grounds ---------- */
:where(.is-style-section-iron, .is-style-section-topsoil, .dd-dark, .wp-block-cover.is-dark, .wp-block-cover:not(.is-light)) .is-style-eyebrow { color: var(--wp--preset--color--digger-yellow); }
.dd-muted { color: var(--wp--preset--color--gravel); }
:where(.is-style-section-iron, .is-style-section-topsoil, .dd-dark, .wp-block-cover.is-dark, .wp-block-cover:not(.is-light)) .dd-muted { color: var(--wp--preset--color--dust-muted); }

/* ---------- Block styles ---------- */

/* Yellow bar — separator */
.wp-block-separator.is-style-yellow-bar {
	width: 64px;
	max-width: 64px;
	height: 6px;
	border: 0;
	background: var(--wp--preset--color--digger-yellow) !important;
	opacity: 1;
	margin-left: 0;
	margin-right: auto;
	margin-top: var(--wp--preset--spacing--space-4);
	margin-bottom: var(--wp--preset--spacing--space-4);
}

/* Cards */
.is-style-card, .is-style-card-yellow-top { overflow: hidden; }
.is-style-card > .wp-block-image:first-child img,
.is-style-card-yellow-top > .wp-block-image:first-child img,
.is-style-card > .wp-block-post-featured-image img { width: 100%; object-fit: cover; }

/* Yellow top rule (trust bar, steps) */
.dd-top-rule { border-top: 6px solid var(--wp--preset--color--digger-yellow); padding-top: var(--wp--preset--spacing--space-3); }

/* Outline button inherits its ground's text color */
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) { color: inherit; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	background: var(--wp--preset--color--digger-yellow);
	border-color: var(--wp--preset--color--digger-yellow);
	color: var(--wp--preset--color--iron);
}
.is-style-section-yellow .wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--iron);
	border-color: var(--wp--preset--color--iron);
}
.is-style-section-yellow .wp-block-button.is-style-outline > .wp-block-button__link:hover,
.is-style-section-yellow .wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	background: var(--wp--preset--color--iron);
	color: var(--wp--preset--color--dust);
}
.wp-block-button.is-style-small > .wp-block-button__link { padding: 13px 20px; font-size: 15px; }

/* Chip — button style and list style (town chips) */
.wp-block-button.is-style-chip > .wp-block-button__link,
.dd-chips a, .dd-chips span.dd-chip {
	display: block;
	background: transparent;
	color: inherit;
	font-weight: 600;
	font-size: 15px;
	letter-spacing: 0;
	line-height: 1.6;
	padding: 9px 14px;
	border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
	border-radius: 2px;
	text-decoration: none;
}
.dd-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dd-chips a:hover, .wp-block-button.is-style-chip > .wp-block-button__link:hover { border-color: currentColor; }
.dd-chips a.dd-chip--all {
	border-color: transparent;
	font-weight: 700;
	color: var(--wp--preset--color--clay);
}
:where(.is-style-section-iron, .is-style-section-topsoil, .dd-dark, .wp-block-cover.is-dark, .wp-block-cover:not(.is-light)) .dd-chips a.dd-chip--all { color: var(--wp--preset--color--digger-yellow); }
.dd-chips span.dd-chip { cursor: default; }

/* Plain link list (footer columns) */
.dd-link-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.dd-link-list a { text-decoration: none; }
.dd-link-list a:hover { text-decoration: underline; }

/* Numbered steps list (featured project) */
ol.is-style-steps { list-style: none; padding: 0; margin: 0; counter-reset: dd-step; font-weight: 600; font-size: 17px; }
ol.is-style-steps > li {
	counter-increment: dd-step;
	display: flex;
	gap: 16px;
	padding: 11px 0;
	border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}
ol.is-style-steps > li:last-child { border-bottom: 1px solid color-mix(in srgb, currentColor 20%, transparent); }
ol.is-style-steps > li::before {
	content: counter(dd-step, decimal-leading-zero);
	font-family: var(--wp--preset--font-family--display);
	font-size: 13px;
	min-width: 24px;
	padding-top: 3px;
	color: var(--wp--preset--color--clay);
}
:where(.is-style-section-iron, .is-style-section-topsoil, .dd-dark, .wp-block-cover.is-dark, .wp-block-cover:not(.is-light)) ol.is-style-steps > li::before { color: var(--wp--preset--color--digger-yellow); }

/* Check list (what's included) */
.dd-checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px 32px; }
.dd-checks li { display: flex; gap: 14px; align-items: flex-start; }
.dd-checks svg { flex: 0 0 24px; margin-top: 2px; }
.dd-checks strong { display: block; font-family: var(--wp--preset--font-family--display); font-size: 17px; line-height: 1.3; }
.dd-checks span span { color: var(--wp--preset--color--gravel); font-size: 15px; }

/* Photo labels — image styles */
.wp-block-image[class*="is-style-label-"] { position: relative; margin: 0; }
.wp-block-image[class*="is-style-label-"] img { display: block; width: 100%; object-fit: cover; }
.wp-block-image[class*="is-style-label-"] figcaption {
	position: absolute;
	left: 12px;
	top: 12px;
	margin: 0;
	padding: 6px 10px;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 11px;
	line-height: 1.2;
	letter-spacing: .14em;
	text-transform: uppercase;
}
.wp-block-image.is-style-label-yellow figcaption { background: var(--wp--preset--color--digger-yellow); color: var(--wp--preset--color--iron); }
.wp-block-image.is-style-label-dust figcaption { background: var(--wp--preset--color--dust); color: var(--wp--preset--color--iron); }
.wp-block-image.is-style-label-iron figcaption { background: var(--wp--preset--color--iron); color: var(--wp--preset--color--dust); }

/* Image that fills its column (split heroes, service area) */
.dd-fill { position: relative; min-height: 360px; margin: 0; }
.dd-fill img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; }
.wp-block-column.dd-fill-col { position: relative; min-height: 360px; }
.wp-block-column.dd-fill-col > .wp-block-image,
.wp-block-column.dd-fill-col > .wp-block-post-featured-image { position: absolute; inset: 0; margin: 0; height: 100%; }
.wp-block-column.dd-fill-col img { width: 100%; height: 100% !important; object-fit: cover; }

/* FAQ — details style */
.wp-block-details.is-style-faq { border-top: 1px solid var(--wp--preset--color--line); padding: 20px 0; margin: 0; }
.wp-block-details.is-style-faq:last-of-type { border-bottom: 1px solid var(--wp--preset--color--line); }
.wp-block-details.is-style-faq + .wp-block-details.is-style-faq { margin-top: 0; }
.wp-block-details.is-style-faq summary {
	cursor: pointer;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 19px;
	line-height: 1.3;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 16px;
	min-height: 44px;
	align-items: center;
}
.wp-block-details.is-style-faq summary::-webkit-details-marker { display: none; }
.wp-block-details.is-style-faq summary::after {
	content: "+";
	flex: 0 0 auto;
	font-size: 24px;
	line-height: 1;
	color: var(--wp--preset--color--clay);
}
.wp-block-details.is-style-faq[open] summary::after { content: "–"; }
.wp-block-details.is-style-faq > :not(summary) { margin-top: 12px; font-size: 17px; }

/* Before/after placeholder boxes (town pages before content exists) */
.dd-placeholder {
	border: 2px dashed var(--wp--preset--color--edge);
	border-radius: 4px;
	padding: 20px;
	color: var(--wp--preset--color--gravel);
}
.dd-placeholder strong { color: var(--wp--preset--color--iron); }

/* Review card */
.dd-review { margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; height: 100%; padding: 32px; box-sizing: border-box; }
.dd-review blockquote { margin: 0; font-size: 19px; line-height: 1.55; color: var(--wp--preset--color--dust-muted); border: 0; padding: 0; }
.dd-review figcaption { font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 15px; }
.dd-review figcaption span { font-weight: 400; color: var(--wp--preset--color--dust-muted); }

/* Link cards (services in town, related services) */
.dd-link-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.dd-link-card { display: flex; gap: 16px; align-items: center; background: var(--wp--preset--color--paper); border-radius: 4px; overflow: hidden; color: var(--wp--preset--color--iron); text-decoration: none; min-height: 112px; }
.dd-link-card img { width: 132px; height: 112px; object-fit: cover; flex: 0 0 132px; display: block; }
.dd-link-card strong { display: block; font-family: var(--wp--preset--font-family--display); font-size: 18px; line-height: 1.25; }
.dd-link-card .dd-more { font-weight: 700; color: var(--wp--preset--color--clay); font-size: 15px; }
.dd-link-card:hover strong { text-decoration: underline; }
.dd-related { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.dd-related a { display: block; background: var(--wp--preset--color--paper); border-radius: 4px; overflow: hidden; color: var(--wp--preset--color--iron); text-decoration: none; }
.dd-related img { display: block; width: 100%; height: 180px; object-fit: cover; }
.dd-related .dd-related__body { padding: 20px 24px; }
.dd-related h3 { margin: 0 0 4px; font-size: 20px; }
.dd-related .dd-more { font-weight: 700; color: var(--wp--preset--color--clay); }

/* Gallery */
.dd-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 8px; }
.dd-gallery img { display: block; width: 100%; height: 260px; object-fit: cover; }

/* Map */
.dd-map { position: relative; min-height: 360px; background: var(--wp--preset--color--dust); border-radius: 4px; overflow: hidden; }
.dd-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Breadcrumbs */
.dd-breadcrumbs { font-size: 14px; color: var(--wp--preset--color--dust-muted); }
.dd-breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dd-breadcrumbs li + li::before { content: "/"; margin-right: 6px; }
.dd-breadcrumbs a { color: inherit; }
.dd-breadcrumbs [aria-current] { color: var(--wp--preset--color--dust); }

/* Logo block */
.dd-logo { display: inline-block; line-height: 0; }
.dd-logo svg { display: block; height: 100%; width: auto; }
.dd-logo--header { height: 44px; }
.dd-logo--footer { height: auto; width: 240px; }
.dd-logo--footer svg { width: 100%; height: auto; }

/* Sticky sidebar card on wide screens */
@media (min-width: 782px) {
	.dd-sticky { position: sticky; top: calc(24px + var(--wp-admin--admin-bar--height, 0px)); }
}

/* ---------- Header ---------- */
.dd-header { border-bottom: 1px solid var(--wp--preset--color--line); }
.dd-header__phone a { color: var(--wp--preset--color--iron); text-decoration: none; font-family: var(--wp--preset--font-family--display); font-weight: 700; font-size: 16px; padding: 10px 0; }
.dd-call-icon { display: none; width: 48px; height: 48px; align-items: center; justify-content: center; color: var(--wp--preset--color--iron); }
.dd-header .wp-block-navigation__responsive-container-open { width: 48px; height: 48px; justify-content: center; align-items: center; }
.dd-header .wp-block-navigation__responsive-container-open svg { width: 28px; height: 28px; }
.dd-header .wp-block-navigation-item__content { padding: 10px 0; }

/* Phone bar (Call Now / Free Estimate) */
.dd-mobile-bar { display: none; }

@media (max-width: 781px) {
	.dd-hide-mobile { display: none !important; }
	header.wp-block-template-part { position: sticky; top: 0; z-index: 40; }
	.dd-header > .wp-block-group { min-height: 64px; }
	.dd-logo--header { height: 34px; }
	.dd-call-icon { display: flex; }
	.dd-header__nav { order: 3; }
	.dd-header__actions { order: 2; margin-left: auto; }

	.dd-mobile-bar {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 50;
		margin: 0 !important;
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
		background: var(--wp--preset--color--iron);
		border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--dust) 20%, transparent);
	}
	.dd-mobile-bar .wp-block-button { margin: 0; }
	.dd-mobile-bar .wp-block-button__link {
		display: flex;
		width: 100%;
		min-height: 48px;
		box-sizing: border-box;
		align-items: center;
		justify-content: center;
		gap: 8px;
		padding: 0 12px;
		font-size: 15px;
	}
	.dd-mobile-bar .dd-call-btn .wp-block-button__link { color: var(--wp--preset--color--dust); border-color: var(--wp--preset--color--dust); }
	.dd-mobile-bar .dd-call-btn .wp-block-button__link::before {
		content: "";
		width: 18px;
		height: 18px;
		background: currentColor;
		-webkit-mask: var(--dd-phone-icon) center / contain no-repeat;
		mask: var(--dd-phone-icon) center / contain no-repeat;
	}
	body { padding-bottom: calc(69px + env(safe-area-inset-bottom)); }

	/* Phone: stacked full-width hero buttons */
	.dd-stack-mobile.wp-block-buttons { flex-direction: column; align-items: stretch; }
	.dd-stack-mobile .wp-block-button__link { display: block; text-align: center; width: 100%; box-sizing: border-box; }
}
@media (min-width: 782px) {
	.dd-only-mobile { display: none !important; }
}
:root {
	--dd-phone-icon: 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='square'%3E%3Cpath d='M5 3h4l2 5-3 2a12 12 0 0 0 6 6l2-3 5 2v4a2 2 0 0 1-2 2A18 18 0 0 1 3 5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
}

/* Navigation overlay (phone menu) */
.dd-header .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--dust);
	padding: 24px;
}
.dd-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 700;
	font-size: 22px;
	padding: 8px 0;
}

/* ---------- Footer ---------- */
.dd-footer { font-size: 15px; }
.dd-footer .dd-link-list a { color: var(--wp--preset--color--dust); }
.dd-footer__bottom { border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--dust) 15%, transparent); }

/* ---------- Gravity Forms (estimate form) ---------- */
.dd-form .gform_wrapper.gform-theme {
	--gf-color-primary: var(--wp--preset--color--digger-yellow);
	--gf-color-primary-rgb: 245, 179, 36;
	--gf-color-primary-contrast: var(--wp--preset--color--iron);
	--gf-color-primary-darker: var(--wp--preset--color--yellow-deep);
	--gf-color-in-ctrl: #fff;
	--gf-color-in-ctrl-contrast: var(--wp--preset--color--iron);
	--gf-ctrl-border-color: var(--wp--preset--color--edge);
	--gf-ctrl-label-color-primary: var(--wp--preset--color--iron);
	--gf-ctrl-label-color-secondary: var(--wp--preset--color--gravel);
	--gf-ctrl-desc-color: var(--wp--preset--color--gravel);
	--gf-ctrl-radius: 2px;
	--gf-radius: 2px;
	--gf-ctrl-size: 48px;
	--gf-ctrl-font-size: 16px;
	--gf-ctrl-label-font-size-primary: 15px;
	--gf-ctrl-label-font-weight-primary: 600;
	--gf-font-family-base: var(--wp--preset--font-family--text);
	--gf-ctrl-btn-font-family: var(--wp--preset--font-family--text);
	--gf-ctrl-btn-font-size: 16px;
	--gf-ctrl-btn-font-weight: 700;
	--gf-ctrl-btn-letter-spacing: .04em;
	--gf-ctrl-btn-padding-x: 28px;
	--gf-ctrl-btn-size: 54px;
	--gf-ctrl-outline-color-focus: var(--wp--preset--color--clay);
	--gf-ctrl-shadow: none;
	--gf-form-gap-y: 20px;
}
.dd-form .gform_wrapper input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.dd-form .gform_wrapper select,
.dd-form .gform_wrapper textarea { font-size: 16px; }
.dd-form .gform_wrapper .gform_footer { align-items: center; gap: 16px; flex-wrap: wrap; }
.dd-form .gform_wrapper .gform_button { border-radius: 2px; }
.dd-form .gform_wrapper .gform_button:hover { background: var(--wp--preset--color--yellow-deep); }
.dd-form .gform_confirmation_message { font-size: 18px; }
.dd-form-fineprint { color: var(--wp--preset--color--gravel); }

/* ---------- Block helpers ---------- */
/* Hide a section whose only content is an empty dynamic block. */
.wp-block-group:has(> .dd-empty:only-child),
.wp-block-group:has(> .wp-block-group > .dd-empty:only-child):not(:has(> :not(.wp-block-group))) { display: none; }

.dd-split { display: grid; gap: 40px; }
@media (min-width: 782px) {
	.dd-split { gap: 56px; }
	.dd-split--60 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
	.dd-split--62 { grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); gap: 24px; }
}
.dd-split .wp-block-image[class*="is-style-label-"] img { height: 280px; }
.dd-services-grid .wp-block-post-title a { text-decoration: none; }
.dd-services-grid .wp-block-post-title a:hover { text-decoration: underline; }
.dd-services-grid .wp-block-post-featured-image { margin: 0; }
.dd-services-grid .wp-block-post-excerpt__excerpt { margin: 0; }
.dd-card-link { margin: 0; }
.dd-card-link a { color: var(--wp--preset--color--clay); }
.dd-body > .wp-block-post-content > h2:first-child { margin-top: 0; }
.dd-body h2 { font-size: clamp(28px, 3vw, 38px); }
.dd-body h3 { font-size: 22px; margin-top: 36px; }
.dd-body p, .dd-body li { font-size: var(--wp--preset--font-size--body-l); }
/* Sections butt against each other and the header/footer. */
.wp-site-blocks > * + * { margin-block-start: 0; }
main > * + * { margin-block-start: 0; }
.is-style-eyebrow + .wp-block-heading { margin-top: 0; }
p.is-style-eyebrow:has(+ h2) { margin-bottom: 12px; }
.dd-form .gform_wrapper .gform_button:hover,
.dd-form .gform_wrapper .gform_button:focus-visible { background: var(--wp--preset--color--yellow-deep) !important; color: var(--wp--preset--color--iron) !important; }
.dd-form .gform_wrapper .gform_button { font-weight: 700; letter-spacing: .04em; }
.dd-form .gform_wrapper :where(input:not([type="hidden"]), select) { min-height: 48px; }

/* Eyebrow, also for markup printed by PHP blocks (WordPress only emits block-style CSS for blocks it renders). */
:is(p, h2, h3, span).is-style-eyebrow {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: .16em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--wp--preset--color--clay);
}
:where(.is-style-section-iron, .is-style-section-topsoil, .dd-dark, .wp-block-cover:not(.is-light)) :is(p, h2, h3, span).is-style-eyebrow { color: var(--wp--preset--color--digger-yellow); }
/* Same for dark cards printed by PHP blocks. */
.dd-review.is-style-section-iron { background: var(--wp--preset--color--iron); color: var(--wp--preset--color--dust); }

/* Phone fixes */
@media (max-width: 781px) {
	.dd-header > .wp-block-group { flex-wrap: nowrap; gap: 8px; }
	.dd-header__actions { gap: 0; }
	.dd-header .dd-logo { flex: 0 1 auto; min-width: 0; }
	.dd-mobile-bar .wp-block-button { width: 100%; }
	.dd-mobile-bar .dd-call-btn.is-style-outline > .wp-block-button__link:not(.has-text-color) {
		color: var(--wp--preset--color--dust);
		border-color: var(--wp--preset--color--dust);
		background: transparent;
	}
}
@media (max-width: 781px) {
	.wp-block-buttons.dd-mobile-bar { display: grid; flex-wrap: nowrap; }
}
@media (max-width: 781px) {
	:where([id]) { scroll-margin-top: 72px; }
}
