/**
 * Absolute 2026: header styles.
 *
 * Two tiers: a white masthead (logo, brand line, phone lines, Get a quote)
 * above a dark navigation bar. The header is sticky with a negative top
 * offset equal to the masthead height (--masthead-h), so on desktop the
 * masthead scrolls away and the bar stays pinned. navigation.js adds:
 * - .is-stuck once the page has scrolled (shadow);
 * - .is-condensed once the masthead is out of view (logo mark and compact
 *   Get a quote appear in the bar).
 *
 * Below 1080px only the masthead shows, and the menu is a full-screen drawer
 * with accordion panels.
 *
 * @package Absolute_2026
 * @author  Steve Austen
 * @company The PCGP
 * @version 0.3.0
 */

/* ==========================================================================
   Header shell
   ========================================================================== */

.site-header {
	--masthead-h: 4rem;
	--navbar-h: 0px;
	position: sticky;
	top: 0;
	z-index: 100;
	background: #fff;
	transition: box-shadow 0.25s;
}

/* Split brand stripe along the bottom edge: Photocopiers green | Facilities purple. */
.site-header::after {
	content: "";
	display: block;
	height: 3px;
	background: linear-gradient(90deg, var(--photocopiers-700) 0 50%, var(--facilities-700) 50% 100%);
}

.site-header.is-stuck {
	box-shadow: 0 8px 28px rgb(23 20 28 / 12%);
}

@media (min-width: 67.5em) {
	.site-header {
		--masthead-h: 5.75rem;
		--navbar-h: 3.5rem;
		/* Pin only the navigation bar: the masthead scrolls out of view above it. */
		top: calc(var(--masthead-h) * -1);
	}
}

/* ==========================================================================
   Masthead
   ========================================================================== */

.masthead {
	position: relative;
	border-bottom: 1px solid var(--line);
}

/*
 * 1px marker near the bottom of the masthead; watched by navigation.js.
 * It sits 4px up, because a marker exactly touching the viewport edge still
 * counts as "intersecting" and would never report the masthead as gone.
 */
.masthead__sentinel {
	position: absolute;
	bottom: 4px;
	left: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

.masthead__inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: var(--masthead-h);
}

.site-logo {
	display: block;
	flex-shrink: 0;
	margin-right: auto;
	border-radius: 4px;
}

.site-logo img {
	width: auto;
	height: 2.25rem;
}

/* Brand line beside the logo, wide screens only. */
.masthead__tagline {
	display: none;
	margin: 0;
	padding-left: 1.5rem;
	border-left: 1px solid var(--line);
	color: var(--ink-3);
	font-family: var(--font-serif);
	font-size: 1.0625rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
}

/* Desktop contact block */
.masthead__contact {
	display: none;
	align-items: center;
	gap: 1.75rem;
}

.contact-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.7rem;
	color: var(--ink);
	text-decoration: none;
	border-radius: var(--radius-sm);
}

.contact-chip__icon {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: var(--surface-2);
	color: var(--ink);
	transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.contact-chip:hover .contact-chip__icon {
	border-color: var(--ink);
	background: var(--ink);
	color: #fff;
}

.contact-chip__text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.contact-chip__label {
	color: var(--ink-3);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.contact-chip__value {
	font-size: 1.125rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

.contact-chip:hover .contact-chip__value {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.header-cta {
	min-height: 3rem;
	padding-inline: 1.25rem;
}

/* Compact actions (phones and tablets) */
.masthead__compact {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: #fff;
	color: var(--ink);
}

.header-cta-compact {
	display: none;
	min-height: 2.75rem;
}

@media (min-width: 30em) {
	.header-cta-compact {
		display: inline-flex;
	}
}

.menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: #fff;
	color: var(--ink);
	cursor: pointer;
}

/* Show the "menu" icon when closed and the "close" icon when open. */
.menu-toggle__open {
	display: inline-flex;
}

.menu-toggle__close,
.menu-toggle[aria-expanded="true"] .menu-toggle__open {
	display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__close {
	display: inline-flex;
}

@media (min-width: 67.5em) {
	.masthead__inner {
		gap: 1.75rem;
	}

	.site-logo {
		margin-right: 0;
	}

	.site-logo img {
		height: 3.25rem;
	}

	.masthead__contact {
		display: flex;
		margin-left: auto;
	}

	.masthead__compact {
		display: none;
	}
}

@media (min-width: 80em) {
	.masthead__tagline {
		display: block;
	}
}

/* ==========================================================================
   Navigation bar (desktop) and drawer (smaller screens)
   ========================================================================== */

/*
 * Below 1080px the bar takes no space; it only hosts the drawer, which is
 * fixed to the viewport under the masthead.
 */
.navbar__mark,
.navbar__extras {
	display: none;
}

.site-nav__panel {
	display: none;
	position: fixed;
	top: var(--nav-top, 4.25rem);
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0.5rem var(--gutter) 2.5rem;
	background: #fff;
}

.site-nav.is-open .site-nav__panel {
	display: block;
}

/* Stop the page behind the open drawer from scrolling. */
body.menu-open {
	overflow: hidden;
}

.menu > li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	border-bottom: 1px solid var(--line);
}

.menu .nav-link {
	flex: 1;
	padding: 1rem 0;
	color: var(--ink);
	font-size: 1.125rem;
	font-weight: 700;
	text-decoration: none;
}

/* Division ribbon before "Photocopiers" and "Facilities", echoing the logo mark. */
.menu > li[data-division] > .nav-link::before {
	content: "";
	display: inline-block;
	width: 0.5rem;
	height: 0.95rem;
	margin-right: 0.6rem;
	background: var(--accent);
	transform: skewX(-22deg);
	vertical-align: -0.08em;
}

.submenu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--ink);
	cursor: pointer;
}

.submenu-toggle .icon {
	transition: transform 0.2s var(--ease);
}

.menu-item.is-open > .submenu-toggle .icon {
	transform: rotate(180deg);
}

.mega-panel {
	display: none;
	flex-basis: 100%;
	padding-bottom: 1rem;
}

.menu-item.is-open > .mega-panel {
	display: block;
}

/* Intro and promo columns are desktop extras; the drawer lists the links only. */
.mega-panel__intro,
.mega-panel__promo {
	display: none;
}

.mega-panel__links {
	display: grid;
	gap: 0.25rem;
}

.mega-link a {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	padding: 0.6rem 0.5rem;
	border-radius: var(--radius-sm);
	color: var(--ink);
	text-decoration: none;
	transition: background-color 0.15s;
}

.mega-link a:hover,
.mega-link.is-current a {
	background: var(--accent-tint);
}

.mega-link__icon {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--accent-tint-2);
	color: var(--accent);
}

.mega-link__text {
	display: flex;
	flex-direction: column;
	padding-top: 0.1rem;
}

.mega-link__title {
	font-weight: 700;
	line-height: 1.3;
}

.mega-link__desc {
	color: var(--ink-3);
	font-size: 0.875rem;
	line-height: 1.4;
}

.site-nav__extras {
	display: grid;
	gap: 0.25rem;
	margin-top: 1rem;
}

.site-nav__extras a {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.75rem 0;
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
}

/* Desktop: the dark navigation bar */
@media (min-width: 67.5em) {
	.navbar {
		background: var(--ink);
		color: #fff;
		--focus-ring: #fff;
	}

	.navbar__inner {
		display: flex;
		align-items: center;
		min-height: var(--navbar-h);
	}

	/* Logo mark: collapsed until the masthead scrolls away. */
	.navbar__mark {
		display: block;
		flex-shrink: 0;
		width: 0;
		margin-right: 0;
		overflow: hidden;
		opacity: 0;
		transition: width 0.3s var(--ease), margin 0.3s var(--ease), opacity 0.3s;
	}

	.navbar__mark img {
		width: 2.25rem;
		max-width: none;
		height: auto;
	}

	.site-header.is-condensed .navbar__mark {
		width: 2.25rem;
		margin-right: 1.5rem;
		opacity: 1;
	}

	.site-nav {
		flex: 1;
	}

	.site-nav__panel {
		display: block;
		position: static;
		overflow: visible;
		padding: 0;
		background: transparent;
	}

	.site-nav__extras {
		display: none;
	}

	.menu {
		display: flex;
		align-items: center;
		gap: 0.25rem;
		margin-left: -0.75rem;
	}

	/* li stays static so mega panels position against the full-width header. */
	.menu > li {
		flex-wrap: nowrap;
		border: 0;
	}

	.menu .nav-link {
		position: relative;
		display: inline-flex;
		align-items: center;
		padding: 0 0.75rem;
		min-height: var(--navbar-h);
		color: #fff;
		font-size: 1rem;
		font-weight: 600;
	}

	.menu > .has-mega > .nav-link {
		padding-right: 0.2rem;
	}

	/* On the dark bar the ribbons use the bright division accents (lime and lilac). */
	.menu > li[data-division] > .nav-link::before {
		background: var(--accent-bright);
	}

	/* Underline bar: division colour for the divisions, white for the rest. */
	.menu .nav-link::after {
		content: "";
		position: absolute;
		right: 0.75rem;
		bottom: 0;
		left: 0.75rem;
		height: 3px;
		background: #fff;
		transform: scaleX(0);
		transform-origin: left;
		transition: transform 0.2s var(--ease);
	}

	.menu > li[data-division] > .nav-link::after {
		background: var(--accent-bright);
	}

	.menu > .has-mega > .nav-link::after {
		right: 0.2rem;
	}

	.menu .nav-link:hover::after,
	.menu > .is-current > .nav-link::after,
	.menu > .is-open > .nav-link::after {
		transform: scaleX(1);
	}

	.submenu-toggle {
		width: 2rem;
		height: var(--navbar-h);
		color: rgb(255 255 255 / 80%);
	}

	.submenu-toggle:hover {
		color: #fff;
	}

	.navbar__extras {
		display: flex;
		align-items: center;
		gap: 1.25rem;
		margin-left: auto;
	}

	.navbar__link {
		display: inline-flex;
		align-items: center;
		gap: 0.45rem;
		min-height: var(--navbar-h);
		color: rgb(255 255 255 / 85%);
		font-size: 0.9375rem;
		font-weight: 600;
		text-decoration: none;
	}

	.navbar__link:hover {
		color: #fff;
		text-decoration: underline;
		text-underline-offset: 0.2em;
	}

	/* Compact Get a quote: only while the masthead (with the main button) is out of view. */
	.navbar__cta {
		--accent: var(--photocopiers-400);
		--accent-strong: #fff;
		color: var(--ink);
		visibility: hidden;
		opacity: 0;
		transition: opacity 0.25s, visibility 0s linear 0.25s;
	}

	.navbar__cta:hover {
		color: var(--ink);
	}

	.site-header.is-condensed .navbar__cta {
		visibility: visible;
		opacity: 1;
		transition-delay: 0s;
	}

	/* Mega panels drop from the bottom of the header. */
	.mega-panel {
		display: block;
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		padding: 2rem 0 2.25rem;
		border-top: 3px solid var(--accent);
		background: #fff;
		color: var(--ink-2);
		box-shadow: var(--shadow-lg);
		visibility: hidden;
		opacity: 0;
		transform: translateY(-6px);
		transition: opacity 0.18s, transform 0.18s var(--ease), visibility 0s linear 0.18s;
		--focus-ring: var(--ink);
	}

	.menu-item.is-open > .mega-panel,
	html:not(.js) .has-mega:hover > .mega-panel {
		visibility: visible;
		opacity: 1;
		transform: none;
		transition-delay: 0s;
	}

	.mega-panel__inner {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
		gap: 2.5rem;
		max-width: calc(var(--container) + var(--gutter) * 2);
		margin-inline: auto;
		padding-inline: var(--gutter);
	}

	.mega-panel__intro {
		display: block;
	}

	.mega-panel__text {
		color: var(--ink-2);
	}

	.mega-panel__hub-link {
		display: inline-flex;
		align-items: center;
		gap: 0.4rem;
		color: var(--accent);
		font-weight: 700;
		text-decoration: none;
	}

	.mega-panel__hub-link:hover {
		text-decoration: underline;
	}

	.mega-panel__links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		align-content: start;
		gap: 0.35rem 1rem;
	}

	.mega-panel__promo {
		display: block;
		align-self: start;
		padding: 1.4rem;
		border-left: 4px solid var(--accent);
		border-radius: var(--radius);
		background: var(--accent-tint);
	}

	.mega-panel__promo-title {
		margin-bottom: 0.4rem;
		color: var(--ink);
		font-family: var(--font-serif);
		font-size: 1.25rem;
		font-weight: 600;
		line-height: 1.2;
	}

	.mega-panel__promo-text {
		color: var(--ink-2);
		font-size: var(--text-sm);
	}
}
