/*
Theme Name:        Maybuild Child
Description:       Child theme of Hello Elementor for the Maybuild website. Holds site-specific CSS and JS only; page layouts and content live in Elementor.
Author:            Acorn Digital
Author URI:        https://acorndigital.com.au
Template:          hello-elementor
Version:           0.2.0
Requires at least: 6.5
Requires PHP:      8.0
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       maybuild-child
*/

/*
 * Only what Elementor Free cannot reproduce from the approved prototype
 * (prototype/css/style.css). Content, typography, colours, layout and spacing
 * are set with native Elementor controls; rules here are scoped to mb- classes
 * set in Elementor > Advanced > CSS Classes. Section numbers follow the prototype.
 */

/* 1. TOKENS ---------------------------------------------------------------- */
/* Colours come from Elementor Site Settings (Global Colours); the kit defines
   them on body, so the aliases are declared on body too. */
body {
	--mb-gutter: clamp(1.25rem, 4vw, 4rem);
	--mb-section-y: clamp(5rem, 3rem + 7vw, 10rem);
	--mb-header-h: 92px;
	--mb-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
	--mb-ink: var(--e-global-color-primary, #231f20);
	--mb-stone: var(--e-global-color-secondary, #a09f9f);
	--mb-oak: var(--e-global-color-accent, #b08a62);
	--mb-oak-deep: var(--e-global-color-mboakdeep, #8c6a47);
	--mb-sand: var(--e-global-color-mbsand, #e6e1da);
	--mb-line-dark: var(--e-global-color-mblinedark, rgba(255, 255, 255, 0.14));
}
@media (max-width: 1024px) { body { --mb-header-h: 80px; } }
@media (max-width: 560px) { body { --mb-header-h: 72px; } }

/* 2. BASE (prototype resets that differ from Hello Elementor's reset.css) --- */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; text-rendering: optimizeLegibility; }
a, a:hover, a:active { color: inherit; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
figure { margin: 0; }
figcaption { font-style: normal; }
.elementor-widget-image img { display: block; }
.elementor-widget-image a { display: block; } /* Elementor's inline-block adds a line box under images */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:not([tabindex="-1"]):focus-visible {
	outline: 2px solid var(--mb-oak);
	outline-offset: 3px;
	box-shadow: none;
}
[id] { scroll-margin-top: calc(var(--mb-header-h) - 1px); }

.skip-link:not(:focus) {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
	position: fixed; top: 12px; left: 12px; z-index: 200;
	background: #fff; color: var(--mb-ink); padding: 10px 16px;
}

/* 4. TYPOGRAPHY DETAILS ---------------------------------------------------- */
/* Eyebrow: tracked caps + oak diamond. The margin sits on the inline-flex title,
   as in the prototype, so line-box spacing matches exactly. */
.mb-eyebrow .elementor-heading-title {
	display: inline-flex;
	align-items: center;
	gap: 0.9rem;
	margin: 0 0 1.5rem;
}
.mb-eyebrow--tight .elementor-heading-title { margin-bottom: 1.25rem; }
.mb-eyebrow .elementor-heading-title::before,
.mb-chip .elementor-heading-title::before {
	content: "";
	flex: none;
	width: 7px;
	height: 7px;
	border: 1px solid var(--mb-oak);
	transform: rotate(45deg);
}
.mb-display .tone { color: var(--mb-stone); }

/* 5. BUTTONS & LINKS ------------------------------------------------------- */
.mb-btn .elementor-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 54px;
	transition: background-color 0.3s var(--mb-ease), color 0.3s var(--mb-ease), border-color 0.3s var(--mb-ease);
}
.mb-btn--sm .elementor-button { min-height: 44px; }
.mb-link-arrow .elementor-button {
	display: inline-flex;
	align-items: center;
	transition: color 0.3s var(--mb-ease), border-color 0.3s var(--mb-ease);
}
.elementor-button .elementor-button-icon svg,
.mb-arrow .elementor-icon svg {
	width: 18px;
	height: 18px;
	fill: none !important;
	stroke: currentColor;
	stroke-width: 1.4;
	transition: transform 0.35s var(--mb-ease);
}
.elementor-button:hover .elementor-button-icon svg { transform: translateX(4px); }
/* Where the prototype's link/icon is a flex or grid item it has no line box */
.mb-link-arrow--item .elementor-button { display: flex; }
.mb-arrow .elementor-icon-wrapper,
.mb-arrow .elementor-icon { display: block; line-height: 0; }
.mb-arrow .elementor-icon svg { display: block; }

/* Image frames, proportions and hover zoom */
.mb-frame img {
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	background: var(--mb-sand);
}
.mb-img-hover a,
.mb-img-hover.mb-detail { display: block; overflow: hidden; }
.mb-img-hover img { transition: transform 1.1s var(--mb-ease); }
.mb-img-hover a:hover img,
.mb-img-hover.mb-detail:hover img { transform: scale(1.04); }

/* 6. HEADER ---------------------------------------------------------------- */
/* UAE sets #masthead to position: relative; the prototype header is sticky */
body.ehf-header #masthead { position: sticky; top: 0; z-index: 100; }
body.ehf-header.admin-bar #masthead { top: 32px; }
@media (max-width: 782px) { body.ehf-header.admin-bar #masthead { top: 46px; } }

.mb-header {
	height: var(--mb-header-h);
	border-bottom: 1px solid transparent;
	transition: height 0.35s var(--mb-ease), border-color 0.35s var(--mb-ease);
}
.mb-header > .e-con-inner { height: 100%; }
.mb-header.is-scrolled { --mb-header-h: 76px; border-bottom-color: var(--mb-line-dark); }
.mb-header__logo img { width: auto; transition: height 0.35s var(--mb-ease); }
body .mb-header.is-scrolled .mb-header__logo img { height: 48px; }

.mb-nav .hfe-nav-menu { gap: clamp(1.5rem, 2.6vw, 2.75rem); }
.mb-nav .hfe-nav-menu > li { display: block; }
/* Inline links with vertical padding, as in the prototype (padding does not grow the line box) */
.mb-nav a.hfe-menu-item { display: inline; position: relative; transition: color 0.3s var(--mb-ease); }
.mb-nav a.hfe-menu-item::after {
	content: "";
	position: absolute; left: 0; right: 0; bottom: 0;
	height: 1px;
	background: var(--mb-oak);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.35s var(--mb-ease);
	opacity: 1 !important; /* UAE hides link pseudo-elements unless the <a> itself is "current" */
}
.mb-nav a.hfe-menu-item:hover::after,
.mb-nav .current-menu-item > a.hfe-menu-item::after,
.mb-nav .current-page-ancestor > a.hfe-menu-item::after { transform: scaleX(1); }
/* Projects is highlighted on its project pages (WordPress marks it as the ancestor page) */
body .mb-nav.elementor-element .menu-item.current-page-ancestor > a.hfe-menu-item { color: var(--e-global-color-mbwhite); }
/* The prototype has no colour change on mouse focus (UAE reuses the hover colour) */
body .mb-nav.elementor-element .menu-item:not(.current-menu-item):not(.current-page-ancestor) a.hfe-menu-item:focus:not(:focus-visible):not(:hover) {
	color: var(--e-global-color-mbwhite78);
}

/* Menu toggle: two bars that cross into an X (prototype .nav-toggle) */
.mb-nav-toggle .elementor-button {
	position: relative;
	display: block;
	width: 44px;
	height: 44px;
	padding: 0;
}
.mb-nav-toggle .elementor-button-content-wrapper {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.mb-nav-toggle .elementor-button::before,
.mb-nav-toggle .elementor-button::after {
	content: "";
	position: absolute; left: 10px; right: 10px;
	height: 1.5px;
	background: currentColor;
	transition: transform 0.35s var(--mb-ease), top 0.35s var(--mb-ease);
}
.mb-nav-toggle .elementor-button::before { top: 18px; }
.mb-nav-toggle .elementor-button::after { top: 25px; }
.mb-nav-toggle .elementor-button[aria-expanded="true"]::before { top: 21.5px; transform: rotate(45deg); }
.mb-nav-toggle .elementor-button[aria-expanded="true"]::after { top: 21.5px; transform: rotate(-45deg); }

/* Mobile menu panel (prototype .mobile-menu) */
.mb-mobile-menu {
	position: fixed !important;
	inset: var(--mb-header-h) 0 0 0;
	z-index: 99;
	overflow-y: auto;
	opacity: 0;
	transition: opacity 0.3s var(--mb-ease);
}
.mb-mobile-menu.is-open { opacity: 1; }
/* Hidden until opened everywhere except the header template's own editor (single-elementor-hf),
   so page editors match the visitor view and the panel stays editable in the header template. */
body:not(.single-elementor-hf) .mb-mobile-menu:not(.is-visible) { display: none !important; }
body.elementor-editor-active.single-elementor-hf .mb-mobile-menu { position: relative !important; inset: auto; opacity: 1; }
body.menu-open { overflow: hidden; }
.mb-mobile-nav li { border-bottom: 1px solid var(--mb-line-dark); }
.mb-mobile-nav a.hfe-menu-item { display: block; }

/* 7. SECTIONS -------------------------------------------------------------- */

/* Hero */
.elementor-widget.mb-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mb-hero-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 58%;
	animation: mb-hero-in 1.6s var(--mb-ease) both;
}
/* Project page photo bands: framing for portrait photos whose subject sits high (Beacon Hill deck and view) */
.mb-hero-img.mb-hero-img--upper img { object-position: 50% 35%; }
.elementor-widget.mb-chip {
	position: absolute;
	right: var(--mb-gutter);
	bottom: 1.25rem;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
.mb-chip .elementor-heading-title { display: flex; align-items: center; gap: 0.7rem; }
.mb-hero-meta-item span { color: #fff; }

/* Intro / Services frames */
@media (max-width: 768px) {
	.mb-frame--md-4x3 img { aspect-ratio: 4 / 3; }
	.mb-frame--services img { object-position: 50% 65%; }
}
@media (min-width: 1025px) {
	.mb-sticky { position: sticky !important; top: calc(var(--mb-header-h) + 3rem); }
}
.mb-service { transition: padding 0.4s var(--mb-ease); }
.mb-service .mb-arrow .elementor-icon {
	opacity: 0.5;
	transition: opacity 0.3s, transform 0.35s var(--mb-ease), color 0.3s;
}
.mb-service:hover .mb-arrow .elementor-icon {
	opacity: 1;
	color: var(--mb-oak) !important;
	transform: translateX(4px);
}

/* Projects */
.mb-feature-img img {
	width: 100%;
	aspect-ratio: 16 / 11;
	object-fit: cover;
	object-position: 50% 60%;
}
.mb-details > .e-con-inner { height: clamp(220px, 26vw, 400px); }
.mb-detail img { width: 100%; height: 100%; object-fit: cover; }
.mb-detail--2 img { object-position: 50% 70%; }
.mb-card-img img { width: 100%; object-fit: cover; }
.mb-card-img--tall img { aspect-ratio: 4 / 5; object-position: 50% 20%; }
.mb-card-img--wide img { aspect-ratio: 4 / 3; }
.mb-card-img--grid img { aspect-ratio: 4 / 5; } /* Projects page grid: consistent 4:5 thumbnails (4:3 when single-column on tablets) */
.mb-card-info { --align-items: baseline; }

/* Project galleries: Basic Gallery laid out as a 3 / 2 column grid of 4:5 cover-cropped tiles
   (12px gap); the lightbox opens the full, uncropped image. */
.mb-gallery .gallery {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 0 !important;
}
.mb-gallery .gallery-item { width: auto !important; max-width: none !important; margin: 0 !important; padding: 0 !important; }
.mb-gallery .gallery-icon,
.mb-gallery .gallery-icon a { display: block; overflow: hidden; }
.mb-gallery .gallery img {
	display: block;
	width: 100% !important;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border: 0 !important;
	background: var(--mb-sand);
	transition: transform 1.1s var(--mb-ease);
}
.mb-gallery .gallery-icon a:hover img { transform: scale(1.04); }
.mb-gallery .gallery br { display: none; }

/* "Back to projects": the arrow points back and nudges left on hover */
.mb-link-back .elementor-button-icon svg { transform: scaleX(-1); }
.mb-link-back .elementor-button:hover .elementor-button-icon svg { transform: scaleX(-1) translateX(4px); }
a.mb-pi { transition: padding 0.4s var(--mb-ease), color 0.3s; }
a.mb-pi:hover { --padding-left: 1rem; }
a.mb-pi:hover .mb-pi__name .elementor-heading-title { color: var(--mb-oak-deep); }

/* Contact */
.mb-contact-mark { pointer-events: none; }

/* Enquiry form (Fluent Forms markup styled as prototype .form / .field / .form__submit) */
/* Row gap = the prototype's submit-row gap (1rem); field rows add 0.75rem to make
   its 1.75rem form gap, and the last field adds 0.5rem for .form__submit's top margin. */
.mb-form .fluentform fieldset {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 1.5rem;
	row-gap: 1rem;
}
.mb-form .fluentform fieldset > .ff-t-container,
.mb-form .fluentform fieldset > .ff-el-group:not(.mb-form-note-wrap):not(.ff_submit_btn_wrapper) { flex: 1 1 100%; margin-bottom: 0.75rem; }
.mb-form .fluentform fieldset > .ff-el-group:not(.mb-form-note-wrap):not(.ff_submit_btn_wrapper):has(textarea) { margin-bottom: 1.25rem; }
.mb-form .fluentform .ff-t-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.75rem 2rem;
	margin: 0;
}
.mb-form .fluentform .ff-t-container .ff-t-cell { flex-basis: auto !important; width: auto; padding: 0 !important; }
.mb-form .fluentform .ff-el-group { display: block; margin: 0; }
.mb-form .fluentform .ff-el-input--label { display: block; margin: 0 0 0.35rem; padding: 0; }
.mb-form .fluentform .ff-el-input--label label {
	display: block;
	margin: 0;
	font-family: Inter, "Helvetica Neue", Arial, sans-serif;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.7;
	letter-spacing: 0.04em;
	color: var(--mb-stone);
}
.mb-form .fluentform .ff-el-is-required.asterisk-right label::after { content: none !important; }
.mb-form .fluentform .ff-el-form-control {
	width: 100%;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 0.75rem 0;
	font: inherit;
	font-size: 1.0625rem;
	line-height: 1.7;
	color: #fff;
	background: transparent;
	border: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 0;
	box-shadow: none;
	transition: border-color 0.3s var(--mb-ease);
}
.mb-form .fluentform textarea.ff-el-form-control { resize: vertical; min-height: 7rem; }
.mb-form .fluentform .ff-el-form-control::placeholder { color: rgba(255, 255, 255, 0.35); opacity: 1; }
.mb-form .fluentform .ff-el-form-control:focus { outline: none; border-bottom-color: var(--mb-oak); }
.mb-form .fluentform .ff-el-is-error .ff-el-form-control { border-bottom-color: #e08a7a; }
.mb-form .fluentform .error.text-danger {
	margin: 0.35rem 0 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #e08a7a;
}
.mb-form .fluentform .ff_submit_btn_wrapper { order: 1; flex: 0 0 auto; margin: 0; }
.mb-form .fluentform .mb-form-note-wrap { order: 2; flex: 0 1 auto; margin: 0; }
.mb-form-note { margin: 0; font-size: 0.8125rem; line-height: 1.7; color: var(--mb-stone); }
.mb-form .fluentform .ff-btn-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.85rem;
	min-height: 54px;
	padding: 0 1.75rem;
	font-family: Jost, "Helvetica Neue", Arial, sans-serif;
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	box-shadow: none;
	transition: background-color 0.3s var(--mb-ease), color 0.3s var(--mb-ease), border-color 0.3s var(--mb-ease);
} /* colours, border and type are set in the Fluent Forms widget's Submit Button style controls */
.mb-form .fluentform .ff-btn-submit::after {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M3 12h17M14 6l6 6-6 6'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Cpath d='M3 12h17M14 6l6 6-6 6'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
	transition: transform 0.35s var(--mb-ease);
}
.mb-form .fluentform .ff-btn-submit:hover::after { transform: translateX(4px); }
/* The prototype reserves the status line with 1.75rem form gap above it */
.mb-form .fluentform fieldset::after { margin-top: 0.75rem; }
/* The prototype reserves one status line (1.5em at 15px) under the form */
.mb-form .fluentform fieldset::after { content: ""; order: 3; flex: 1 1 100%; height: 1.5em; font-size: 0.9375rem; }
.mb-form .ff-message-success {
	margin: 1.75rem 0 0;
	padding: 0;
	border: 0;
	box-shadow: none;
	background: none;
	font-size: 0.9375rem;
	line-height: 1.7;
	color: var(--mb-oak);
}

/* Footer */
.mb-footer-privacy a:hover { text-decoration: underline; }
/* Prototype columns are 1fr tracks sized by their content's minimum width */
.mb-footer-top > .e-con-inner > .e-con { min-width: auto; }

/* Legal pages (Privacy Policy): visible links and list spacing inside the text widgets */
.mb-legal .elementor-widget-text-editor a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-decoration-color: var(--mb-oak);
	text-underline-offset: 0.2em;
	overflow-wrap: anywhere;
	transition: color 0.3s var(--mb-ease);
}
.mb-legal .elementor-widget-text-editor a:hover { color: var(--mb-oak-deep); }
.mb-legal .elementor-widget-text-editor ul { margin: 0 0 1.1em; padding-left: 1.25em; }
.mb-legal .elementor-widget-text-editor ul:last-child { margin-bottom: 0; }
.mb-legal .elementor-widget-text-editor li + li { margin-top: 0.35em; }
.mb-legal .elementor-widget-text-editor li::marker { color: var(--mb-oak); }

/* 8. MOTION ---------------------------------------------------------------- */
@keyframes mb-hero-in {
	from { transform: scale(1.05); opacity: 0.6; }
	to { transform: scale(1); opacity: 1; }
}
.mb-js .mb-reveal {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.9s var(--mb-ease), transform 0.9s var(--mb-ease);
}
.mb-js .mb-reveal.is-visible { opacity: 1; transform: none; }
.elementor-editor-active .mb-reveal { opacity: 1 !important; transform: none !important; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.mb-js .mb-reveal { opacity: 1; transform: none; }
}

/* 9. RESPONSIVE ------------------------------------------------------------ */
@media (max-width: 1024px) {
	.mb-frame--tab-4x3 img { aspect-ratio: 4 / 3; }
	.mb-gallery .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mb-header.is-scrolled { --mb-header-h: inherit; }
	body .mb-header.is-scrolled .mb-header__logo img { height: 50px; }
}
@media (max-width: 768px) {
	.mb-card-info { --align-items: stretch; } /* prototype: display:block */
	.mb-details > .e-con-inner { height: auto; }
	.mb-detail { aspect-ratio: 1 / 1; }
	.mb-detail img { height: 100%; }
	.mb-card-img--wide img { aspect-ratio: 4 / 5; }
}
@media (max-width: 768px) and (min-width: 561px) {
	.mb-card-img--grid img { aspect-ratio: 4 / 3; }
}
@media (max-width: 560px) {
	.mb-hero-img img { object-position: 62% 58%; }
	.elementor-widget.mb-chip { right: auto; left: var(--mb-gutter); bottom: 1rem; }
	body .mb-header.is-scrolled .mb-header__logo img { height: 44px; }
	.mb-card-img--tall img { aspect-ratio: 4 / 5; }
	.mb-card-img--wide img { aspect-ratio: 4 / 3; }
	.mb-form .fluentform .ff-t-container { grid-template-columns: 1fr; }
	.mb-form .fluentform .ff_submit_btn_wrapper { flex-basis: 100%; }
	.mb-form .fluentform .ff-btn-submit { width: 100%; }
}
