/* ==========================================================================
   Site Footer — dark footer, mobile WhatsApp bar and the back-to-top button.
   ========================================================================== */

.mro-site-footer {
	position: relative;
	margin-top: var(--wp--preset--spacing--80);
	padding-block: var(--wp--preset--spacing--70) var(--wp--preset--spacing--60);
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--mint-faint);
}

/* the dark wave that rises out of the contact section */
.mro-site-footer::before {
	content: "";
	position: absolute;
	left: 0;
	bottom: calc(100% - 1px);
	width: 100%;
	height: clamp(2.5rem, 6vw, 5.5rem);
	background: var(--wp--preset--color--contrast);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'%3E%3Cpath d='M0 90V40c200-36 420-44 640-14s400 44 560 22c100-14 180-24 240-30v72z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'%3E%3Cpath d='M0 90V40c200-36 420-44 640-14s400 44 560 22c100-14 180-24 240-30v72z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
	pointer-events: none;
}

.mro-site-footer__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr);
	gap: var(--wp--preset--spacing--70);
}

/* the grid gap does the spacing; drop the editor's block-gap margins */
.mro-site-footer .mro-site-footer__inner > * {
	margin-block: 0;
}

.mro-site-footer .mro-brand {
	gap: var(--wp--preset--spacing--30);
}

.mro-site-footer .mro-brand__name {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--lg);
	font-weight: var(--wp--custom--weight--regular);
	line-height: 1;
	letter-spacing: var(--wp--custom--tracking--display);
	color: var(--wp--preset--color--base);
}

.mro-site-footer .mro-brand__name a {
	color: inherit;
	text-decoration: none;
}

/* logo placeholder — shows until a logo is set in the Site Logo block */
body:not(.editor-styles-wrapper) .mro-site-footer .mro-brand:not(:has(.wp-block-site-logo img))::before {
	content: "logo";
	flex: none;
	display: grid;
	place-items: center;
	width: 3.25rem;
	height: 3.25rem;
	border: var(--wp--custom--stroke--hand) dashed var(--wp--preset--color--mint);
	border-radius: 50%;
	background: var(--wp--preset--color--raised);
	color: var(--wp--preset--color--mint);
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: var(--wp--custom--weight--bold);
	line-height: 1;
}

.mro-site-footer__brand p {
	max-width: 38ch;
	margin-top: var(--wp--preset--spacing--50);
	color: var(--wp--preset--color--on-dark-muted);
}

.mro-site-footer .mro-site-footer__nav .wp-block-navigation__container {
	display: grid;
	gap: var(--wp--preset--spacing--20);
}

.mro-site-footer .mro-site-footer__nav .wp-block-navigation-item__content {
	padding: 0;
}

.mro-site-footer a {
	color: var(--wp--preset--color--mint-faint);
}

.mro-site-footer a:hover {
	color: var(--wp--preset--color--mint);
}

.mro-site-footer :focus-visible {
	outline-color: var(--wp--preset--color--mint);
}

.mro-site-footer .mro-site-footer__nav a {
	text-decoration: none;
}

.mro-site-footer__contact {
	display: grid;
	gap: var(--wp--preset--spacing--30);
	align-content: start;
}

.mro-site-footer__contact p {
	margin: 0;
}

.mro-site-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--10) var(--wp--preset--spacing--40);
}

.mro-site-footer .mro-site-footer__legal {
	margin-top: var(--wp--preset--spacing--70);
	padding-top: var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--raised);
	font-size: var(--wp--preset--font-size--sm);
	color: var(--wp--preset--color--on-dark-muted);
}

/* ---------- Mobile sticky WhatsApp bar ---------- */
.mro-sticky-cta {
	display: none;
}

.mro-sticky-cta .mro-icon {
	flex: none;
}

/* ---------- Back to top ---------- */
.mro-to-top {
	--mro-to-top-offset: var(--wp--preset--spacing--50);
	position: fixed;
	z-index: var(--wp--custom--layer--totop);
	right: var(--mro-to-top-offset);
	bottom: var(--mro-to-top-offset);
	display: grid;
	place-items: center;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 46% 54% 50% 50% / 54% 48% 52% 46%;
	background: var(--wp--preset--color--accent-strong);
	color: var(--wp--preset--color--base);
	box-shadow: 0 0 0 3px var(--wp--preset--color--base), var(--wp--preset--shadow--lift);
	transition:
		transform var(--wp--custom--duration--base) var(--wp--custom--ease--gentle),
		opacity var(--wp--custom--duration--base) var(--wp--custom--ease--gentle),
		background-color var(--wp--custom--duration--quick) var(--wp--custom--ease--gentle),
		visibility 0s;
}

.mro-to-top:hover {
	background: var(--wp--preset--color--accent-stronger);
}

.mro-to-top .mro-icon {
	transition: transform var(--wp--custom--duration--base) var(--wp--custom--ease--gentle);
}

.mro-to-top:hover .mro-icon {
	transform: translateY(-3px);
}

/* hidden until the visitor scrolls down; visibility waits for the fade so it can't take focus */
.mro-js .mro-to-top:not(.is-visible) {
	opacity: 0;
	transform: translateY(1.5rem);
	visibility: hidden;
	transition-delay: 0s, 0s, 0s, var(--wp--custom--duration--base);
}

@media (max-width: 1024px) {
	.mro-site-footer__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.mro-site-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 640px) {
	.mro-site-footer {
		padding-bottom: calc(var(--wp--preset--spacing--90) + var(--wp--preset--spacing--20));
	}

	.mro-site-footer__inner {
		grid-template-columns: minmax(0, 1fr);
	}

	body:not(.editor-styles-wrapper) .mro-site-footer .mro-brand:not(:has(.wp-block-site-logo img))::before {
		width: 2.75rem;
		height: 2.75rem;
	}

	.mro-site-footer .mro-brand__name {
		font-size: var(--wp--preset--font-size--md);
	}

	.mro-sticky-cta {
		position: fixed;
		z-index: var(--wp--custom--layer--stickycta);
		left: var(--wp--preset--spacing--30);
		right: var(--wp--preset--spacing--30);
		bottom: var(--wp--preset--spacing--30);
		display: flex;
		align-items: center;
		justify-content: center;
		gap: var(--wp--preset--spacing--20);
		min-height: 3.5rem;
		/* narrow side padding keeps the label on one line down to 360px,
			   so the bar stays 3.5rem tall and clear of the back-to-top button */
		padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
		border-radius: var(--wp--custom--radius--pill);
		background: var(--wp--preset--color--accent-strong);
		color: var(--wp--preset--color--base);
		font-weight: var(--wp--custom--weight--bold);
		text-decoration: none;
		box-shadow: var(--wp--preset--shadow--lift);
		transition: transform var(--wp--custom--duration--base) var(--wp--custom--ease--gentle), opacity var(--wp--custom--duration--base);
	}

	.mro-sticky-cta:hover {
		color: var(--wp--preset--color--base);
		background: var(--wp--preset--color--accent-stronger);
	}

	.mro-js .mro-sticky-cta:not(.is-visible) {
		transform: translateY(160%);
		opacity: 0;
		pointer-events: none;
	}

	/* sit above the WhatsApp bar */
	.mro-to-top {
		--mro-to-top-offset: var(--wp--preset--spacing--30);
		bottom: calc(var(--wp--preset--spacing--30) * 2 + 3.5rem);
		width: 3rem;
		height: 3rem;
	}
}
