/*
 * Stays mega-panel — desktop primary navigation only.
 * Scoped under .header-main (Neve's desktop row). The mobile sidebar
 * (#header-menu-sidebar) never matches these selectors.
 * Faces are the theme's own: 'Signifier Medium' (display serif) and
 * 'Söehne Buch' (text). No new fonts.
 */
@media screen and (min-width: 960px) {

	/* The panel is anchored to Neve's positioned .builder-item (the nav block),
	   not to the <li>, so it hangs below the whole bar, right-aligned to the nav. */
	.header-main .nav-ul li.xw-mega-item {
		position: static;
	}

	.header-main .xw-mega-panel {
		--xw-mega-ink: #1a1a1a;
		--xw-mega-muted: #666666;
		--xw-mega-rule: rgba(26, 26, 26, 0.14);
		--xw-mega-tag: #b8962c;
		--xw-mega-serif: 'Signifier Medium', Georgia, 'Times New Roman', serif;
		--xw-mega-sans: 'Söehne Buch', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

		position: absolute;
		top: 100%;
		right: 0;
		left: auto;
		z-index: 1000;
		box-sizing: border-box;
		width: 860px;
		max-width: calc(100vw - 32px);
		padding: 40px 40px 36px;
		background: #ffffff;
		color: var(--xw-mega-ink);
		box-shadow: 0 24px 48px rgba(11, 27, 44, 0.18);
		font-family: var(--xw-mega-sans);
		font-weight: 400;
		text-align: left;
		display: none;
	}
	.header-main .xw-mega-panel * {
		box-sizing: border-box;
	}

	/* Open state: JS sets .is-open (hover intent, focus-within, caret, Escape). */
	.header-main .xw-mega-panel.is-open {
		display: block;
	}

	.header-main .xw-mega-grid {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 314px minmax(0, 1fr);
		column-gap: 36px;
		align-items: start;
	}

	/* Small-caps eyebrows */
	.header-main .xw-mega-heading {
		margin: 0 0 18px;
		padding: 0;
		font-family: var(--xw-mega-sans);
		font-size: 11px;
		font-weight: 400;
		line-height: 1;
		letter-spacing: 0.18em;
		text-transform: uppercase;
		color: var(--xw-mega-ink);
	}

	/* Ruled link list — reset Neve's .nav-ul li / a rules inside the panel. */
	.header-main .nav-ul .xw-mega-sublist {
		list-style: none;
		margin: 0;
		padding: 0;
		border-top: 1px solid var(--xw-mega-rule);
	}
	.header-main .nav-ul .xw-mega-sublist li {
		display: block;
		position: static;
		margin: 0;
		padding: 0;
		min-width: 0;
		border-bottom: 1px solid var(--xw-mega-rule);
	}
	.header-main .nav-ul .xw-mega-sublist li a {
		display: block;
		position: static;
		min-height: 0;
		margin: 0;
		padding: 13px 0;
		font-family: var(--xw-mega-sans);
		font-size: 16px;
		line-height: 1.5;
		color: var(--xw-mega-ink);
		text-decoration: none;
		white-space: normal;
		transition: color 0.15s ease;
	}
	.header-main .nav-ul .xw-mega-sublist li a:hover,
	.header-main .nav-ul .xw-mega-sublist li a:focus-visible {
		color: var(--xw-mega-muted);
	}

	/* Featured card */
	.header-main .nav-ul li a.xw-mega-featured {
		display: block;
		position: static;
		min-height: 0;
		margin: 0;
		padding: 0;
		color: var(--xw-mega-ink);
		text-decoration: none;
	}
	.header-main .xw-mega-featured-image {
		display: block;
		width: 314px;
		height: 300px;
		overflow: hidden;
		background: #e8e8e8;
	}
	.header-main .xw-mega-featured-image img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
		object-position: center;
		transition: transform 0.6s ease;
	}
	.header-main .nav-ul li a.xw-mega-featured:hover .xw-mega-featured-image img {
		transform: scale(1.03);
	}
	.header-main .xw-mega-featured-meta {
		display: block;
		padding-top: 16px;
	}
	.header-main .xw-mega-featured-tag {
		display: block;
		margin-bottom: 8px;
		font-size: 10px;
		line-height: 1;
		letter-spacing: 0.18em;
		text-transform: uppercase;
		color: var(--xw-mega-tag);
	}
	.header-main .xw-mega-featured-title {
		display: block;
		font-family: var(--xw-mega-serif);
		font-size: 28px;
		font-weight: 500;
		line-height: 1.15;
		color: var(--xw-mega-ink);
	}
	.header-main .xw-mega-featured-sub {
		display: block;
		margin-top: 8px;
		font-size: 13px;
		line-height: 1.5;
		color: var(--xw-mega-muted);
	}

	/* Season note: italic serif quote with a hairline on its left */
	.header-main .xw-mega-season-text {
		margin: 0;
		padding: 2px 0 2px 16px;
		border-left: 1px solid var(--xw-mega-rule);
		font-family: var(--xw-mega-serif);
		font-style: italic;
		font-size: 17px;
		line-height: 1.45;
		color: var(--xw-mega-ink);
	}

	@media (prefers-reduced-motion: reduce) {
		.header-main .xw-mega-featured-image img,
		.header-main .nav-ul .xw-mega-sublist li a {
			transition: none;
		}
	}
}

/*
 * Neve sets text-transform: uppercase on .nv-nav-wrap and it inherits into everything inside the
 * nav, including this panel. Reset it on the panel root with enough specificity to win, then let
 * the two eyebrows opt back in. Without this the italic season quote rendered in capitals.
 */
.header-main .nv-nav-wrap .xw-mega-panel,
.header-main .nv-nav-wrap .xw-mega-panel * {
	text-transform: none;
	letter-spacing: normal;
}
.header-main .nv-nav-wrap .xw-mega-heading,
.header-main .nv-nav-wrap .xw-mega-featured-tag {
	text-transform: uppercase;
	letter-spacing: 0.14em;
}
