/* ============================================================
   Evins Construction LLC v2 — Navigation
   ============================================================ */

.site-header,
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: background 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), padding 0.4s var(--ease-out);
  padding: 0;
  background: var(--navy-deep);
}

.site-header.scrolled,
.site-nav.scrolled {
  background: rgba(13, 27, 42, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.site-header.hero-header,
.site-nav.hero-header { background: transparent; }
.site-header.solid-header,
.site-nav.solid-header {
  background: var(--navy-deep);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem var(--gutter);
  max-width: var(--container);
  margin: 0 auto;
}

.nav-logo img {
  height: 44px;
  width: auto;
  display: block;
  transition: opacity 0.3s;
}
.nav-logo:hover img { opacity: 0.85; }

/* --- Nav Links --- */
/* Two structures exist:
   index.html: <nav><ul class="nav-links"><li>
   all others: <nav class="nav-links"><ul><li class="has-dropdown">
*/
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* index structure: ul.nav-links > li */
.nav-links > li,
/* others structure: nav.nav-links > ul > li */
nav.nav-links > ul > li {
  position: relative;
}

/* Also make the inner ul flex for the nav.nav-links structure */
nav.nav-links > ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links > li > a,
nav.nav-links > ul > li > a {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  padding: 0.5rem 0.9rem;
  border-radius: var(--r-sm);
  transition: color 0.2s, background 0.2s;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

.nav-links > li > a:hover,
.nav-links > li > a.active,
nav.nav-links > ul > li > a:hover,
nav.nav-links > ul > li > a.active {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

.nav-links .drop-arrow {
  font-size: 0.6rem;
  opacity: 0.6;
  transition: transform 0.25s;
}
.nav-links li:hover .drop-arrow { transform: rotate(180deg); }

/* --- Dropdown --- */
.nav-dropdown,
.nav-links ul.dropdown {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 200px;
  background: var(--navy-deep);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-md);
  padding: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  box-shadow: var(--shadow-xl);
  list-style: none;
  margin: 0;
}

/* Bridge: invisible area between nav link and dropdown so mouse
   doesn't lose hover when moving from link down to menu */
.nav-links li::after,
nav.nav-links > ul > li::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.5rem;
}

.nav-links li:hover .nav-dropdown,
.nav-links li:hover ul.dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown a,
.nav-links ul.dropdown a {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.75);
  padding: 0.6rem 0.9rem;
  border-radius: var(--r-sm);
  display: block;
  transition: color 0.2s, background 0.2s;
}
.nav-dropdown a:hover,
.nav-links ul.dropdown a:hover {
  color: var(--white);
  background: rgba(255,255,255,0.08);
}

/* --- Nav CTAs --- */
.nav-ctas {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-ctas .btn {
  font-size: 0.8rem;
  padding: 0.55rem 1.1rem;
  letter-spacing: 0.08em;
}

/* --- Mobile Toggle --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Mobile Menu --- */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--navy-deep);
  z-index: 99;
  display: flex;
  flex-direction: column;
  padding: 6rem var(--gutter) 3rem;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease-out);
  overflow-y: auto;
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu a {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.9);
  display: block;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color 0.2s, padding-left 0.2s;
}
.mobile-menu a:hover { color: var(--amber-light); padding-left: 0.5rem; }

.mobile-menu .mobile-sub { padding-left: 1.5rem; }
.mobile-menu .mobile-sub a { font-size: 1.3rem; color: rgba(255,255,255,0.6); }

.mobile-ctas {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* --- Mobile Footer Bar --- */
.mobile-footer-bar {
  display: none;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-around;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--navy-deep);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 50;
  padding: 0.5rem 0;
}
.mobile-footer-bar > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex: 1;
  color: rgba(255,255,255,0.7);
  font-size: 0.65rem;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  transition: color 0.2s;
}
.mobile-footer-bar > a svg { width: 20px; height: 20px; }
.mobile-footer-bar > a:hover { color: var(--amber-light); }

/* --- Footer --- */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.7);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand img { height: 40px; margin-bottom: 1rem; }
.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.5);
  max-width: 28ch;
}
.footer-col h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--white);
  margin-bottom: 1rem;
}
.footer-col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-col a {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--amber-light); }
.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.6rem;
}
.footer-contact-item a { color: rgba(255,255,255,0.5); }
.footer-contact-item a:hover { color: var(--amber-light); }
.footer-contact-item svg { flex-shrink: 0; margin-top: 2px; color: var(--amber); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-social {
  display: flex;
  gap: 0.75rem;
}
.footer-social a {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.footer-social a:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--white);
}

@media (max-width: 1024px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy-deep);
    flex-direction: column;
    padding: 1rem 0 1.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 99;
  }
  .nav-links.mobile-open {
    display: flex;
  }
  .nav-links > li {
    padding: 0;
  }
  .nav-links > li > a {
    display: block;
    padding: 0.75rem var(--gutter);
    font-size: 1rem;
  }
  .nav-links > li::after { display: none; }
  .nav-links ul.dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(255,255,255,0.05);
    padding: 0.25rem 0;
    pointer-events: auto;
    display: none;
  }
  .nav-links li.has-dropdown:hover ul.dropdown,
  .nav-links li.has-dropdown.open ul.dropdown {
    display: block;
  }
  .nav-links ul.dropdown a {
    padding: 0.6rem var(--gutter) 0.6rem calc(var(--gutter) + 1rem);
  }
  .nav-ctas { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: flex; margin-left: auto; }
  .mobile-footer-bar { display: flex !important; flex-direction: row !important; align-items: stretch; justify-content: space-around; width: 100%; }
  body { padding-bottom: 60px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
