/* =========================================================================
   MM8 Trades Template — front-end enhancements
   Layers premium detail on top of theme.json: load animation, hover motion,
   sticky header, decorative touches. All colors reference the theme.json
   palette via CSS custom properties, so a reskin needs no edits here.
   ========================================================================= */

:root {
	--mm8-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--mm8-shadow-soft: 0 1px 2px rgba(22, 36, 46, 0.04), 0 12px 32px -16px rgba(22, 36, 46, 0.18);
	--mm8-shadow-lift: 0 2px 6px rgba(22, 36, 46, 0.06), 0 28px 56px -24px rgba(22, 36, 46, 0.30);
}

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* Subtle paper grain across the whole canvas for depth, not flatness. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	opacity: 0.5;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}
.wp-site-blocks { position: relative; z-index: 1; }

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */
.mm8-header {
	position: sticky;
	top: 0;
	z-index: 50;
	backdrop-filter: saturate(120%) blur(10px);
	-webkit-backdrop-filter: saturate(120%) blur(10px);
	background-color: rgba(244, 241, 234, 0.82);
}
/* The header uses a wider content area than the body sections, so the logo and
   Call button sit closer to the screen edges and the bar feels fuller. The
   theme's root padding still keeps a sensible gutter so nothing touches the
   edge. Only the header is affected; body sections keep the 1240px wide size. */
.mm8-header > .alignwide { max-width: 1500px; }
.mm8-header .wp-block-navigation a {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: 0.01em;
	color: var(--wp--preset--color--ink);
	transition: color 0.25s var(--mm8-ease);
}
.mm8-header .wp-block-navigation a:hover { color: var(--wp--preset--color--amber); }

/* Branded logo placeholder. Shows until a real Site Logo is set; once one is,
   WordPress adds .wp-custom-logo to <body> and the placeholder hides, leaving
   the real logo in its place. */
.mm8-logo-placeholder {
	font-family: var(--wp--preset--font-family--display);
	font-size: 1.4rem;
	font-weight: 500;
	letter-spacing: -0.005em;
	line-height: 1;
	color: var(--wp--preset--color--navy);
	white-space: nowrap;
}
body.wp-custom-logo .mm8-logo-placeholder { display: none; }
.mm8-header .custom-logo { max-height: 52px; width: auto; }

/* -------------------------------------------------------------------------
   Eyebrow label (small uppercase kicker above headings)
   ------------------------------------------------------------------------- */
.mm8-eyebrow {
	font-family: var(--wp--preset--font-family--body);
	text-transform: uppercase;
	letter-spacing: 0.22em;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--wp--preset--color--amber);
}
.mm8-eyebrow.has-amber-soft-color { color: var(--wp--preset--color--amber-soft); }

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.mm8-hero {
	position: relative;
	overflow: hidden;
}
.mm8-hero .wp-block-cover__inner-container { width: 100%; }
.mm8-hero h1 {
	text-wrap: balance;
}
/* A thin amber rule under the hero kicker as a confident, quiet flourish. */
.mm8-hero .mm8-eyebrow::after {
	content: "";
	display: block;
	width: 3.5rem;
	height: 2px;
	margin-top: 0.85rem;
	background: var(--wp--preset--color--amber);
}
/* Local-area emphasis: a map pin before the "serving ..." line. Local trust is
   a top conversion driver, so this reads as intentional, not decorative. */
.mm8-hero-local::before {
	content: "";
	display: inline-block;
	width: 0.95em;
	height: 0.95em;
	margin-right: 0.5em;
	vertical-align: -0.12em;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.1 2 5 5.1 5 9c0 5.2 7 13 7 13s7-7.8 7-13c0-3.9-3.1-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.1 2 5 5.1 5 9c0 5.2 7 13 7 13s7-7.8 7-13c0-3.9-3.1-7-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Financing / trust line under the hero CTAs. Its own block, easy to remove. */
.mm8-hero-trustline {
	font-weight: 600;
	letter-spacing: 0.02em;
	opacity: 0.95;
}

/* -------------------------------------------------------------------------
   Section rhythm helpers
   ------------------------------------------------------------------------- */
.mm8-section { padding-block: var(--wp--preset--spacing--70); }

/* Cards (services, reviews) */
.mm8-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--mist);
	border-radius: 0;
	box-shadow: var(--mm8-shadow-soft);
	transition: transform 0.35s var(--mm8-ease), box-shadow 0.35s var(--mm8-ease), border-color 0.35s var(--mm8-ease);
	height: 100%;
}
.mm8-card:hover {
	transform: translateY(-6px);
	box-shadow: var(--mm8-shadow-lift);
	border-color: var(--wp--preset--color--amber-soft);
}
/* Icon must be a fixed, modest size. It is an inline <span> in the markup, so
   it needs an explicit display + dimensions, and the SVG is sized in px (not
   100%) so it can never scale up to fill the card. */
.mm8-card .mm8-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	/* left-align the badge to match the left-aligned title and text.
	   Core's constrained-layout centering uses !important, so we must too. */
	margin-top: 0 !important;
	margin-bottom: 0.35rem !important;
	margin-left: 0 !important;
	margin-right: auto !important;
	border-radius: 0;
	background: rgba(16, 60, 80, 0.08);
	color: var(--wp--preset--color--navy);
	flex: 0 0 auto;
}
.mm8-card .mm8-icon svg {
	display: block;
	width: 30px;
	height: 30px;
}

/* -------------------------------------------------------------------------
   Gallery
   ------------------------------------------------------------------------- */
.mm8-gallery .wp-block-image,
.mm8-gallery figure {
	overflow: hidden;
	border-radius: 0;
}
.mm8-gallery img {
	border-radius: 0;
	transition: transform 0.6s var(--mm8-ease);
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.mm8-gallery .wp-block-image:hover img { transform: scale(1.06); }

/* -------------------------------------------------------------------------
   Trust bar
   ------------------------------------------------------------------------- */
.mm8-trustbar {
	border-bottom: 1px solid var(--wp--preset--color--mist);
	/* a confident amber rule across the top so the band reads as a statement,
	   not a thin afterthought */
	border-top: 3px solid var(--wp--preset--color--amber);
}
.mm8-trustbar .mm8-stat { position: relative; }
/* hairline divider between stats on wider screens */
.mm8-trustbar .mm8-stat + .mm8-stat::before {
	content: "";
	position: absolute;
	left: -0.75rem;
	top: 50%;
	transform: translateY(-50%);
	width: 1px;
	height: 2.8rem;
	background: var(--wp--preset--color--mist);
}
.mm8-trustbar .mm8-stat h3 {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(2.4rem, 4vw, 3.3rem);
	font-weight: 500;
	color: var(--wp--preset--color--navy);
	line-height: 1;
	letter-spacing: -0.02em;
}
.mm8-trustbar .mm8-stat p {
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
}
@media (max-width: 680px) {
	.mm8-trustbar .wp-block-columns { flex-wrap: wrap; }
	.mm8-trustbar .wp-block-column { flex-basis: 42% !important; flex-grow: 1; }
	.mm8-trustbar .mm8-stat + .mm8-stat::before { display: none; }
}

/* -------------------------------------------------------------------------
   Reviews
   ------------------------------------------------------------------------- */
.mm8-quote { position: relative; }
.mm8-quote::before {
	content: "\201C";
	position: absolute;
	top: -0.35em;
	left: 0.4rem;
	font-family: var(--wp--preset--font-family--display);
	font-size: 5rem;
	line-height: 1;
	color: var(--wp--preset--color--amber-soft);
	opacity: 0.7;
}

/* -------------------------------------------------------------------------
   CTA band
   ------------------------------------------------------------------------- */
.mm8-cta h2 { text-wrap: balance; }

/* -------------------------------------------------------------------------
   Contact form
   ------------------------------------------------------------------------- */
.mm8-form { display: grid; gap: 1rem; }
.mm8-form .mm8-field-row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .mm8-form .mm8-field-row { grid-template-columns: 1fr; } }
.mm8-form label {
	display: block;
	font-size: 0.82rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone);
	margin-bottom: 0.4rem;
}
.mm8-form input,
.mm8-form textarea {
	width: 100%;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--mist);
	border-radius: 0;
	padding: 0.8rem 0.9rem;
	transition: border-color 0.25s var(--mm8-ease), box-shadow 0.25s var(--mm8-ease);
}
.mm8-form input:focus,
.mm8-form textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--navy);
	box-shadow: 0 0 0 3px rgba(16, 60, 80, 0.12);
}
.mm8-form .mm8-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.mm8-form button {
	justify-self: start;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 600;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--white);
	background: var(--wp--preset--color--amber);
	border: none;
	border-radius: 0;
	padding: 0.95rem 2rem;
	cursor: pointer;
	transition: background-color 0.25s var(--mm8-ease), transform 0.25s var(--mm8-ease);
}
.mm8-form button:hover { background: var(--wp--preset--color--ink); transform: translateY(-2px); }
.mm8-form-note {
	font-size: 0.9rem;
	border-radius: 0;
	padding: 0.8rem 1rem;
}
.mm8-form-note.is-sent { background: rgba(16, 60, 80, 0.10); color: var(--wp--preset--color--navy); }
.mm8-form-note.is-error { background: rgba(231, 161, 43, 0.16); color: var(--wp--preset--color--amber); }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.mm8-footer a { color: var(--wp--preset--color--amber-soft); }
.mm8-footer a:hover { color: var(--wp--preset--color--white); }

/* -------------------------------------------------------------------------
   Load animation — one orchestrated, staggered reveal on first paint.
   Respects reduced-motion.
   ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
	.mm8-reveal > * {
		opacity: 0;
		transform: translateY(18px);
		animation: mm8-rise 0.9s var(--mm8-ease) forwards;
	}
	.mm8-reveal > *:nth-child(1) { animation-delay: 0.05s; }
	.mm8-reveal > *:nth-child(2) { animation-delay: 0.16s; }
	.mm8-reveal > *:nth-child(3) { animation-delay: 0.27s; }
	.mm8-reveal > *:nth-child(4) { animation-delay: 0.38s; }
	.mm8-reveal > *:nth-child(5) { animation-delay: 0.49s; }

	/* Scroll-revealed sections fade up once when they enter the viewport.
	   Gated behind .mm8-js (set by app.js) so content is never hidden if
	   JavaScript fails to run. */
	.mm8-js .mm8-inview {
		opacity: 0;
		transform: translateY(26px);
		transition: opacity 0.8s var(--mm8-ease), transform 0.8s var(--mm8-ease);
		will-change: opacity, transform;
	}
	.mm8-js .mm8-inview.is-visible { opacity: 1; transform: none; }
}

@keyframes mm8-rise {
	to { opacity: 1; transform: none; }
}
