
/* =========================
   Finflox – style.css (hamburger v2)
   Responsive header with SVG hamburger icon and logo fixes
   ========================= */

/* ----- Reset / base ----- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  line-height: 1.5;
  color: #0F172A;
  background: #fff;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ----- Layout helpers ----- */
.container { max-width: 1100px; margin-inline: auto; padding-inline: 16px; }

/* ----- Header ----- */
header {
  background: #fff;
  border-bottom: 1px solid rgba(15,23,42,.08);
  position: relative;
  z-index: 10;
}

.container.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap;
  padding-block: 12px;
  min-height: 64px;
  position: relative;
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  position: relative;
  z-index: 2; /* make sure it stays above the dropdown */
}
.brand svg { width: 40px; height: 40px; flex: 0 0 auto; }
.brand-title { font-weight: 700; font-size: 1.125rem; letter-spacing: .2px; white-space: nowrap; display: inline-block; }

/* Nav (desktop default) */
#site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  max-width: 100%;
  min-width: 0;
}

#site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: #0F172A;
  white-space: nowrap;
}

#site-nav a:hover { background: rgba(90,140,207,.12); }

#site-nav a:focus-visible {
  outline: 2px solid #5A8CCF;
  outline-offset: 2px;
}

/* CTA button */
#site-nav a.cta {
  background: #0F172A;
  color: #fff;
}
#site-nav a.cta:hover { background: #0b1220; }

/* ----- Hamburger button (SVG) ----- */
.nav-toggle {
  display: none; /* shown on mobile */
  -webkit-tap-highlight-color: transparent;
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  color: #0F172A;
  cursor: pointer;
  position: relative;
  z-index: 2; /* above dropdown */
}
.nav-toggle:focus-visible {
  outline: 2px solid #5A8CCF;
  outline-offset: 2px;
}
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle .bar {
  transition: transform .22s ease, opacity .18s ease;
  transform-origin: 50% 50%;
}

/* ----- Mobile layout ----- */
@media (max-width: 768px) {
  .container.nav { gap: 8px 12px; }

  /* Show toggle, stack nav */
  .nav-toggle { display: inline-flex; order: 2; }

  /* Brand first */
  .brand { order: 1; }

  /* Nav becomes a collapsible block under the row */
  #site-nav {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: max-height .28s ease, opacity .2s ease, transform .2s ease;
    background: #fff;
    border-top: 1px solid rgba(15,23,42,.08);
  }

  body[data-nav-open] #site-nav {
    max-height: 60vh;           /* enough to show all items; tweak as needed */
    opacity: 1;
    transform: translateY(0);
  }

  /* Vertical list */
  #site-nav a {
    display: block;
    margin: 6px 0;
    padding: 12px 14px;
    font-size: 1rem;
  }

  /* Animate hamburger to X */
  body[data-nav-open] .nav-toggle .bar--top {
    transform: translateY(6px) rotate(45deg);
  }
  body[data-nav-open] .nav-toggle .bar--middle {
    opacity: 0;
  }
  body[data-nav-open] .nav-toggle .bar--bottom {
    transform: translateY(-6px) rotate(-45deg);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Guard against horizontal scroll */
@supports (overflow: clip) {
  body { overflow-x: clip; }
}
@supports not (overflow: clip) {
  html, body { max-width: 100%; overflow-x: hidden; }
}

/* --- overlap fix --- */

@media (max-width: 768px) {
  /* Prevent overlap: reserve space for the button and pin it to the right */
  .container.nav { position: relative; }
  .nav-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }
  .brand {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 56px; /* 44px button + ~12px gap */
  }
  .brand-title {
    white-space: nowrap;
  }
}
