/* ==========================================================================
   McAfee Air & Plumbing — native WP nav header
   Layout/behavior ported from the ProSkill reference theme; brand tokens
   match the existing site (#eb1c29 red, Nunito font, FontAwesome 6.5).
   Class prefix: .mc-*  (avoids any collision with .ms-* on the reference
   theme or .vc-* / .et-* on XStore + WPBakery).
   ========================================================================== */

:root {
	--mc-red: #eb1c29;
	--mc-red-dark: #d01520;
	--mc-red-hover: #b50e18;
	--mc-black: #000;
	--mc-ink: #111;
	--mc-ink-soft: #5f6368;
	--mc-line: #e9ecef;
	--mc-bg: #fff;
	--mc-bg-soft: #f8f9fa;

	--mc-font-display: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

	--mc-container-max: 1480px;
	--mc-radius: 10px;
	--mc-radius-sm: 6px;
	--mc-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
	--mc-shadow-md: 0 12px 32px rgba(0, 0, 0, 0.12);

	--mc-topbar-h: 38px;
	--mc-mainbar-h: 88px;
	--mc-header-h: 126px;   /* topbar + mainbar on desktop */
	--mc-z-header: 100;
	--mc-z-overlay: 200;
	--mc-z-drawer: 210;
}

/* On mobile the topbar is hidden and the mainbar collapses, so the header
   only takes the mainbar's 64px. Keep this in sync with the responsive
   block further down (`@media (max-width: 1024px) { .mc-mainbar__inner { min-height: 64px; } }`). */
@media (max-width: 1024px) {
	:root { --mc-header-h: 64px; }
}

/* ---------- Skip link (a11y) ---------- */
.mc-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--mc-black);
	color: #fff;
	padding: 0.5rem 1rem;
	z-index: 9999;
}
.mc-skip-link:focus { left: 0; }

.mc-container {
	width: 100%;
	max-width: var(--mc-container-max);
	margin-inline: auto;
	padding-inline: clamp(16px, 3vw, 32px);
}

/* ==========================================================================
   Header shell — sticky, scroll-aware shadow.
   Header is intentionally transparent so the bar backgrounds (topbar/mainbar)
   show through their own rgba() values onto whatever's behind. backdrop-filter
   gives the frosted-glass look on browsers that support it.
   ========================================================================== */
.mc-site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: var(--mc-z-header);
	background: transparent;
	box-shadow: var(--mc-shadow-sm);
	font-family: var(--mc-font-display);
}

/* WordPress admin bar (logged-in toolbar) sits at top:0 and is itself fixed.
 * WP shifts `html` down by 32px (or 46px on narrow screens) to make room.
 * Our fixed header would otherwise overlap that bar — push it below. The
 * hero compensation still works because `.page-wrapper` sits inside the
 * already-shifted body, so visual alignment stays correct. */
body.admin-bar .mc-site-header { top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar .mc-site-header { top: 46px; }
}

/* ---------- Top bar ----------
   position:relative + a higher z-index than the mainbar so the top-bar
   dropdowns escape downward and paint OVER the mainbar. The mainbar's
   `backdrop-filter` creates its own stacking context, which would otherwise
   trap the dropdown underneath. */
.mc-topbar {
	position: relative;
	z-index: 3;
	background: rgba(0, 0, 0, 0.78);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	color: #fff;
	font-size: 14px;
}
.mc-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 28px;
	min-height: var(--mc-topbar-h);
}
.mc-topnav { flex: 0 0 auto; }
.mc-menu { list-style: none; margin: 0; padding: 0; }
.mc-menu--top {
	display: flex;
	flex-wrap: wrap;
	gap: 0 24px;
}
.mc-menu--top > .menu-item { position: relative; }
.mc-menu--top .mc-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: #fff;
	font-family: var(--mc-font-display);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 10px 0;
	line-height: 1;
	text-decoration: none;
}
.mc-menu--top .mc-link:hover,
.mc-menu--top .mc-link:focus-visible,
.mc-menu--top .current-menu-item > .mc-link { color: var(--mc-red); }
/* Honor the FA icons baked into top-menu titles */
.mc-menu--top .mc-link i { margin-right: 6px; font-size: 14px; }

.mc-menu--top .has-children > .mc-link { padding-right: 16px; }
.mc-menu--top .mc-submenu-toggle { display: none; }

/* Top-bar dropdowns — visually consistent with primary dropdowns */
.mc-menu--top .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: #fff;
	color: var(--mc-ink);
	border-top: 3px solid var(--mc-red);
	border-radius: var(--mc-radius);
	box-shadow: var(--mc-shadow-md);
	padding: 8px 0;
	margin: 0;
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
	z-index: 5;
}
.mc-menu--top .menu-item:hover > .sub-menu,
.mc-menu--top .menu-item:focus-within > .sub-menu,
.mc-menu--top .menu-item.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.mc-menu--top .sub-menu .mc-link {
	display: block;
	padding: 8px 18px;
	color: var(--mc-ink);
	font-family: var(--mc-font-display);
	font-size: 14px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1.3;
}
.mc-menu--top .sub-menu .mc-link:hover,
.mc-menu--top .sub-menu .mc-link:focus-visible {
	background: var(--mc-bg-soft);
	color: var(--mc-red);
}

/* ---------- Main bar ---------- */
.mc-mainbar {
	position: relative;
	z-index: 1;
	background: rgba(255, 255, 255, 0.88);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	color: var(--mc-ink);
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.mc-mainbar__inner {
	display: flex;
	align-items: center;
	gap: clamp(16px, 2vw, 32px);
	min-height: var(--mc-mainbar-h);
	padding-block: 8px;
}

.mc-logo {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
}
.mc-logo__img {
	height: 55px;
	width: auto;
	display: block;
}

/* Desktop: logo sits inline in the main bar at a fixed 45px — no overflow
 * into the topbar (which would put it over the secondary nav). */
@media (min-width: 1025px) {
	.mc-topbar {
		max-height: 80px;
		transition: max-height 0.25s ease, opacity 0.2s ease;
	}
	.mc-site-header.is-scrolled .mc-topbar {
		max-height: 0;
		opacity: 0;
		overflow: hidden;
	}
}

/* ---------- Primary nav (desktop) ---------- */
.mc-primary-nav {
	flex: 1 1 auto;
	display: flex;
	justify-content: center;
}
.mc-menu--primary {
	display: flex;
	align-items: center;
	gap: clamp(8px, 1.5vw, 24px);
}
.mc-menu--primary .menu-item { position: relative; }
.mc-menu--primary > .menu-item > .mc-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--mc-ink);
	font-family: var(--mc-font-display);
	font-size: clamp(14px, 1vw, 16px);
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 28px 4px;
	line-height: 1;
	position: relative;
	white-space: nowrap;
	text-decoration: none;
}

/* Red underline accent on top-level items */
.mc-menu--primary > .menu-item > .mc-link::after {
	content: "";
	position: absolute;
	left: 4px;
	right: 4px;
	bottom: 18px;
	height: 3px;
	background: var(--mc-red);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.18s ease;
}
.mc-menu--primary > .menu-item:hover > .mc-link::after,
.mc-menu--primary > .menu-item:focus-within > .mc-link::after,
.mc-menu--primary > .current-menu-item > .mc-link::after,
.mc-menu--primary > .current-menu-parent > .mc-link::after,
.mc-menu--primary > .current-menu-ancestor > .mc-link::after { transform: scaleX(1); }

.mc-menu--primary .menu-item:hover > .mc-link,
.mc-menu--primary .menu-item:focus-within > .mc-link { color: var(--mc-red); }

.mc-menu--primary .has-children > .mc-link { padding-right: 16px; }
.mc-menu--primary .has-children > .mc-link .mc-chevron { display: none; }

/* Primary dropdown */
.mc-menu--primary .sub-menu {
	position: absolute;
	top: 100%;
	left: -16px;
	min-width: 260px;
	background: #fff;
	border-top: 3px solid var(--mc-red);
	border-radius: var(--mc-radius);
	box-shadow: var(--mc-shadow-md);
	padding: 8px 0;
	margin: 0;
	list-style: none;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
	z-index: 5;
}
.mc-menu--primary .menu-item:hover > .sub-menu,
.mc-menu--primary .menu-item:focus-within > .sub-menu,
.mc-menu--primary .menu-item.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.mc-menu--primary .sub-menu .mc-link {
	display: block;
	padding: 10px 20px;
	color: var(--mc-ink);
	font-family: var(--mc-font-display);
	font-size: 15px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1.3;
	text-decoration: none;
}
.mc-menu--primary .sub-menu .mc-link:hover,
.mc-menu--primary .sub-menu .mc-link:focus-visible {
	background: var(--mc-bg-soft);
	color: var(--mc-red);
}

/* Auto two-column layout when a dropdown has >5 items
   (Heating + AC submenus both have 6) */
.mc-menu--primary .sub-menu:has(> .menu-item:nth-child(6)) {
	min-width: 460px;
	column-count: 2;
	column-gap: 0;
}
.mc-menu--primary .sub-menu:has(> .menu-item:nth-child(6)) > .menu-item {
	break-inside: avoid;
}
.mc-menu--top .sub-menu:has(> .menu-item:nth-child(6)) {
	min-width: 380px;
	column-count: 2;
	column-gap: 0;
}
.mc-menu--top .sub-menu:has(> .menu-item:nth-child(6)) > .menu-item {
	break-inside: avoid;
}

/* Hide JS toggle on desktop (hover/focus-within drives it) */
.mc-primary-nav .mc-submenu-toggle { display: none; }

/* ---------- CTA cluster (phone tap-to-call) ---------- */
.mc-cta {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 0 0 auto;
	margin-left: auto;
}
.mc-phone {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	background: var(--mc-red);
	color: #fff;
	font-family: var(--mc-font-display);
	font-weight: 800;
	font-size: 16px;
	letter-spacing: 0.02em;
	border-radius: 999px;
	text-decoration: none;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
	white-space: nowrap;
}
.mc-phone:hover,
.mc-phone:focus-visible {
	background: var(--mc-red-dark);
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 8px 18px rgba(235, 28, 41, 0.3);
}
.mc-phone__icon { font-size: 16px; line-height: 1; }

/* ---------- Burger ---------- */
.mc-burger {
	display: none;
	width: 44px;
	height: 44px;
	margin-left: auto;
	background: transparent;
	border: 0;
	padding: 8px;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 5px;
}
.mc-burger__bar {
	display: block;
	width: 26px;
	height: 3px;
	background: var(--mc-ink);
	border-radius: 2px;
}

/* ==========================================================================
   Mobile drawer
   ========================================================================== */
.mc-mobile-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: var(--mc-z-overlay);
	opacity: 0;
	transition: opacity 0.2s ease;
}
.mc-mobile-overlay.is-open { opacity: 1; }

.mc-mobile-drawer {
	position: fixed;
	top: 0;
	right: 0;
	height: 100dvh;
	width: min(86vw, 360px);
	background: #fff;
	z-index: var(--mc-z-drawer);
	transform: translateX(100%);
	transition: transform 0.25s ease;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	box-shadow: -20px 0 40px rgba(0, 0, 0, 0.15);
	font-family: var(--mc-font-display);
}
.mc-mobile-drawer.is-open { transform: translateX(0); }

.mc-mobile-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: var(--mc-black);
	border-bottom: 1px solid var(--mc-line);
}
.mc-mobile-drawer__head .mc-logo__img {
	height: 44px;
	width: auto;
	filter: brightness(0) invert(1);
}
.mc-mobile-close {
	background: transparent;
	border: 0;
	color: #fff;
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border-radius: 8px;
	font-size: 22px;
	line-height: 1;
}
.mc-mobile-close:hover,
.mc-mobile-close:focus-visible {
	background: rgba(255, 255, 255, 0.1);
	color: var(--mc-red);
}

.mc-mobile-drawer__cta {
	padding: 16px 20px;
	background: var(--mc-bg-soft);
	border-bottom: 1px solid var(--mc-line);
}
.mc-mobile-drawer__cta .mc-phone {
	width: 100%;
	justify-content: center;
}

.mc-mobile-nav { padding: 8px 0 16px; }
.mc-mobile-nav .mc-menu { padding: 0; }
.mc-mobile-nav .menu-item {
	border-bottom: 1px solid var(--mc-line);
	position: relative;
}
.mc-mobile-nav .menu-item > .mc-link {
	display: flex;
	align-items: center;
	padding: 14px 56px 14px 20px;
	font-family: var(--mc-font-display);
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--mc-ink);
	line-height: 1.2;
	text-decoration: none;
}
.mc-mobile-nav .menu-item > .mc-link:hover,
.mc-mobile-nav .menu-item > .mc-link:focus-visible { color: var(--mc-red); }

.mc-mobile-nav .mc-submenu-toggle {
	position: absolute;
	top: 0;
	right: 0;
	width: 56px;
	height: 50px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-left: 1px solid var(--mc-line);
	color: var(--mc-ink);
	cursor: pointer;
	transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.mc-mobile-nav .mc-submenu-toggle:hover {
	background: var(--mc-bg-soft);
	color: var(--mc-red);
}
.mc-mobile-nav .menu-item.is-open > .mc-submenu-toggle {
	transform: rotate(180deg);
	color: var(--mc-red);
}

.mc-mobile-nav .sub-menu {
	background: var(--mc-bg-soft);
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
}
.mc-mobile-nav .menu-item.is-open > .sub-menu { max-height: 1200px; }
.mc-mobile-nav .sub-menu .mc-link {
	display: block;
	padding: 12px 20px 12px 36px;
	font-family: var(--mc-font-display);
	font-size: 14px;
	font-weight: 600;
	color: var(--mc-ink);
	text-transform: none;
	letter-spacing: 0;
	border-top: 1px solid var(--mc-line);
	text-decoration: none;
}
.mc-mobile-nav .sub-menu .mc-link:hover { color: var(--mc-red); background: #fff; }

.mc-mobile-nav--secondary {
	background: var(--mc-bg-soft);
	border-top: 6px solid var(--mc-line);
}
.mc-mobile-nav--secondary .menu-item > .mc-link { font-size: 14px; }

/* Body lock when drawer open */
body.mc-no-scroll { overflow: hidden; }

/* ==========================================================================
   Responsive — collapse to drawer at ≤1024px
   ========================================================================== */
@media (max-width: 1024px) {
	.mc-topbar { display: none; }
	.mc-primary-nav { display: none; }
	.mc-burger { display: inline-flex; }
	.mc-mainbar__inner { min-height: 64px; }
	/* Phone CTA hides on mobile — the burger sits to its right by default,
	 * and the drawer already has a prominent red phone button at the top.
	 * Keeping a third entry-point here just crowds a 390px viewport. */
	.mc-mainbar .mc-cta { display: none; }
}

/* ==========================================================================
   Header overlay — fixed header sits ON TOP of the page, hero sections
   extend back UP underneath so their background bleeds through the
   translucent topbar/mainbar.
   ==========================================================================
   The .page-wrapper is the FIRST scrollable container inside the body. It
   gets a top padding equal to header height so default content (blog posts,
   landing pages, etc.) renders below the header. Pages that lead with a
   hero opt out by pulling the hero up via negative margin and adding the
   same amount of internal padding-top so titles aren't clipped. */
.page-wrapper {
	padding-top: var(--mc-header-h);
}

/* Hero sections — slide UP under the fixed header and absorb that same
   distance as internal padding-top so the title/badge remain at their
   intended visual offset from the header's bottom edge. Each of these
   classes is defined in style.css; they're the entry rows for the home
   page and every landing/service template. */
.home-hero-section,
.repair-hero-section,
.maintenance-hero-section,
.drain-hero-section,
.careers-hero-section,
.furnace-hero-section,
.ac-hero-section,
.plumbing-hero-section {
	margin-top: calc(-1 * var(--mc-header-h));
	padding-top: var(--mc-header-h);
}

/* Override the old hard-coded `.header-spacing { margin-top: 138px }` rule
   from style.css — the fixed header is now compensated for by .page-wrapper
   padding above, so this legacy spacer should add nothing. */
@media (min-width: 987px) {
	.header-spacing { margin-top: 0 !important; }
}
.single-post .page-heading,
.single-post .content-page {
	margin-top: 0;
}
