/* ==========================================================================
   NP INVESTOR — CUSTOM HEADER + MEGA-MENU (Fase 5)
   ========================================================================== */

/* Skjul Astras egen header helt — vi rendrer vores egen. */
#masthead { display: none !important; }

.np-hd {
	position: sticky; top: 0; z-index: 200;
	background: var(--np-navy-700);
	box-shadow: 0 1px 0 rgba(0,0,0,.28);
}
.np-hd__inner {
	max-width: var(--np-container); margin: 0 auto;
	padding: 0 clamp(16px, 4vw, 32px);
	height: var(--np-header-h);
	display: flex; align-items: center; gap: 26px;
}
.np-hd .np-logo { flex: 0 0 auto; color: #fff; }
.np-hd__nav { flex: 1 1 auto; min-width: 0; }
.np-hd__menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.np-hd__item { position: relative; }
.np-hd__link {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 10px 13px; border-radius: 8px;
	color: rgba(255,255,255,.86);
	font-family: var(--np-font-sans); font-weight: 500; font-size: 15px; letter-spacing: -.01em;
	white-space: nowrap;
}
.np-hd__link:hover, .np-hd__item--mega:hover > .np-hd__link { color: #fff; }
.np-hd__chev { font-size: 10px; opacity: .8; transition: transform .16s ease; }
.np-hd__item--mega:hover > .np-hd__link .np-hd__chev { transform: rotate(180deg); }

/* Mega-panel */
.np-mega {
	position: absolute; top: calc(100% + 8px); left: 0;
	background: var(--np-navy-800);
	border: 1px solid rgba(255,255,255,.08); border-radius: 14px;
	box-shadow: var(--np-shadow-lg);
	padding: 26px 28px;
	width: max-content; max-width: 94vw;
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}
.np-hd__item--mega:hover > .np-mega { opacity: 1; visibility: visible; transform: translateY(0); }
.np-mega::before { /* usynlig bro saa hover ikke falder */
	content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 12px;
}
.np-mega__grid { display: flex; flex-wrap: nowrap; align-items: flex-start; }
.np-mega__col { flex: 0 0 auto; min-width: 172px; padding: 0 24px; }
.np-mega__col:first-child { padding-left: 0; }
.np-mega__col + .np-mega__col { border-left: 1px solid rgba(255,255,255,.08); }
.np-mega__title {
	display: block; font-family: var(--np-font-sans);
	font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
	color: #2fe0cf; margin-bottom: 12px;
}
.np-mega__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.np-mega__col a {
	display: block; padding: 7px 10px; margin: 0 -10px; border-radius: 8px;
	color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.35;
	transition: background .12s ease, color .12s ease;
}
.np-mega__col a:hover { background: rgba(255,255,255,.07); color: #fff; }
.np-mega__all { margin-top: 6px; }
.np-mega__all a { color: #2fe0cf; font-weight: 600; }
.np-mega__all a:hover { background: rgba(47,224,207,.12); color: #4ff0e0; }

/* CTA */
.np-hd__cta {
	flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
	background: var(--np-accent); color: var(--np-accent-ink) !important;
	font-family: var(--np-font-sans); font-weight: 600; font-size: 14px;
	padding: 9px 16px; border-radius: 8px; white-space: nowrap;
	transition: background .15s ease, transform .15s ease;
}
.np-hd__cta:hover { background: var(--np-accent-600); transform: translateY(-1px); }

/* Burger + drawer-elementer skjult paa desktop */
.np-hd__burger { display: none; }
.np-hd__drawer-head, .np-hd__drawer-foot { display: none; }

@keyframes npNavIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   MOBIL
   ========================================================================== */
@media (max-width: 980px) {
	.np-hd__inner { gap: 12px; }
	.np-hd__cta { font-size: 13px; padding: 8px 13px; margin-left: auto; }

	/* Burger -> X */
	.np-hd__burger {
		display: inline-flex; flex-direction: column; gap: 5px;
		background: none; border: 0; padding: 8px; cursor: pointer; flex: 0 0 auto;
	}
	.np-hd__burger span { width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
	.np-hd.is-open .np-hd__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.np-hd.is-open .np-hd__burger span:nth-child(2) { opacity: 0; }
	.np-hd.is-open .np-hd__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

	/* Drawer */
	.np-hd__nav {
		position: fixed; top: var(--np-header-h); left: 0; right: 0; bottom: 0;
		display: flex; flex-direction: column;
		background: linear-gradient(180deg, var(--np-navy-700), var(--np-navy-800, #0a1c30));
		overflow-y: auto; -webkit-overflow-scrolling: touch;
		transform: translateX(100%); visibility: hidden;
		transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility .28s;
		box-shadow: -18px 0 40px rgba(0, 0, 0, .28);
	}
	.np-hd.is-open .np-hd__nav { transform: translateX(0); visibility: visible; }

	/* Drawer-hoved: titel + luk */
	.np-hd__drawer-head {
		display: flex; align-items: center; justify-content: space-between;
		padding: 14px clamp(16px, 4vw, 28px);
		border-bottom: 1px solid rgba(255, 255, 255, .1);
		position: sticky; top: 0; z-index: 2;
		background: var(--np-navy-700);
	}
	.np-hd__drawer-title {
		font-family: var(--np-font-sans); font-size: 12px; font-weight: 700;
		letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .45);
	}
	.np-hd__close {
		display: inline-flex; align-items: center; justify-content: center;
		width: 38px; height: 38px; border: 0; border-radius: 10px;
		background: rgba(255, 255, 255, .08); color: #fff; font-size: 26px; line-height: 1;
		cursor: pointer; transition: background .15s ease;
	}
	.np-hd__close:hover { background: rgba(255, 255, 255, .16); }

	/* Menu */
	.np-hd__menu { flex-direction: column; align-items: stretch; gap: 0; padding: 6px clamp(16px, 4vw, 28px) 4px; }
	.np-hd__link {
		font-family: var(--np-font-display); font-size: 18px; font-weight: 600;
		padding: 16px 4px; justify-content: space-between; color: #fff;
		border-bottom: 1px solid rgba(255, 255, 255, .08); border-radius: 0;
	}
	.np-hd__link:hover, .np-hd__link:focus { color: #fff; }
	.np-hd__chev { font-size: 13px; opacity: .55; transition: transform .28s ease, opacity .2s ease; }
	.np-hd__item--mega.is-open > .np-hd__link { color: var(--np-accent); }
	.np-hd__item--mega.is-open > .np-hd__link .np-hd__chev { transform: rotate(180deg); opacity: 1; }

	/* Blød accordion (grid-rows 0fr -> 1fr) */
	.np-mega {
		position: static; width: auto; max-width: none;
		opacity: 1; visibility: visible; transform: none;
		background: transparent; border: 0; box-shadow: none; border-radius: 0;
		display: grid; grid-template-rows: 0fr; padding: 0;
		transition: grid-template-rows .28s ease;
	}
	.np-hd__item--mega:hover > .np-mega { opacity: 1; visibility: visible; } /* deaktiver hover */
	.np-hd__item--mega.is-open > .np-mega { grid-template-rows: 1fr; }
	.np-mega__grid { flex-direction: column; gap: 14px; overflow: hidden; min-height: 0; padding: 4px 0 14px 14px; }

	/* Drawer-fod: CTA + social + kontakt */
	.np-hd__drawer-foot {
		display: block; margin-top: auto;
		padding: 20px clamp(16px, 4vw, 28px) calc(24px + env(safe-area-inset-bottom));
		border-top: 1px solid rgba(255, 255, 255, .1);
	}
	.np-hd__drawer-cta {
		display: flex; align-items: center; justify-content: center; gap: 8px;
		background: var(--np-accent); color: var(--np-accent-ink) !important;
		font-family: var(--np-font-sans); font-weight: 700; font-size: 15px;
		padding: 14px; border-radius: 12px; text-decoration: none;
	}
	.np-hd__drawer-cta:hover { filter: brightness(1.06); }
	.np-hd__drawer-social { display: flex; gap: 10px; margin-top: 16px; }
	.np-hd__drawer-social a {
		display: inline-flex; align-items: center; justify-content: center;
		width: 42px; height: 42px; border-radius: 10px;
		background: rgba(255, 255, 255, .08); color: #fff; transition: background .15s ease;
	}
	.np-hd__drawer-social a:hover { background: rgba(255, 255, 255, .16); }
	.np-hd__drawer-mail { display: inline-block; margin-top: 14px; color: rgba(255, 255, 255, .55); font-size: 13px; text-decoration: none; }
	.np-hd__drawer-mail:hover { color: #fff; }

	/* Stagger-entrance ved aabning */
	.np-hd.is-open .np-hd__menu > li,
	.np-hd.is-open .np-hd__drawer-foot { animation: npNavIn .32s ease both; }
	.np-hd.is-open .np-hd__menu > li:nth-child(1) { animation-delay: .05s; }
	.np-hd.is-open .np-hd__menu > li:nth-child(2) { animation-delay: .09s; }
	.np-hd.is-open .np-hd__menu > li:nth-child(3) { animation-delay: .13s; }
	.np-hd.is-open .np-hd__menu > li:nth-child(4) { animation-delay: .17s; }
	.np-hd.is-open .np-hd__menu > li:nth-child(5) { animation-delay: .21s; }
	.np-hd.is-open .np-hd__drawer-foot { animation-delay: .24s; }
	@media (prefers-reduced-motion: reduce) {
		.np-hd.is-open .np-hd__menu > li, .np-hd.is-open .np-hd__drawer-foot { animation: none; }
	}
}

/* Meget smaa telefoner: forkort CTA'en til "Kurser" (bevar den — den er vigtig). */
@media (max-width: 400px) {
	.np-hd__cta { padding: 8px 11px; }
	.np-hd__cta-txt { display: none; }
	.np-hd__cta::after { content: "Kurser"; }
}
