/* ==========================================================================
   header.css — styles for header.php only. Nothing else belongs in here.

   Palette discipline: three colors. Blue #4788c8 is 3.73:1 on white and
   3.73:1 under white, so it is never text on white and white is never text
   on blue. Where blue is a ground — the mega menu's middle column — the text
   on it is black. On black, blue measures 5.62:1 and is safe.
   ========================================================================== */

/* Hover easing. One duration and one curve for every state change in the
   header, so the rail, the masthead and the mega menu all feel like one
   component. Short on purpose: these are state changes, not animations, and
   anything slower than ~150ms reads as lag on a menu you are scanning.

   Color, background, border and opacity only — no transforms. The house
   style has no hover-lift, and a moving target is harder to click. */
.cc-header,
.cc-meganav {
	--cc-hover-dur: 140ms;
	--cc-hover-ease: cubic-bezier(0.2, 0, 0.2, 1);

	/* Logo height is the constant; width follows each lockup's own ratio.
	   The black and white files are not quite the same proportions (4.43
	   vs 5.09), so matching on height keeps the cap-height consistent
	   between the masthead and the mega menu, which is what the eye reads. */
	--cc-logo-h: 34px;
}

.cc-header {
	position: fixed;
	top: var(--cc-admin-bar-h, 0px);
	left: 0;
	right: 0;
	z-index: 100;
	background: #fff;
	border-bottom: 1px solid var(--cc-rule);
	will-change: transform;
}

/* Scrolling down, the whole header shifts up by exactly the rail's height:
   the rail leaves the viewport and the masthead pins to the top edge. The
   masthead is opaque and sits above the rail, so the rail passes behind it
   rather than over the page. Scrolling up, or returning to the top, brings
   it back. The class is toggled in navigation.js. */
.cc-header--rail-hidden {
	transform: translateY(calc(-1 * var(--cc-rail-h)));
}

/* With the mega menu open the header must not slide: the overlay is anchored
   to it, and a rail that hides underneath would shift the whole panel. */
.cc-header.is-nav-open {
	transform: none;
}

.cc-masthead {
	position: relative;
	z-index: 2;
	background: #fff;
}


/* --- Utility rail -------------------------------------------------------- */

.cc-rail {
	position: relative;
	z-index: 1;
	background: var(--wp--preset--color--black);
	color: var(--cc-body-dark);
}

.cc-rail__inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 1.5rem;
	max-width: var(--wp--style--global--wide-size, 1440px);
	margin-inline: auto;
	padding: 0 var(--wp--preset--spacing--30);
	min-height: 40px;
}

.cc-rail__list {
	display: flex;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cc-rail__list li { margin: 0; }

.cc-rail__list a {
	display: block;
	padding: 0.65rem 0.95rem;
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.02em;
	text-decoration: none;
	color: var(--cc-body-dark);
	border-bottom: 2px solid transparent;
	transition:
		color var(--cc-hover-dur) var(--cc-hover-ease),
		border-bottom-color var(--cc-hover-dur) var(--cc-hover-ease);
}

.cc-rail__list a:hover,
.cc-rail__list a:focus-visible {
	color: #fff;
	border-bottom-color: var(--wp--preset--color--blue);
}

/* A section trigger living in the rail. Same button as the masthead ones —
   it opens the same panel — dressed to sit with the utility links. Ordered
   before them in the flex row so the transactional four stay together at the
   far right, where returning partners already look for them. */
.cc-rail__list--sections { order: -1; }

.cc-rail__trigger {
	display: block;
	padding: 0.65rem 0.95rem;
	font: inherit;
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--cc-body-dark);
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
	cursor: pointer;
	transition:
		color var(--cc-hover-dur) var(--cc-hover-ease),
		border-bottom-color var(--cc-hover-dur) var(--cc-hover-ease);
}

.cc-rail__trigger:hover,
.cc-rail__trigger:focus-visible,
.cc-rail__trigger[aria-expanded="true"] {
	color: #fff;
	border-bottom-color: var(--wp--preset--color--blue);
}


/* --- Masthead ------------------------------------------------------------ */

.cc-masthead__inner {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
	max-width: var(--wp--style--global--wide-size, 1440px);
	margin-inline: auto;
	padding: 0 var(--wp--preset--spacing--30);
	min-height: 76px;
}

.cc-brand { flex: 0 0 auto; }
.cc-brand__link { display: block; text-decoration: none; }

.cc-logo {
	display: block;
	height: var(--cc-logo-h);
	width: auto;
}

.cc-nav { margin-left: auto; }

.cc-nav__list {
	display: flex;
	align-items: center;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cc-nav__item { margin: 0; }

/* .cc-nav__trigger is a BEHAVIOR hook, not a style hook.
   navigation.js binds to it, and the same button appears in three slots —
   the masthead, the utility rail, and the primary CTA — each of which looks
   completely different. Styling the bare class made the rail trigger inherit
   masthead padding and black-on-black text, and stripped the CTA's fill.
   So: no visual rules here. Each slot styles its own. */

/* Masthead slot. */
.cc-nav__list .cc-nav__trigger {
	display: block;
	padding: 1.6rem 0.85rem;
	font: inherit;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	color: var(--wp--preset--color--black);
	background: none;
	border: 0;
	border-bottom: 3px solid transparent;
	cursor: pointer;
	transition: border-bottom-color var(--cc-hover-dur) var(--cc-hover-ease);
}

.cc-nav__list .cc-nav__trigger:hover,
.cc-nav__list .cc-nav__trigger:focus-visible,
.cc-nav__list .cc-nav__trigger[aria-expanded="true"] {
	border-bottom-color: var(--wp--preset--color--blue);
}

/* Active section (Andy, 2026-10-30): the hover bar, held on. .is-active is
   set in header.php by cloudco_meganav_section_is_active() — /hosting/ and
   everything under it light up "Hosting". */
.cc-nav__item.is-active .cc-nav__trigger {
	border-bottom-color: var(--wp--preset--color--blue);
}

.cc-masthead__cta { flex: 0 0 auto; }

/* The primary CTA is a <button> here, not an <a>: it opens the mega menu.
   .cc-cta in base.css assumes a link, so reset what a button brings with it
   and keep every visual property coming from the primitive. */
.cc-cta--trigger {
	font-family: inherit;
	line-height: inherit;
	cursor: pointer;
}

/* Open state reads like the masthead's other triggers: the button inverts
   rather than growing an underline it has no room for. */
.cc-cta--trigger[aria-expanded="true"] {
	background: var(--wp--preset--color--black);
	border-color: var(--wp--preset--color--black);
	color: #fff;
}

/* --- Mega menu -----------------------------------------------------------
   One panel per section, anchored under the masthead. Replaced a full-screen
   overlay in September 2026.

   POSITIONING. The panel is absolute against .cc-masthead, so it hangs off the
   bar it belongs to and travels with the header when the rail hides on scroll.
   This is the exact inverse of the old overlay's constraint: .cc-header carries
   will-change: transform and GSAP transforms it, which makes it a containing
   block — fatal for position:fixed, and precisely what position:absolute needs.
   Nothing here may become fixed, and .cc-header must never get overflow:hidden.

   WHAT IS GONE. The sections column, the detail column, the 38 cards, the
   hover-swap and its delay, the image priming, the focus trap and the close
   button. The section summary survives because it is the one piece of that
   content that exists and that someone mid-navigation wants.                */

/* The panel is absolute against .cc-masthead, not against the <li> it lives
   in — no ancestor between them is positioned, which is what lets it be a child
   of its own trigger's item and still span the full bar. */
.cc-meganav__panel {
	position: absolute;
	inset-inline: 0;
	top: 100%;
	z-index: 20;
	background: var(--wp--preset--color--white);
	border-top: 1px solid var(--wp--preset--color--black);
	border-bottom: 1px solid var(--wp--preset--color--black);
	/* clip, not hidden: it stops the bleeding background below from causing a
	   horizontal scrollbar without turning the panel into a scroll container. */
	overflow: clip;
}

.cc-meganav__panel[hidden] { display: none; }

.cc-meganav__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	align-items: stretch;
	width: 100%;
	max-width: var(--wp--style--global--wide-size, 1440px);
	margin-inline: auto;
}

/* --- Links ---------------------------------------------------------------
   Two columns, because five links in one column makes a tall thin panel and
   the whole point of this container is that it is short.                    */

.cc-meganav__linkscol {
	padding: var(--wp--preset--spacing--30);
}

/* .cc-eyebrow (base.css) supplies its own margin-bottom. */

/* Two explicit lists, built in header.php, rather than one list under CSS
   `columns: 2`. Column-balancing splits by estimated height, not item
   count, so an odd number of equal-height rows can land 2/3 as easily as
   3/2 with no way to pin which side gets the extra one. header.php splits
   the children itself so the left list is always ceil(n/2) — never
   shorter than the right. */
.cc-meganav__linkgrid {
	display: flex;
	align-items: flex-start;
	gap: var(--wp--preset--spacing--40);
}

.cc-meganav__links {
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Dash-marker rows, matching Split Panel's list treatment, instead of the
   underline every ordinary body link already uses — nav links and body
   copy links should not read as the same kind of thing. */
.cc-meganav__child {
	display: block;
	position: relative;
	padding: 0.5rem 0 0.5rem 1rem;
	font-size: var(--wp--preset--font-size--label);
	line-height: 1.35;
	color: var(--wp--preset--color--black);
	text-decoration: none;
	border-bottom: 1px solid var(--cc-rule);
	transition: border-bottom-color var(--cc-hover-dur) var(--cc-hover-ease);
}

.cc-meganav__child::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1.05em;
	width: 7px;
	height: 2px;
	background: var(--wp--preset--color--blue);
}

.cc-meganav__child:hover,
.cc-meganav__child:focus-visible { border-bottom-color: var(--wp--preset--color--blue); }

.cc-meganav__child.is-current { font-weight: 600; border-bottom-color: var(--wp--preset--color--black); }

/* --- The section's own block ---------------------------------------------
   Black, so the panel has a right-hand edge instead of trailing off into the
   page. This is the only survivor of the old third column.                  */

.cc-meganav__aside {
	position: relative;
	padding: var(--wp--preset--spacing--30);
	background: var(--wp--preset--color--black);
	color: var(--wp--preset--color--white);
}

/* The panel is full-bleed but its content is capped at the container width, so
   above ~1440px the black block stops short of the panel's own edge and
   leaves a strip of white beside it — which reads as a bug rather than as a
   margin. This runs the ground out to the edge while the text inside stays
   on the container's grid.

   The aside is the FIRST (left) column as of 2026-09-23 — it was the last
   (right) column when this was written, bleeding off inset-inline-start:100%
   toward the right edge. Swapping the columns without swapping this would
   leave the real gap (now on the left) unfilled while painting black off the
   wrong side. inset-inline-end:100% is the mirror: it bleeds toward the
   left edge instead. */
.cc-meganav__aside::after {
	content: '';
	position: absolute;
	inset-block: 0;
	inset-inline-end: 100%;
	width: 100vw;
	background: var(--wp--preset--color--black);
}

.cc-meganav__asidetitle {
	margin: 0 0 0.6rem;
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	color: var(--wp--preset--color--white);
}

/* A short accent rule, not a border spanning the whole column — width is
   fixed, independent of the heading's text length. */
.cc-meganav__rule {
	width: 32px;
	height: 2px;
	margin: 0 0 0.9rem;
	background: var(--wp--preset--color--blue);
}

.cc-meganav__summary {
	margin: 0 0 var(--wp--preset--spacing--20);
	max-width: 46ch;
	font-size: var(--wp--preset--font-size--sm);
	line-height: 1.55;
	color: var(--cc-body-dark);
}

/* A quiet-CTA look — matches the .cc-cta--quiet primitive's spirit (bordered
   underline, no fill) rather than reading as a bare paragraph link. White on
   black passes; blue on black also passes, so the hover swap below is safe
   either direction. */
.cc-meganav__all {
	display: inline-block;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	color: var(--wp--preset--color--white);
	text-decoration: none;
	border-bottom: 2px solid var(--wp--preset--color--blue);
	padding-bottom: 0.15rem;
	transition:
		color var(--cc-hover-dur) var(--cc-hover-ease),
		border-bottom-color var(--cc-hover-dur) var(--cc-hover-ease);
}

.cc-meganav__all:hover,
.cc-meganav__all:focus-visible {
	color: var(--wp--preset--color--blue);
	border-bottom-color: var(--wp--preset--color--white);
}

/* The open trigger reads as the tab that owns the panel beneath it. */
.cc-nav__list .cc-nav__trigger[aria-expanded="true"] {
	box-shadow: inset 0 -3px 0 var(--wp--preset--color--black);
}

/* --- Mobile toggle ------------------------------------------------------- */

.cc-navtoggle {
	display: none;
	align-items: center;
	gap: 0.6rem;
	margin-left: auto;
	padding: 0.6rem 0.9rem;
	font-size: var(--wp--preset--font-size--sm);
	font-weight: 600;
	color: var(--wp--preset--color--black);
	background: none;
	border: 2px solid var(--cc-rule);
	border-radius: 2px;
	cursor: pointer;
}

.cc-navtoggle__bars,
.cc-navtoggle__bars::before,
.cc-navtoggle__bars::after {
	display: block;
	width: 18px;
	height: 2px;
	background: var(--wp--preset--color--black);
}

.cc-navtoggle__bars { position: relative; }
.cc-navtoggle__bars::before,
.cc-navtoggle__bars::after { content: ""; position: absolute; left: 0; }
.cc-navtoggle__bars::before { top: -6px; }
.cc-navtoggle__bars::after { top: 6px; }


/* --- Below 1024px --------------------------------------------------------
   The container question does not arise on a phone: there is one width and the
   menu is a list. Panels go static and stack under their trigger — an
   accordion, not the drill-down the overlay needed, because with the detail
   column gone there is no second screen to drill into.

   .cc-meganav stops being positioned here, so it scrolls with the nav rather
   than hanging off a bar that is only 60px tall.                            */

@media (max-width: 1023px) {

	.cc-navtoggle { display: inline-flex; }

	/* The nav and its panels become one scrollable column below the masthead. */
	.cc-nav {
		position: absolute;
		inset-inline: 0;
		top: 100%;
		max-height: calc(100vh - var(--cc-header-h) - var(--cc-admin-bar-h, 0px));
		max-height: calc(100svh - var(--cc-header-h) - var(--cc-admin-bar-h, 0px));
		overflow-y: auto;
		background: var(--wp--preset--color--white);
		border-top: 1px solid var(--wp--preset--color--black);
		display: none;
	}

	.cc-masthead.is-open .cc-nav { display: block; }

	.cc-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 0;
	}

	.cc-nav__item { border-bottom: 1px solid var(--cc-rule); }

	/* Active section on the stacked list: blue bar down the left edge instead
	   of the desktop underline. Inset shadow so the label doesn't shift. */
	.cc-nav__item.is-active .cc-nav__trigger {
		border-bottom-color: transparent;
		box-shadow: inset 4px 0 0 var(--wp--preset--color--blue);
	}

	.cc-nav__list .cc-nav__trigger {
		display: block;
		width: 100%;
		padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
		text-align: left;
	}

	.cc-nav__list .cc-nav__trigger[aria-expanded="true"] {
		box-shadow: none;
		background: var(--wp--preset--color--black);
		color: var(--wp--preset--color--white);
	}

	/* Static, so each panel sits directly under the item that opened it. */
	.cc-meganav__panel {
		position: static;
		inset: auto;
		border-top: 0;
		border-bottom: 1px solid var(--cc-rule);
	}

	.cc-meganav__inner {
		grid-template-columns: 1fr;
	}

	.cc-meganav__linkgrid {
		flex-direction: column;
		gap: 0;
		padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	}

	/* The black block would be a slab mid-list. On a phone the summary is the
	   least useful thing in the panel — the person already tapped the section,
	   so they know which one they are in. Links and the hub link only. */
	.cc-meganav__aside {
		padding: 0 var(--wp--preset--spacing--30) var(--wp--preset--spacing--20);
		background: none;
		color: inherit;
	}

	.cc-meganav__aside::after { display: none; }

	.cc-meganav__asidetitle,
	.cc-meganav__rule,
	.cc-meganav__summary { display: none; }

	.cc-meganav__all { color: var(--wp--preset--color--black); }

	/* The rail is flex with justify-content: flex-end, so when the utility
	   links wrap the About item is pushed off the left edge rather than onto
	   its own line. Wrapping the container is what lets it land. */
	.cc-rail__inner {
		flex-wrap: wrap;
		justify-content: center;
		gap: 0 0.5rem;
	}

	.cc-rail__list { flex-wrap: wrap; justify-content: center; }

	/* Desktop only (Andy, 2026-11-16). The footer carries the number here. */
	.cc-rail__phone { display: none; }

	/* Logo, Menu and the CTA on one row at 390px is about 400px of content in
	   342px of space, and the CTA was being clipped off the right edge. The
	   gap comes down and the logo with it rather than dropping the CTA — it is
	   the primary conversion action and a phone is where it matters most. */
	.cc-masthead__inner {
		flex-wrap: wrap;
		gap: var(--wp--preset--spacing--20);
		row-gap: 0;
	}

	.cc-masthead { --cc-logo-h: 28px; }

	.cc-masthead__cta { margin-inline-start: auto; }

	/* Mobile header (Andy, 2026-11-04): icon-only hamburger, far right, with
	   Become a Partner between it and the logo. The "Menu" label is hidden;
	   the button keeps its aria-label, so screen readers still hear "Menu".
	   44px square tap target, no border — the house style puts emphasis on
	   the CTA, not on the toggle. */
	.cc-masthead__cta { order: 2; }
	.cc-navtoggle {
		order: 3;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin-left: 0;
		margin-right: -11px; /* bars sit on the content edge; tap area overhangs */
		padding: 0;
		border: 0;
	}
	.cc-navtoggle__text { display: none; }
	.cc-navtoggle__bars,
	.cc-navtoggle__bars::before,
	.cc-navtoggle__bars::after { width: 22px; }
	.cc-navtoggle__bars::before { top: -7px; }
	.cc-navtoggle__bars::after { top: 7px; }
	.cc-navtoggle:focus-visible { outline: 2px solid var(--wp--preset--color--blue); outline-offset: -2px; }
	.cc-nav { order: 4; }
}

@media (max-width: 600px) {
	/* Phones: logo, a smaller Become a Partner and the hamburger on one row
	   (Andy, 2026-11-04 — replaces the full-width CTA row, which doubled the
	   masthead's height). --cc-header-h is still measured in JS, so the
	   reserved space follows whatever height this ends up. */
	.cc-masthead__inner {
		flex-wrap: nowrap;
		gap: 0.75rem;
		min-height: 64px;
	}

	.cc-masthead__cta .cc-cta {
		padding: 0.5rem 0.85rem;
		font-size: var(--wp--preset--font-size--xs);
		white-space: nowrap;
	}
}

@media (max-width: 374px) {
	/* Small phones (320–374px): shave the logo and the button so the row
	   still fits without wrapping. */
	.cc-masthead { --cc-logo-h: 22px; }
	.cc-masthead__inner { gap: 0.5rem; padding-inline: var(--wp--preset--spacing--20); }
	.cc-masthead__cta .cc-cta { padding: 0.45rem 0.6rem; }
}
/* --- Fixed-header motion ------------------------------------------------- */

/* GSAP drives the transform when it is present. This transition is the
   no-JS / no-GSAP fallback so the header still behaves, just without easing. */
.cc-header { transition: transform 200ms linear; }

@media (prefers-reduced-motion: reduce) {
	.cc-header { transition: none; }

	/* Hover feedback still has to be instant and obvious — the states below
	   keep their colors, they just stop easing into them. */
	.cc-rail__list a,
	.cc-rail__trigger,
	.cc-nav__trigger,
	.cc-meganav__all,
	.cc-meganav__child { transition: none; }
}

/* No JS: a panel can never open, so the section triggers would be dead ends.
   Hide them and let the footer menus carry navigation instead. The CTA and the
   rail links are plain <a>s, so they survive and still work. */
.no-js .cc-nav,
.no-js .cc-navtoggle { display: none; }
