/* ════════════════════════════════════════════════════════════════
   Mountain Strong Financial · site.css
   Cross-page additions: mobile menu, sub-nav, active link state.
   Loaded LAST so it can override the per-page styles when needed.
   ════════════════════════════════════════════════════════════════ */

/* ─── Active link state ──────────────────────────────────────── */
.nav-links a.is-active {
  color: var(--fg, #0a0a0a);
  opacity: 1;
  position: relative;
}
/* Only pages with dark floating-pill navs (about, home) need fg-on-dark */
.on-dark .nav-links a.is-active,
body.page-about .nav-links a.is-active,
body.page-home .nav-links a.is-active {
  color: var(--fg-on-dark, #f6f3ea);
  opacity: 1;
}
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
}

/* ─── Hamburger toggle (hidden on desktop, shown on mobile) ──── */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  margin: 0;
  cursor: pointer;
  width: 40px;
  height: 36px;
  align-items: center;
  justify-content: center;
  position: relative;
  color: inherit;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: currentColor;
  position: absolute;
  left: 9px;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.2s ease,
              top 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-toggle span:nth-child(1) { top: 12px; }
.nav-toggle span:nth-child(2) { top: 18px; }
.nav-toggle span:nth-child(3) { top: 24px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  top: 18px;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  top: 18px;
  transform: rotate(-45deg);
}

/* ─── Mobile dropdown panel ──────────────────────────────────── */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }

  /* Hide the original menu-toggle div from the about page (had display:none placeholder) */
  .nav-menu-toggle { display: none !important; }

  /* Re-flow the grid so brand | spacer | CTA | toggle fit on one row.
     .nav-links becomes a position:absolute drawer so it doesn't take a column. */
  .nav {
    grid-template-columns: auto 1fr auto auto !important;
    gap: 10px;
  }

  .nav .nav-links {
    display: flex !important;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 18px 50px -16px rgba(0, 0, 0, 0.55);
    transform-origin: top right;
    transform: translateY(-8px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 50;
  }
  .nav.is-open .nav-links {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
  }
  .nav .nav-links a {
    padding: 14px 22px;
    color: rgba(246, 243, 234, 0.86);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.78rem;
  }
  .nav .nav-links a:last-child { border-bottom: 0; }
  .nav .nav-links a.is-active { color: #f6f3ea; }
  .nav .nav-links a.is-active::after { display: none; }

  /* CTA stays visible on the right of nav even when collapsed */
  .nav-cta { display: inline-flex; }

  /* On about/home (floating pill nav), the dropdown should match pill width
     and align to the pill itself. The nav already has padding; using the
     same horizontal extent looks correct. */
}

/* ─── Sub-nav strip ──────────────────────────────────────────────
   Horizontally scrollable on small screens. */
.subnav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 10, 10, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--fg-on-dark, #f6f3ea);
}
/* About page already has a fixed top nav, push sub-nav below it */
body.page-about .subnav,
body.page-home .subnav,
body.page-family-business .subnav,
body.page-managing-risk .subnav,
body.page-workshop .subnav,
body.page-trust-centre .subnav {
  top: 68px;
}
body.page-about .subnav,
body.page-home .subnav {
  top: 80px;
}
.subnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(246, 243, 234, 0.45);
  white-space: nowrap;
  flex-shrink: 0;
}
.subnav-inner a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(246, 243, 234, 0.7);
  white-space: nowrap;
  padding: 4px 0;
  transition: color 0.2s ease;
  text-decoration: none;
}
.subnav-inner a:hover { color: #f6f3ea; }
.subnav-inner a.is-active {
  color: #f6f3ea;
  position: relative;
}
.subnav-inner a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -4px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

/* On pages without a fixed nav (service pages), sub-nav sits below the
   static dark nav. Since nav scrolls away, sub-nav becomes the sticky
   anchor strip naturally. */

/* ─── Body scroll lock when nav is open ──────────────────────── */
body.nav-open { overflow: hidden; }

/* ─── Focus styles for accessibility ─────────────────────────── */
a:focus-visible,
button:focus-visible {
  outline: 2px solid rgba(246, 243, 234, 0.6);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ─── Skip-to-content link (keyboard accessibility) ──────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #0a0a0a;
  color: #f6f3ea;
  padding: 12px 18px;
  z-index: 1000;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ─── Partner logo: ensure consistent, legible size on all pages ── */
.footer-partner-logo img {
  height: 36px !important;
  width: auto !important;
  display: block;
}
@media (max-width: 720px) {
  .footer-partner-logo img {
    height: 32px !important;
  }
}

/* ─── Legal links row (Privacy · Terms · Complaint Handling) ─── */
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px 0 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted-dark-2, #b0b0b0);
  border-bottom: 1px solid var(--line-dark, #2a2a2a);
}
.footer-legal a {
  color: var(--muted-dark-2, #b0b0b0);
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-legal a:hover {
  color: var(--fg-on-dark, #f6f3ea);
}
.footer-legal-sep {
  color: var(--line-dark, #2a2a2a);
  user-select: none;
}
@media (max-width: 720px) {
  .footer-legal {
    gap: 10px;
    font-size: 0.65rem;
  }
}

/* ─── Drop the duplicate divider above the Monarch row ───────── */
/* The .footer-cols has border-bottom AND .footer-partner has
   border-top on several pages, visually stacking into two lines.
   Remove the partner's border-top so only one separator shows. */
.footer-partner {
  border-top: none !important;
  margin-top: 0 !important;
}

/* ─── Print styles ───────────────────────────────────────────── */
@media print {
  .nav, .subnav, .nav-toggle, .footer-hero { display: none !important; }
  body { color: #000; background: #fff; }
  .on-dark, .footer { background: #fff !important; color: #000 !important; }
}

/* ════════════════════════════════════════════════════════════════
   Index-only footer styles, the path picker's original footer
   had no "Start with a conversation" CTA and used a simpler brand
   block. The unified footer markup needs a few extra rules to
   render correctly. Scoped to .page-home so service pages keep
   their own typography.
   ════════════════════════════════════════════════════════════════ */
body.page-home .footer-hero {
  padding: 40px 0 56px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line-dark, #2a2a2a);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
}
body.page-home .footer-hero-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 22ch;
  color: var(--fg-on-dark, #f6f3ea);
  margin: 0;
}
body.page-home .footer-hero-title em {
  font-style: italic;
  color: var(--muted-dark-2, #b0b0b0);
}
body.page-home .footer-hero-cta {
  justify-content: flex-end;
}
body.page-home .footer-hero-cta .btn {
  white-space: nowrap;
}
body.page-home .footer-cols {
  padding-top: 48px;
}
body.page-home .footer-brand img {
  height: 56px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.94;
  margin-bottom: 14px;
  display: block;
}
body.page-home .footer-brand-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.3rem;
  margin-bottom: 4px;
  color: var(--fg-on-dark, #f6f3ea);
}
@media (max-width: 860px) {
  body.page-home .footer-hero {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 0 40px;
  }
  body.page-home .footer-hero-cta {
    justify-content: flex-start;
  }
}
