/* ═══════════════════════════════════════════════════════════════════════════
   marketing-header.css — canonical PennaPay marketing chrome (header + footer).

   ONE source of truth for the pennapay.com marketing header, the mobile
   hamburger, and the marketing footer. Copy-paste the matching HTML blocks
   (see docs/marketing-chrome.md / scripts/apply_marketing_chrome.py) onto any
   pennapay.com marketing page and link this file — nothing else styles them.

   SELF-CONTAINED BY DESIGN. Marketing pages load different theme stylesheets
   (pennapay-theme.css defines only --pp-*, marketing-theme.css defines
   --ink/--bg, some pages define neither), so this file must not depend on any
   page-level token. It carries its own private --mh-* palette with a
   [data-theme="dark"] flip, and every rule is namespaced under `.nav` /
   `.site-footer` so it never touches the generic .btn-primary / .btn-ghost
   used elsewhere on these pages.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --mh-bg:          #ffffff;
  --mh-ink:         #0f172a;
  --mh-ink-soft:    #475569;
  --mh-rule:        #e2e8f0;
  --mh-surface:     #f8fafc;
  --mh-gold:        #c9a05a;
  --mh-gold-strong: #b58a3f;
  --mh-gold-text:   #83642a;   /* text/link-safe gold — ≥4.5:1 on #fff (A11Y-02a) */
  --mh-danger:      #c0392b;
  --mh-danger-soft: #fff5f5;
  /* Footer band is intentionally dark in BOTH themes — these are invariant
     "on dark band" text tokens, not page-theme text colors (A11Y-03a). */
  --mh-on-band-muted: #94a3b8; /* footer nav links — 6.79:1 on #1b1a17 */
  --mh-on-band-text:  #8a97a8; /* footer copy/date — 5.86:1 on #1b1a17 */
}
:root[data-theme="dark"] {
  --mh-bg:          #0c1a13;
  --mh-ink:         #f3f6f0;
  --mh-ink-soft:    #c2cfc3;
  --mh-rule:        #284736;
  --mh-surface:     #13261b;
  --mh-gold:        #c9a05a;
  --mh-gold-strong: #b58a3f;
  --mh-gold-text:   #c9a05a;  /* unchanged — already passes on dark --mh-bg (A11Y-02a) */
  --mh-danger:      #f87171;
  --mh-danger-soft: #2a1416;
  --mh-on-band-muted: #94a3b8;
  --mh-on-band-text:  #8a97a8;
}

/* ── Bar ────────────────────────────────────────────────────────────────── */
/* The bar is sticky (below) at a fixed 60px height across every breakpoint —
   only padding/gap change in the responsive rules further down, never
   height. scroll-padding-top clears that height (+ breathing room) for any
   in-page anchor jump (e.g. faktura-skabeloner.html's #download-skabelon) so
   the sticky bar never hides the target heading. Scoped to :has(.nav) so it
   only applies on pages that actually carry this canonical header. */
html:has(.nav) {
  scroll-padding-top: 76px;
}
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--mh-bg);
  border-bottom: 1px solid var(--mh-rule);
  padding: 0 48px;
  height: 60px;
  display: flex; align-items: center; gap: 40px;
}
.nav-brand {
  font-size: 1rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--mh-ink); text-decoration: none;
  flex-shrink: 0;
}
.nav-brand span { color: var(--mh-gold-text); }
/* Feather mark in the wordmark lockup. `.nav-brand span` above paints every
   descendant span gold, so the feather is a sibling <img>, never a wrapping
   span; the wordmark is ONE flex item so the gap sits between feather and
   word and never between "Penna" and its coloured second half. */
.nav-brand { display: inline-flex; align-items: center; gap: 8px; }
.nav-brand-word { font-weight: inherit; letter-spacing: inherit; }
.nav-brand-feather { display: block; transform: rotate(-12deg); }
/* On the dark nav the colour feather is faint (#1800 follow-up): swap in the
   shipped white variant of the same feather. Only the two feathers a nav uses;
   a browser without `content: url()` on <img> keeps the colour one. */
:root[data-theme="dark"] .nav-brand-feather[src$="PennaPay__feather__color.svg"] { content: url("/logos/feathers/PennaPay__feather__white.svg"); }
:root[data-theme="dark"] .nav-brand-feather[src$="PennaSystems__feather__color.svg"] { content: url("/logos/feathers/PennaSystems__feather__white.svg"); }

.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  font-size: .82rem; font-weight: 500; letter-spacing: .03em; text-transform: uppercase;
  color: var(--mh-ink-soft); text-decoration: none;
}
.nav-links a:hover { color: var(--mh-ink); }

/* ── "Freelancers" dropdown ─────────────────────────────────────────────── */
.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown-toggle {
  font: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  font-size: .82rem; font-weight: 500; letter-spacing: .03em; text-transform: uppercase;
  color: var(--mh-ink-soft); display: inline-flex; align-items: center; gap: 5px;
}
.nav-dropdown-toggle::after { content: "▾"; font-size: .62rem; line-height: 1; }
.nav-dropdown-toggle:hover,
.nav-dropdown.open .nav-dropdown-toggle { color: var(--mh-ink); }
.nav-dropdown-menu {
  position: absolute; top: 100%; left: 0; margin-top: 14px;
  display: none; min-width: 230px; z-index: 200;
  background: var(--mh-bg); border: 1px solid var(--mh-rule);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.nav-dropdown-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
  display: block; padding: 11px 18px;
  font-size: .8rem; font-weight: 500; letter-spacing: .02em; text-transform: none;
  color: var(--mh-ink-soft); text-decoration: none; border-bottom: 1px solid var(--mh-rule);
}
.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a:focus { color: var(--mh-ink); background: var(--mh-surface); }

/* ── Right-hand actions ─────────────────────────────────────────────────── */
.nav-cta { margin-left: auto; display: flex; gap: 16px; align-items: center; flex-shrink: 0; }
.nav .btn-ghost {
  font-size: .82rem; font-weight: 500; letter-spacing: .03em; text-transform: uppercase;
  color: var(--mh-ink-soft); text-decoration: none; background: none; border: 0; cursor: pointer;
}
.nav .btn-ghost:hover { color: var(--mh-ink); }
.nav .btn-primary {
  font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--mh-ink); color: #fff;
  padding: 10px 20px; text-decoration: none; border: 0; cursor: pointer;
  transition: background .15s;
}
.nav .btn-primary:hover { background: var(--mh-gold); }
/* --mh-ink is near-white in dark mode; a white-on-white fill would vanish, so
   the primary CTA becomes the gold accent with dark text instead. */
:root[data-theme="dark"] .nav .btn-primary { background: var(--mh-gold); color: #1b1a17; }
:root[data-theme="dark"] .nav .btn-primary:hover { background: var(--mh-gold-strong); }

/* ── Language toggle (mounted by lang-toggle.js) ────────────────────────── */
.nav .lang-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 600; letter-spacing: .05em;
  color: var(--mh-ink-soft);
}
.nav .lang-toggle button {
  background: none; border: none; padding: 4px 6px; cursor: pointer;
  color: inherit; font: inherit; text-transform: uppercase;
}
.nav .lang-toggle button[aria-pressed="true"] { color: var(--mh-ink); font-weight: 700; }
.nav .lang-toggle button:hover { color: var(--mh-ink); }
/* Honest note next to the Norwegian option (rough machine translation, 2026-10-11).
   Stacked under the "NO" label so it adds no header width (the nav is already tight
   at 1280px). The full phrase is also in the button's title/aria-label. */
.nav .lang-toggle button[data-lang="no"] { position: relative; }
.nav .lang-toggle .lang-note {
  position: absolute; top: calc(100% - 4px); left: 50%; transform: translateX(-50%);
  font-size: .6rem; line-height: 1; font-weight: 400; text-transform: none;
  letter-spacing: 0; white-space: nowrap; opacity: .85; pointer-events: none;
}

/* The extra NO option makes the desktop header ~35px wider; on pages that carry it,
   tighten the nav gaps between 769 and 1360px so the CTA is not pushed off-screen. */
@media (min-width: 769px) and (max-width: 1360px) {
  .nav:has(.lang-toggle button[data-lang="no"]) { gap: 26px; }
  .nav:has(.lang-toggle button[data-lang="no"]) .nav-links { gap: 20px; }
}

/* ── Theme toggle (mounted by theme-toggle.js) ──────────────────────────── */
.nav [data-theme-toggle], .nav .theme-toggle {
  background: none; border: 0; padding: 4px; cursor: pointer;
  color: var(--mh-ink-soft); line-height: 0;
}
.nav [data-theme-toggle]:hover, .nav .theme-toggle:hover { color: var(--mh-ink); }

/* ── Hamburger (mobile) ─────────────────────────────────────────────────── */
.nav-hamburger {
  display: none; /* shown ≤768px */
  background: none; border: 0; padding: 8px; margin: 0; cursor: pointer;
  color: var(--mh-ink); line-height: 0; border-radius: 6px;
}
.nav-hamburger:hover { background: var(--mh-surface); }
.nav-hamburger svg { display: block; }
.nav-hamburger .ic-close { display: none; }
.nav.mobile-open .nav-hamburger .ic-open { display: none; }
.nav.mobile-open .nav-hamburger .ic-close { display: block; }

/* Mobile panel — full-width dropdown under the bar; part of the markup so no
   JS DOM-building is needed. Hidden on desktop and until the nav is open. */
.nav-mobile-panel {
  display: none;
  position: absolute; top: 60px; left: 0; right: 0; z-index: 200;
  background: var(--mh-bg); border-bottom: 1px solid var(--mh-rule);
  box-shadow: 0 12px 28px rgba(0,0,0,.10);
  padding: 8px 0;
}
.nav.mobile-open .nav-mobile-panel { display: block; }
.nav-mobile-panel a {
  display: block; padding: 14px 24px;
  font-size: .9rem; font-weight: 500; letter-spacing: .02em;
  color: var(--mh-ink-soft); text-decoration: none;
  border-bottom: 1px solid var(--mh-rule);
}
.nav-mobile-panel a:last-child { border-bottom: none; }
.nav-mobile-panel a:hover { color: var(--mh-ink); background: var(--mh-surface); }
.nav-mobile-panel a.mp-cta { color: var(--mh-ink); font-weight: 700; border-bottom: none; }

/* Legal group (Privacy/Terms/Impressum/Contact) — phone-only home for the
   links that live in .site-footer on desktop, which is display:none below
   the hamburger breakpoint (see the 768px block below). Sits after the
   Sign-in CTA; the CTA's own border-bottom is suppressed above so this
   group's border-top is the only divider between the two. */
.nav-mobile-panel .mp-legal {
  border-top: 1px solid var(--mh-rule);
  margin-top: 4px;
  padding-top: 4px;
}
.nav-mobile-panel .mp-legal a {
  padding: 10px 24px;
  font-size: .78rem;
  color: var(--mh-ink-soft);
  opacity: .75;
}
.nav-mobile-panel .mp-legal a:hover { opacity: 1; color: var(--mh-ink); background: var(--mh-surface); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav { padding: 0 24px; gap: 16px; }
  .nav-links { display: none; }
  .nav-hamburger { display: inline-flex; align-items: center; justify-content: center; }
  /* The brand is flex-shrink:0 above, so once a wordmark grows past the space
     the bar has left it pushes .nav-cta — and with it the hamburger — clean off
     the right edge. "PENNASYSTEMS" measures 172px vs 82px for "PENNAPAY", which
     is why / and /da/ needed 439px and 453px of bar at a 360px viewport while
     the short-wordmark pages fit (FIND-01, docs/qa/pre_influx_checkup_2026-09-04.md).
     Let the brand shrink instead; the ellipsis is the last-resort guard for
     viewports narrower than the 360px target. */
  .nav-brand { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
  .nav .nav-brand-word { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Option 2 (Rune, 2026-09-19): the footer disappears entirely on phones —
     its legal/contact links move into .nav-mobile-panel's .mp-legal group
     above so they stay reachable from every page. Desktop is untouched. */
  .site-footer { display: none; }
}
@media (max-width: 480px) {
  .nav { padding: 0 16px; gap: 12px; }
  .nav-cta { gap: 10px; }
  .nav .btn-primary { padding: 9px 14px; font-size: .72rem; }
  .nav .btn-ghost { font-size: .72rem; }
  .nav .lang-toggle { font-size: .65rem; }
  .nav .lang-toggle button { padding: 4px 4px; }
  .nav-brand { font-size: .84rem; letter-spacing: .02em; gap: 6px; }
  .nav .nav-brand-feather { width: 19px; height: 19px; }
}
/* DA CTAs run ~20% longer — drop the header "Sign in" (it lives in the panel)
   and tighten padding/gaps so the primary CTA never overflows the narrowest
   phones (e.g. "START GRATIS" + hamburger at 390px). */
@media (max-width: 430px) {
  .nav { padding: 0 8px; gap: 6px; }
  .nav-cta { gap: 6px; }
  .nav #nav-signin { display: none; }
  /* The nav inherits each page's font, and index.html's runs wider: with the
     DA CTA ("Start gratis", via the retained penna-locale cookie) the bar
     needed 382px at a 375px viewport. Tighter CTA padding absorbs it. */
  .nav .btn-primary { padding: 8px 8px; font-size: .64rem; }
  /* Everything below buys the room the long wordmark needs: in the 390-430px
     band the bar leaves the brand 120px and "PENNASYSTEMS" occupies 96px of it
     at .70rem, feather included. Measured, not guessed — see the PASS table on
     the FIND-01 PR. */
  .nav-brand { font-size: .70rem; letter-spacing: .01em; gap: 5px; }
  .nav .nav-brand-feather { width: 16px; height: 16px; }
  .nav .lang-toggle { font-size: .58rem; gap: 2px; }
  .nav .lang-toggle button { padding: 4px 2px; }
  .nav [data-theme-toggle], .nav .theme-toggle { padding: 1px; }
}
/* 360-375px (iPhone SE / mini, the widths FIND-01 failed hardest at). The DA
   CTA is ~14px wider than the EN one, which is exactly the margin the long
   wordmark was missing at 360px — so shave the chrome once more here rather
   than making 390px+ look cramped for everyone. Result at 360px: the brand gets
   110px and the wordmark needs 86px, i.e. real slack instead of an ellipsis. */
@media (max-width: 380px) {
  .nav { padding: 0 6px; }
  .nav-brand { font-size: .64rem; letter-spacing: 0; }
  .nav .lang-toggle button { padding: 4px 1px; }
  .nav [data-theme-toggle], .nav .theme-toggle { padding: 0; }
}

/* ── User chip (logged-in state; marketing-header.js reveals it) ─────────── */
.nav .user-chip {
  display: none;
  position: relative; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
}
.nav .user-chip.visible { display: flex; }
.nav .user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--mh-ink); color: #fff;
  font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
:root[data-theme="dark"] .nav .user-avatar { background: var(--mh-gold); color: #1b1a17; }
.nav .user-name {
  font-size: .82rem; font-weight: 500; color: var(--mh-ink-soft);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav .user-chevron { font-size: .65rem; color: var(--mh-ink-soft); transition: transform .2s; }
.nav .user-chip.open .user-chevron { transform: rotate(180deg); }
/* Logged-in mobile: chip + hamburger side-by-side overflowed narrow viewports
   (434px of content at 375px — QA 2026-08-19). Below the hamburger breakpoint
   the chip collapses to avatar + chevron; the dropdown still opens from it. */
@media (max-width: 768px) {
  .nav .user-name { display: none; }
}
.nav .user-dropdown {
  display: none;
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--mh-bg); border: 1px solid var(--mh-rule);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  min-width: 160px; z-index: 200;
}
.nav .user-chip.open .user-dropdown { display: block; }
.nav .user-dropdown a {
  display: block; padding: 11px 18px;
  font-size: .82rem; font-weight: 500; color: var(--mh-ink-soft);
  text-decoration: none; border-bottom: 1px solid var(--mh-rule);
}
.nav .user-dropdown a:last-child { border-bottom: none; }
.nav .user-dropdown a:hover { color: var(--mh-ink); background: var(--mh-surface); }
.nav .user-dropdown .logout-link { color: var(--mh-danger); }
.nav .user-dropdown .logout-link:hover { background: var(--mh-danger-soft); color: var(--mh-danger); }

/* Hint state (marketing-header.js `renderHintChip`): the ps_session hint cookie
   says the visitor is signed in, but the real session cookie is host-only on
   app.pennasystems.com, so we cannot name them from a marketing origin. The
   chip degrades to a bare "Open dashboard" link - no avatar, no chevron, no
   dropdown. The name MUST stay visible below the 768px breakpoint (which hides
   it in the named state): with the avatar gone it is the chip's only content. */
.nav .user-chip.hint .user-avatar,
.nav .user-chip.hint .user-chevron,
.nav .user-chip.hint .user-dropdown { display: none; }
.nav .user-chip.hint .user-name {
  display: inline; max-width: none; color: var(--mh-ink); font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Footer — the intentionally-dark marketing band. Fixed slate palette in both
   themes (it is always a dark band), namespaced under .site-footer.
   ═══════════════════════════════════════════════════════════════════════════ */
.site-footer {
  /* var(--pp-band-dark) themes the band on pennapay-theme.css pages (light
     #1b1a17 / dark #081209, pennapay-theme.css). marketing-header.css is also
     loaded on cream-palette pages (penna-tokens.css/marketing-theme.css,
     e.g. kunstnermoms.html) that never define --pp-band-dark, so the literal
     #1b1a17 fallback keeps those pages' footer pixel-identical to before. */
  background: var(--pp-band-dark, #1b1a17);
  border-top: 1px solid #1e293b;
  padding: 48px;
}
.site-footer .footer-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
}
.site-footer .footer-brand {
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; text-decoration: none;
}
.site-footer .footer-brand span { color: var(--mh-gold); }
.site-footer .footer-links { display: flex; gap: 28px; flex-wrap: wrap; }
.site-footer .footer-links a {
  font-size: .72rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  color: var(--mh-on-band-muted); text-decoration: none; white-space: nowrap;
}
.site-footer .footer-links a:hover { color: #cbd5e1; }
.site-footer .footer-copy {
  font-size: .72rem; color: var(--mh-on-band-text); text-decoration: none;
}
.site-footer .footer-copy:hover { color: #cbd5e1; text-decoration: underline; }

@media (max-width: 720px) {
  .site-footer { padding: 40px 24px; }
  .site-footer .footer-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
}
