/* Sitewide header -- built 2026-09-19, revised same day. Replaces GeneratePress's
   default header. Dark bar on --bg with a thin divider, NOT sticky, no search
   (original wireframe decision), no cart (site has no on-site cart).
   Mobile: language link | logo | hamburger (swapped 2026-09-19 at Chris's request), menu drops down full width.
   The language link shows the OTHER language by its full name ("Espanol" on the
   English site, "English" on the Spanish one) -- "EN | ES" confused people.
   It only renders once Polylang has 2+ languages.

   2026-09-23: added the Google social-proof badge (.mg-header-social, stars +
   logo + review count) wrapped together with .mg-header-lang inside a new
   .mg-header-info container -- one grid item instead of two.
   Desktop (>=1200): re-split into two rows -- row 1 is .mg-header-info spanning
   the FULL width, centered on the page (Chris: "center on the page", not just
   within the nav's column); row 2 is the original logo-left / nav-right layout,
   unchanged from before the badge existed. */
.mg-header {
	background: var(--bg);
	border-bottom: 1px solid var(--line-soft);
	position: relative;
	z-index: 50;
	width: 100%;
}
.mg-header-inner {
	max-width: 1200px; /* GP's .site.grid-container is 1200px, so the page column is 1200 with 16px gutters */
	margin: 0 auto;
	padding: 6px var(--space-md) 10px;
	display: grid;
	/* equal outer tracks keep the logo truly centered even when the language link
	   (wider than the 44px hamburger) is present */
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	column-gap: var(--space-sm);
	box-sizing: border-box;
}

.mg-header-info {
	grid-column: 1;
	grid-row: 1;
	justify-self: start;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
}

.mg-header-social {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.mg-header-toggle {
	grid-column: 3;
	grid-row: 1;
	justify-self: end;
	align-self: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	color: var(--ink);
	cursor: pointer;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	border-radius: var(--radius-sm);
}
.mg-header-toggle:hover { background: var(--surface); }
.mg-header-toggle:focus-visible,
.mg-header-nav a:focus-visible,
.mg-header-lang a:focus-visible,
.mg-header-logo:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mg-header-toggle span {
	display: block;
	width: 22px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.mg-header-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mg-header-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mg-header-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mg-header-logo {
	grid-column: 2;
	grid-row: 1;
	justify-self: center;
	align-self: start;
	display: block;
	line-height: 0;
}
.mg-header-logo img {
	display: block;
	height: 80px;
	width: auto;
}

.mg-header-lang {
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 0.8rem;
	letter-spacing: 0.03em;
}
.mg-header-lang a {
	color: var(--ink);
	text-decoration: none;
	padding: 10px 4px;
	display: inline-block;
}


/* Mobile menu: full-width drop-down row under the bar */
.mg-header-nav {
	grid-column: 1 / -1;
	grid-row: 2;
	display: none;
}
.mg-header-nav.is-open { display: block; }
.mg-header-nav ul {
	list-style: none;
	margin: var(--space-sm) 0 0;
	padding: 0;
	border-top: 1px solid var(--line-soft);
}
.mg-header-nav li { margin: 0; border-bottom: 1px solid var(--line-soft); }
.mg-header-nav a {
	display: block;
	padding: 14px var(--space-sm);
	color: var(--ink);
	text-decoration: none;
	text-transform: uppercase;
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 0.9rem;
	letter-spacing: 0.03em;
}


@media (min-width: 1200px) {
	.mg-header-inner {
		padding: var(--space-sm) var(--space-md);
		grid-template-columns: auto 1fr;
		grid-template-rows: auto auto;
		column-gap: var(--space-lg);
		row-gap: var(--space-sm);
	}
	.mg-header-toggle { display: none; }
	/* Info row is its own 3-column grid, NOT flex -- 1fr/auto/1fr keeps the badge
	   (column 2) mathematically centered on the page regardless of Espanol's
	   width, since the two flanking tracks are always forced equal. A flexbox
	   justify-content:center on both children together (the previous approach)
	   centered the COMBINED group instead, which quietly pulled the badge left
	   of true center because Espanol's width skewed the group's centroid. */
	.mg-header-info {
		grid-column: 1 / -1;
		grid-row: 1;
		justify-self: stretch;
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		align-items: center;
		column-gap: var(--space-md);
	}
	.mg-header-social { grid-column: 2; }
	.mg-header-lang { grid-column: 3; justify-self: end; }
	/* Logo spans both rows again (like before the badge existed) so it reads as
	   the full height of the header bar -- safe to do because the badge above
	   centers on the FULL page width independently (see .mg-header-info), so its
	   centered content never visually reaches the logo's narrow left column, and
	   because column 1 is a real auto-sized grid track (not an absolute overlay),
	   the nav column automatically starts after however wide the logo actually
	   renders -- no manual width estimate needed, no collision possible. */
	.mg-header-logo {
		grid-column: 1;
		grid-row: 1 / 3;
		justify-self: start;
		align-self: center;
	}
	.mg-header-logo img { height: 96px; }
	.mg-header-lang a { padding: 4px 8px; }
	.mg-header-nav {
		grid-column: 2;
		grid-row: 2;
		display: block;
		justify-self: end;
		align-self: center;
	}
	.mg-header-nav ul {
		display: flex;
		gap: var(--space-sm);
		margin: 0;
		border-top: 0;
	}
	.mg-header-nav li { border-bottom: 0; }
	.mg-header-nav a { padding: 8px var(--space-sm); font-size: 0.85rem; white-space: nowrap; }
}

/* Hover / current-page indicator: red UNDERLINE, not red text (red text was hard to read on the dark bar). */
.mg-header-nav a,
.mg-header-lang a {
	text-decoration: underline;
	text-decoration-color: transparent;
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
	transition: text-decoration-color 0.15s ease;
}
.mg-header-nav a:hover,
.mg-header-nav a:focus-visible,
.mg-header-nav .current-menu-item > a,
.mg-header-nav .current_page_item > a,
.mg-header-lang a:hover,
.mg-header-lang a:focus-visible {
	color: var(--ink);
	text-decoration-color: var(--accent);
}

/* Social-proof badge (2026-09-23) -- decorative styling, real aria-label on the
   wrapper carries the actual rating/count for screen readers (see functions.php);
   the star glyphs/logos themselves are aria-hidden. Stars are a real 4.4/5
   Google average (4 full + a 3/4-filled 5th star, 95% width overlay in Google's
   own gold), not a generic full-5 trust icon. Review count text matches the
   stars' gold, not the default ink-soft grey, so it reads as part of the same
   rating callout rather than a separate caption.
   Mobile: G icon + stars on one line, "1,000+ Reviews" wraps to the line below
   (flex-basis:100%). Desktop: full wordmark, stars, review count all inline,
   in that order, sharing one row with the Espanol link via .mg-header-info,
   centered across the full header width. */
.mg-header-stars {
	position: relative;
	display: inline-block;
	line-height: 1;
	font-size: 13px;
	letter-spacing: 1px;
}
.mg-header-stars-bg,
.mg-header-stars-fg {
	display: block;
	white-space: nowrap;
}
.mg-header-stars-bg { color: rgba(242, 241, 238, 0.25); }
.mg-header-stars-fg {
	position: absolute;
	top: 0;
	left: 0;
	width: 95%;
	overflow: hidden;
	color: #FBBC04;
}
.mg-header-google { display: block; }
.mg-header-google-icon { width: 16px; height: 16px; }
.mg-header-google-full { width: 62px; height: auto; display: none; }
.mg-header-reviews {
	font-family: var(--font-body);
	font-weight: 600;
	font-size: 11px;
	color: #FBBC04;
	white-space: nowrap;
}
/* Mobile: G icon, then stars, then reviews forced onto its own line. Desktop
   resets all three below. order: is scoped to <1200px so it doesn't leak into
   the desktop rule. */
@media (max-width: 1199px) {
	.mg-header-google-icon { order: 1; }
	.mg-header-stars { order: 2; }
	.mg-header-reviews { order: 3; flex-basis: 100%; }
	/* Extra 4px above just the G+stars line, not the logo -- the logo PNG has
	   some built-in whitespace above the mark itself, so matching container-
	   padding boxes made the logo LOOK lower than the G even though the boxes
	   lined up exactly. Nudging G+stars down instead (not the logo) compensates
	   visually without relying on re-cropping the logo asset. */
	.mg-header-social { margin-top: 6px; }
}
@media (min-width: 1200px) {
	.mg-header-social { flex-wrap: nowrap; }
	.mg-header-stars { font-size: 14px; order: 2; }
	.mg-header-google-icon { display: none; }
	.mg-header-google-full { display: block; order: 1; }
	.mg-header-reviews { font-size: 12px; order: 3; flex-basis: auto; }
}
/* Inactive language placeholder (until Polylang has a 2nd language) */
.mg-header-lang.is-placeholder span {
	color: var(--ink-soft);
	cursor: default;
	display: inline-block;
	padding: 10px 4px;
}
@media (min-width: 1200px) {
	.mg-header-lang.is-placeholder span { padding: 4px 8px; }
}
