/* Site header (copied from the Next.js header). Moved out of header.php in v2, unchanged. */
/* ===== Base ===== */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  color: #000;
}


a { text-decoration: none; color: inherit; }
button { font: inherit; background: none; border: 0; cursor: pointer; padding: 0; }

/* Tailwind-style container */
.container { width: 100%; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px)  { .container { max-width: 640px; } }
@media (min-width: 768px)  { .container { max-width: 768px; } }
@media (min-width: 1024px) { .container { max-width: 1024px; } }
@media (min-width: 1280px) { .container { max-width: 1280px; } }
@media (min-width: 1400px) { .container { max-width: 1400px; } }

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  color: #000;
  background: #f3f4f6;
  padding: .75rem 0;
  transition: background-color .3s, padding .3s, box-shadow .3s, backdrop-filter .3s;
  animation: headerIn .5s ease-out both;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  padding: 12px 0;
}

@keyframes headerIn {
  from { transform: translateY(-100px); opacity: 0; }
  to   { transform: translateY(0);      opacity: 1; }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===== Logo ===== */
.logo {
  position: relative;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  height: 32px;
  font-size: 1.875rem;
  font-weight: 700;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); /* spring-like */
}
.logo:hover { transform: scale(1.05); }
@media (min-width: 768px) { .logo { height: 40px; } }

/* ===== Desktop nav ===== */
.desktop-nav { display: none; align-items: center; gap: 32px; }

.nav-item {
  position: relative;
  opacity: 0;
  animation: fadeIn .4s ease-out forwards;
  animation-delay: calc(var(--i) * .1s);
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #1f2937;
  font-weight: 500;
  transition: color .2s;
}
.nav-link:hover { color: #4b5563; }

/* underline */
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: #1f2937;
  transition: width .3s;
}
.nav-link:hover::after { width: 100%; }

.nav-link .chevron { transition: transform .3s; }
.nav-link:hover .chevron,
.nav-item.is-open .chevron { transform: rotate(180deg); }

/* Dropdown (padding-top bridges the gap so hover isn't lost) */
.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 224px;
  padding-top: 20px;
  transform: translate(-50%, -10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease-in-out, transform .2s ease-in-out, visibility 0s linear .2s;
}

.nav-item.is-open .dropdown,
.nav-item.has-dropdown:focus-within .dropdown {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .3s ease-in-out, transform .3s ease-in-out, visibility 0s;
}

.dropdown-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);
}

.dropdown-panel a {
  display: block;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: .875rem;
  color: #374151;
  transition: background-color .2s;
}
.dropdown-panel a:hover { background: #f3f4f6; }

/* ===== Desktop CTA ===== */
.desktop-cta {
  display: none;
  opacity: 0;
  animation: fadeIn .4s ease-out .7s forwards;
}

.btn-quote {
  display: inline-block;
  background: #1f2937;
  color: #fff;
  padding: 12px 20px;
  border-radius: 9999px;
  font-size: .875rem;
  font-weight: 500;
  transition: background-color .3s, box-shadow .3s;
}
.btn-quote:hover {
  background: #111827;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
}

@keyframes fadeIn { to { opacity: 1; } }

/* ===== Mobile menu button ===== */
.menu-button {
  position: relative;
  z-index: 20;
  display: inline-flex;
  color: #1f2937;
  transition: transform .1s;
}
.menu-button:active { transform: scale(.95); }
.menu-button .icon-close { display: none; }
.menu-button.is-active .icon-open { display: none; }
.menu-button.is-active .icon-close { display: block; }

/* ===== Mobile menu ===== */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40; /* sits below the header bar (50) */
  display: flex;
  flex-direction: column;
  padding-top: 72px;
  background: #fff;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: opacity .3s, transform .3s, visibility 0s linear .3s;
}
@media (min-width: 640px) { .mobile-menu { padding-top: 96px; } }

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .3s, transform .3s, visibility 0s;
}

.mobile-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 24px;
  padding-bottom: 24px;
  background: #fff;
}

/* stagger items in */
.m-item {
  opacity: 0;
  transform: translateX(-20px);
}
.mobile-menu.is-open .m-item {
  opacity: 1;
  transform: translateX(0);
  transition: opacity .3s, transform .3s;
  transition-delay: calc(var(--i) * .05s);
}

.m-link,
.m-toggle {
  display: block;
  width: 100%;
  padding: 8px 0;
  font-size: 1.125rem;
  font-weight: 500;
  color: #1f2937;
  text-align: left;
  transition: color .2s;
}
.m-link:hover,
.m-toggle:hover { color: #4b5563; }

.m-toggle { display: flex; justify-content: space-between; align-items: center; }
.m-toggle .chevron { transition: transform .3s; }
.m-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

/* accordion: animates height from 0 to auto */
.m-sub {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  padding-left: 16px;
  transition: grid-template-rows .3s ease, opacity .3s ease;
}
.m-sub.is-open { grid-template-rows: 1fr; opacity: 1; }

.m-sub-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.m-sub-inner a {
  display: block;
  padding: 8px 0;
  font-size: 1rem;
  color: #374151;
}
.m-sub-inner a:first-child { margin-top: 8px; }
.m-sub-inner a:last-child  { margin-bottom: 8px; }
.m-sub-inner a + a { margin-top: 8px; }
.m-sub-inner a:hover { color: #4b5563; }

.m-divider { height: 1px; background: #f3f4f6; margin-top: 8px; }

.m-cta {
  padding-top: 16px;
  opacity: 0;
}
.mobile-menu.is-open .m-cta { opacity: 1; transition: opacity .3s .4s; }

.btn-quote-mobile {
  display: block;
  width: 100%;
  padding: 12px 0;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  font-weight: 500;
  text-align: center;
  transition: background-color .2s;
}
.btn-quote-mobile:hover { background: #111827; }

/* ===== Breakpoint: desktop (lg = 1024px) ===== */
@media (min-width: 1024px) {
  .desktop-nav  { display: flex; }
  .desktop-cta  { display: block; }
  .menu-button  { display: none; }
  .mobile-menu  { display: none; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
}
