/* FinMatters site header: six consistent dropdowns, sticky, mobile accordion.
   Loaded last on every page. Uses its own .fmh-* classes so older header rules never apply.
   Colours come from the page's theme tokens (--bg, --ink, --panel, --line, --muted). */

.fmh {
  position: sticky; top: 0; z-index: 60;
  background: var(--bg); color: var(--ink);
  border-bottom: 1px solid var(--line);
  font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.fmh a { text-decoration: none; color: inherit; }
.fmh-bar {
  max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px);
  min-height: 72px; display: flex; align-items: center; gap: 16px;
}
.fmh .fm-brand-lockup { min-width: 0; margin-right: auto; }

/* Desktop navigation */
.fmh-nav { display: none; }
.fmh-list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.fmh-item { position: relative; }
.fmh-trigger {
  appearance: none; border: 0; background: none; color: var(--ink); cursor: pointer;
  font: 600 14.5px/1 'Hanken Grotesk', system-ui, sans-serif; letter-spacing: -.005em;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 12px 11px; border-radius: 8px; position: relative;
}
.fmh-trigger::before {
  content: ""; position: absolute; left: 11px; right: 11px; bottom: 4px; height: 2px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .18s ease;
}
.fmh-trigger:hover::before, .fmh-trigger[aria-expanded="true"]::before, .fmh-item.is-current .fmh-trigger::before { transform: scaleX(1); }
.fmh-item.is-current .fmh-trigger::before { opacity: .45; }
.fmh-trigger:hover::before, .fmh-trigger[aria-expanded="true"]::before { opacity: 1; }
.fmh-caret {
  width: 6px; height: 6px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .18s ease; opacity: .7;
}
.fmh-trigger[aria-expanded="true"] .fmh-caret { transform: rotate(-135deg) translate(-1px, -1px); }

.fmh-panel {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 310px; z-index: 61;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line-2, var(--line));
  border-radius: 14px; box-shadow: 0 24px 60px -28px rgba(0, 0, 0, .45); padding: 8px;
}
.fmh-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; } /* hover bridge */
.fmh-item:nth-last-child(-n+2) .fmh-panel { left: auto; right: 0; }
.fmh-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.fmh-panel a { display: block; padding: 10px 12px; border-radius: 9px; }
.fmh-panel a b { display: block; font: 600 14.5px/1.3 'Hanken Grotesk', system-ui, sans-serif; color: var(--ink); }
.fmh-panel a span { display: block; margin-top: 2px; font: 400 13px/1.4 'Hanken Grotesk', system-ui, sans-serif; color: var(--muted); }
.fmh-panel a:hover, .fmh-panel a:focus-visible { background: var(--panel-2, var(--bg-2)); }
.fmh-panel a[aria-current="page"] b::after { content: " ·  you're here"; font-weight: 400; font-size: 12px; color: var(--muted); }

/* Right-hand tools */
.fmh-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.fmh-phone {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font: 600 14px/1 'Hanken Grotesk', system-ui, sans-serif; padding: 10px 8px; border-radius: 8px;
}
.fmh-phone svg { flex: none; }
.fmh-phone:hover { text-decoration: underline; text-underline-offset: 4px; }
.fmh-phone-num { display: none; }
.fmh-cta {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  background: var(--ink); color: var(--bg) !important; border: 1px solid var(--ink);
  font: 700 14px/1 'Hanken Grotesk', system-ui, sans-serif; padding: 12px 18px; border-radius: 999px;
  transition: opacity .15s ease, transform .15s ease;
}
.fmh-cta:hover { opacity: .86; }
.fmh-ghost {
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  border: 1px solid var(--line-2, var(--line)); color: var(--ink);
  font: 600 14px/1 'Hanken Grotesk', system-ui, sans-serif; padding: 12px 18px; border-radius: 999px;
}
.fmh .mode-btn { flex: none; }
.fmh-menu {
  appearance: none; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: none; color: var(--ink); border: 1px solid var(--line-2, var(--line)); border-radius: 999px;
  font: 600 14px/1 'Hanken Grotesk', system-ui, sans-serif; padding: 11px 14px; min-height: 44px;
}
.fmh-bars { width: 16px; height: 10px; position: relative; border-block: 2px solid currentColor; transition: border-color .15s; }
.fmh-bars::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid currentColor; transition: transform .2s; }
.fmh-menu[aria-expanded="true"] .fmh-bars { border-color: transparent; }
.fmh-menu[aria-expanded="true"] .fmh-bars::before { content: ""; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid currentColor; transform: rotate(45deg); }
.fmh-menu[aria-expanded="true"] .fmh-bars::after { transform: rotate(-45deg); }

/* Mobile panel */
.fmh-mobile {
  position: fixed; left: 0; right: 0; top: var(--fmh-h, 72px); bottom: 0; z-index: 59;
  background: var(--bg); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
  border-top: 1px solid var(--line);
}
.fmh-mobile[hidden] { display: none; }
.fmh-mobile-inner { max-width: 640px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 32px) 40px; }
.fmh-acc { border-bottom: 1px solid var(--line); }
.fmh-acc-btn {
  appearance: none; width: 100%; background: none; border: 0; color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; min-height: 56px; padding: 0;
  font: 600 17px/1.2 'Hanken Grotesk', system-ui, sans-serif; text-align: left;
}
.fmh-acc-btn .fmh-caret { margin-right: 6px; }
.fmh-acc-btn[aria-expanded="true"] .fmh-caret { transform: rotate(-135deg) translate(-1px, -1px); }
.fmh-acc ul { list-style: none; margin: 0; padding: 0 0 12px; display: grid; }
.fmh-acc ul[hidden] { display: none; }
.fmh-acc ul a { display: flex; align-items: center; min-height: 44px; padding: 4px 12px; border-radius: 8px; color: var(--muted); font: 500 15.5px/1.3 'Hanken Grotesk', system-ui, sans-serif; }
.fmh-acc ul a:hover, .fmh-acc ul a[aria-current="page"] { color: var(--ink); background: var(--panel-2, var(--bg-2)); }
.fmh-mobile-ctas { display: grid; gap: 10px; margin-top: 24px; }
.fmh-mobile-ctas .fmh-cta, .fmh-mobile-ctas .fmh-ghost { min-height: 50px; font-size: 15px; }
.fmh-mobile-note { margin: 18px 0 0; font: 400 13px/1.5 'Hanken Grotesk', system-ui, sans-serif; color: var(--muted); text-align: center; }
html.fmh-lock, html.fmh-lock body { overflow: hidden; }

/* Focus */
.fmh a:focus-visible, .fmh button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Breakpoints */
@media (max-width: 1139px) {
  .fmh .mode-btn { display: none; } /* toggle lives in the mobile panel on small screens */
}
@media (max-width: 520px) {
  .fmh-bar { min-height: 64px; gap: 8px; }
  .fmh-tools .fmh-cta { display: none; } /* bottom action bar and menu carry the CTA on phones */
  .fmh-menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fmh-menu { padding: 11px 13px; }
}
@media (min-width: 1140px) {
  .fmh-nav { display: block; }
  .fmh-menu, .fmh-mobile { display: none !important; }
  .fmh .fm-brand-lockup { margin-right: 8px; }
  .fmh-nav { margin-right: auto; }
}
@media (min-width: 1300px) {
  .fmh-phone-num { display: inline; }
  .fmh-trigger { padding-inline: 13px; }
  .fmh-trigger::before { left: 13px; right: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .fmh *, .fmh *::before, .fmh *::after { transition: none !important; }
}

/* ---------- Shared footer (.fmf) ----------
   Always black with white type, in light and dark mode, so every page ends the same way. */
.fmf { background: #0B0B0C; color: #E9E9EA; font-family: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14.5px; line-height: 1.6; margin-top: 0; }
.fmf a { color: inherit; text-decoration: none; }
.fmf a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.fmf a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.fmf-wrap { max-width: 1320px; margin: 0 auto; padding: clamp(44px, 6vw, 72px) clamp(16px, 3vw, 40px) 28px; }
.fmf-top { display: grid; gap: 36px; }
@media (min-width: 1000px) { .fmf-top { grid-template-columns: minmax(260px, 1.15fr) minmax(0, 3fr); gap: 56px; } }
.fmf-brand { display: grid; gap: 10px; align-content: start; color: #A9A9AE; }
.fmf-brand p, .fmf-brand address { margin: 0; font-style: normal; }
.fmf-lockup { display: inline-flex; align-items: center; gap: 10px; color: #fff !important; text-decoration: none !important; }
.fmf-lockup img { width: 44px; height: auto; filter: invert(1); }
.fmf-lockup span { font: 700 26px/1 'Hanken Grotesk', Arial, sans-serif; letter-spacing: -.05em; }
.fmf-tag { font: 600 15px/1.3 'Hanken Grotesk', sans-serif; color: #fff !important; margin-top: 2px !important; }
.fmf-brand address a { color: #E9E9EA; }
.fmf-hours { font-size: 13px; }
.fmf-book { justify-self: start; margin-top: 8px; display: inline-flex; gap: 8px; align-items: center; background: #fff; color: #0B0B0C !important; font-weight: 700; font-size: 14px; padding: 12px 18px; border-radius: 999px; }
.fmf-book:hover { text-decoration: none !important; opacity: .88; }
.fmf-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
@media (min-width: 760px) { .fmf-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fmf-cols h2 { font: 700 11px/1.4 'Hanken Grotesk', sans-serif !important; letter-spacing: .14em !important; text-transform: uppercase; color: #8E8E94; margin: 0 0 12px; }
.fmf-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.fmf-cols a { color: #D9D9DC; font-size: 14px; }
.fmf-mid { margin-top: 40px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 12px; }
@media (min-width: 1000px) { .fmf-mid { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px; } }
.fmf-areas { margin: 0; color: #A9A9AE; font-size: 13.5px; }
.fmf-areas a { color: #E9E9EA; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.35); }
.fmf-social { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fmf-social a { border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 7px 13px; font-size: 13px; color: #E9E9EA; }
.fmf-social a:hover { background: #fff; color: #0B0B0C; text-decoration: none; }
.fmf-legal { margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 10px; font-size: 12.5px; line-height: 1.6; color: #8E8E94; }
.fmf-legal p { margin: 0; max-width: 110ch; }
.fmf-legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 6px; color: #A9A9AE; }
.fmf-legal-links a { color: #D9D9DC; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.3); }
.fmf-legal-links > span { margin-left: auto; }
.fmf .fm-cookie-settings { background: none; border: 0; padding: 0; color: #D9D9DC; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 640px) { .fmf-legal-links > span { margin-left: 0; width: 100%; } }