/*
 Theme Name:   Kadence Child - MASH
 Theme URI:    https://marketingandsaleshelp.com
 Description:  Update-safe child theme for the MASH website. Holds the custom Intelligence Feed and article templates so Kadence parent updates cannot overwrite them. Holds the central MASH design tokens (CSS custom properties) and, from 1.0.1, the approved header refinement (Adam, Dec 4: Base44-style navigation), scoped to the site header only; the approved component styles remain in assets/css/mash-insights.css and assets/css/mash-article.css, enqueued by the templates exactly as before.
 Author:       Chell Brown LLC (prepared by Bob)
 Template:     kadence
 Version:      1.0.1
 Requires at least: 6.0
 Requires PHP: 7.4
 Text Domain:  kadence-mash-child
*/

/* ==========================================================================
   MASH central design tokens (single source of truth). Prepared by Bob, Dec 4 2026.
   Declaring custom properties on :root changes NOTHING visually until a rule uses
   var(--mash-*). Existing component files keep their own scoped variables
   (--feed-*, --ma-*) untouched; migrate them to these tokens one at a time later,
   each with a regression compare and Adam's sign-off.
   Fonts below are tokens only: Bricolage Grotesque / Geist / Geist Mono are NOT
   loaded on staging today (Kadence uses the system stack), so no font changes.
   ========================================================================== */
:root {
	/* Brand palette (brief) */
	--mash-purple: #66207F;  /* MASH Purple */
	--mash-ink:    #120B16;  /* Ink */
	--mash-paper:  #F4F3F6;  /* Paper */
	--mash-volt:   #D4FF3A;  /* Volt */
	--mash-white:  #FFFFFF;

	/* Supporting values already used by the live components (kept exact) */
	--mash-muted:        #526174; /* --feed-muted, --ma-muted */
	--mash-line:         #E7E6EB; /* --ma-line */
	--mash-line-cool:    #E5E8EC; /* --feed-line (feed only) */
	--mash-bg-cool:      #F7F8FA; /* --feed-bg (feed only; differs from Paper) */
	--mash-ink-navy:     #141C2D; /* --feed-ink (feed only; differs from Ink) */

	/* Semantic aliases */
	--mash-color-text:        var(--mash-ink);
	--mash-color-accent:      var(--mash-purple);
	--mash-color-surface:     var(--mash-paper);
	--mash-color-highlight:   var(--mash-volt);
	--mash-button-bg:         var(--mash-volt);  /* matches Kadence button setting */
	--mash-button-text:       var(--mash-ink);

	/* Type stacks (tokens only, not applied) */
	--mash-font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--mash-font-body:    "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--mash-font-mono:    "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ==========================================================================
   Header refinement v1.0.1 (approved by Adam, Dec 4 2026, t789u).
   Reference: original Base44 header (64px bar, 40px logo, 14px links with 8px/16px
   padding and 4px gaps, 2px purple active underline, grouped Services dropdown,
   search icon, rounded purple "Book a Call"). Scoped to #masthead / #mobile-drawer;
   nothing outside the header is styled here except anchor offsets and the skip target.
   Layout settings (sticky, items, logo width, bar height, button colours) are Kadence
   Customizer values written to the child theme on activation (functions.php).
   ========================================================================== */
:root {
	--mash-header-h: 64px;
	--mash-nav-text: #526174;       /* = --mash-muted */
	--mash-nav-hover-bg: rgba(18, 11, 22, .04);
	--mash-nav-line: #E2E8F0;
	--mash-nav-label: #94A3B8;
	--mash-purple-hover: #55196B;
}

/* Logo: 40px tall (Kadence logo_width does the sizing; this keeps the ratio). */
#masthead .site-branding a.brand img.custom-logo { max-height: 40px; width: auto; }
@media (max-width: 767px) { #masthead .site-branding a.brand img.custom-logo { max-height: 36px; } }

/* Bar: translucent white with blur, hairline border once stuck (Kadence adds .item-is-stuck). */
#masthead .site-main-header-wrap .site-header-row-container-inner { background: rgba(255, 255, 255, .92); }
#masthead .kadence-sticky-header.item-is-stuck .site-header-row-container-inner {
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	border-bottom: 1px solid rgba(0, 0, 0, .06);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .06);
}

/* Top-level links: spacing and states. */
#masthead .main-navigation .primary-menu-container > ul { gap: 4px; }
#masthead .main-navigation .primary-menu-container > ul > li.menu-item > a {
	position: relative;
	padding: 8px 16px;
	border-radius: 8px;
	color: var(--mash-nav-text);
	transition: color .15s ease, background-color .15s ease;
}
#masthead .main-navigation .primary-menu-container > ul > li.menu-item > a:hover,
#masthead .main-navigation .primary-menu-container > ul > li.menu-item > a:focus-visible {
	color: var(--mash-ink);
	background-color: var(--mash-nav-hover-bg);
}
#masthead .main-navigation .primary-menu-container > ul > li.menu-item > a:focus-visible {
	outline: 2px solid var(--mash-purple); outline-offset: 2px;
}
/* Active page (aria-current="page") or its section: ink text + 2px purple underline. */
#masthead .main-navigation .primary-menu-container > ul > li > a[aria-current="page"],
#masthead .main-navigation .primary-menu-container > ul > li.current-menu-item > a,
#masthead .main-navigation .primary-menu-container > ul > li.current-menu-ancestor > a,
#masthead .main-navigation .primary-menu-container > ul > li.mash-section-current > a { color: var(--mash-ink); }
#masthead .main-navigation .primary-menu-container > ul > li > a[aria-current="page"]::after,
#masthead .main-navigation .primary-menu-container > ul > li.current-menu-item > a::after,
#masthead .main-navigation .primary-menu-container > ul > li.current-menu-ancestor > a::after,
#masthead .main-navigation .primary-menu-container > ul > li.mash-section-current > a::after {
	content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px;
	border-radius: 999px; background: var(--mash-purple);
	box-shadow: 0 0 4px 1px rgba(102, 32, 127, .4);
}
#masthead .main-navigation .dropdown-nav-toggle { opacity: .6; margin-left: 2px; }

/* Services dropdown (Kadence handles hover, focus-within and the keyboard toggle). */
#masthead .header-navigation ul ul.sub-menu {
	min-width: 280px; padding: 8px 0; top: calc(100% + 8px);
	background: var(--mash-white); border: 1px solid var(--mash-nav-line); border-radius: 12px;
	box-shadow: 0 20px 25px -5px rgba(18, 11, 22, .10), 0 8px 10px -6px rgba(18, 11, 22, .10);
}
/* Invisible hover bridge across the 8px gap so the menu does not close on the way down. */
#masthead .header-navigation ul ul.sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
#masthead .header-navigation ul ul.sub-menu > li { border-bottom: 0; }
#masthead .header-navigation ul ul.sub-menu > li > a {
	display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
	width: 100%; padding: 10px 16px; font-size: 14px; font-weight: 500;
	color: #475569; background: transparent;
}
#masthead .header-navigation ul ul.sub-menu > li > a:hover,
#masthead .header-navigation ul ul.sub-menu > li > a:focus-visible { color: var(--mash-ink); background: #F8FAFC; }
#masthead .header-navigation ul ul.sub-menu > li > a:focus-visible { outline: 2px solid var(--mash-purple); outline-offset: -2px; }
#masthead .header-navigation ul ul.sub-menu > li.current-menu-item > a { color: var(--mash-purple); }
.mash-nav-meta { font-size: 12px; font-weight: 700; color: var(--mash-nav-label); white-space: nowrap; }
li.mash-nav-group-start[data-mash-group]::before {
	content: attr(data-mash-group); display: block; padding: 6px 16px 4px;
	font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mash-nav-label);
}
#masthead .header-navigation ul ul.sub-menu > li.mash-nav-group-start:not(:first-child) {
	margin-top: 4px; padding-top: 6px; border-top: 1px solid #F1F5F9;
}

/* Search icon button. */
#masthead .search-toggle-open {
	padding: 8px; border-radius: 8px; color: var(--mash-nav-text); background: transparent;
}
#masthead .search-toggle-open:hover,
#masthead .search-toggle-open:focus-visible { color: var(--mash-ink); background: var(--mash-nav-hover-bg); }
#masthead .search-toggle-open:focus-visible { outline: 2px solid var(--mash-purple); outline-offset: 2px; }

/* Book a Call: rounded purple pill (colours/radius also set in Kadence options). */
#masthead .header-button-wrap .header-button {
	padding: 10px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1.25;
	color: var(--mash-white); background: var(--mash-purple); border-color: var(--mash-purple);
	transition: box-shadow .2s ease, transform .2s ease, background-color .2s ease;
}
#masthead .header-button-wrap .header-button:hover,
#masthead .header-button-wrap .header-button:focus-visible {
	color: var(--mash-white); background: var(--mash-purple-hover); border-color: var(--mash-purple-hover);
	box-shadow: 0 10px 15px -3px rgba(102, 32, 127, .25); transform: scale(1.02);
}
#masthead .header-button-wrap .header-button:focus-visible { outline: 2px solid var(--mash-ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	#masthead .header-button-wrap .header-button, #masthead .main-navigation a { transition: none; }
	#masthead .header-button-wrap .header-button:hover { transform: none; }
}

/* Mobile drawer: larger tap targets, Book a Call as a full-width pill at the end. */
#mobile-drawer .mobile-navigation ul li > a,
#mobile-drawer .mobile-navigation ul li > .drawer-nav-drop-wrap > a { padding-top: 14px; padding-bottom: 14px; }
#mobile-drawer .mobile-navigation li.mash-nav-cta > a {
	display: block; margin: 16px 0 8px; padding: 14px 20px; border-radius: 999px; text-align: center;
	font-weight: 600; color: var(--mash-white); background: var(--mash-purple);
}
#mobile-drawer .mobile-navigation li.mash-nav-cta > a:hover,
#mobile-drawer .mobile-navigation li.mash-nav-cta > a:focus-visible { background: var(--mash-purple-hover); color: var(--mash-white); }
#mobile-drawer .mobile-navigation li.mash-nav-group-start[data-mash-group]::before { padding-left: 0; }

/* Sticky header must not cover in-page targets (TOC links already use 100px on article H2s). */
.entry-content [id], .mash-article-body [id], #main, .mash-skip-target { scroll-margin-top: 100px; }
.mash-skip-target { display: block; height: 0; outline: 0; }
