/* GlobalNav — portable nav styles (ported from finelli.css so the desktop
   design is unchanged, then refined). Self-contained for Shadow DOM use as a
   code component. Single source of truth for nav styles. */

/* Shadow DOM has no global reset. Without border-box, `width: 100%` plus
   padding overflows the container — which clipped the Contact CTA in the
   Designer. This is the reset the app gets from src/styles/reset.css. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ── Sticky Nav ──────────────────────────────────────────────────────────── */
.nav-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  height: 3rem;
  width: 100%;
  border-bottom: 1.5px solid transparent;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: background 0.3s ease, border-color 0.3s ease;
  background: rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.nav-sticky > * {
  pointer-events: auto;
}

.nav-sticky.is-scrolled {
  background: rgba(0, 0, 0, 0.72);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.1);
}

/* ── Navbar Component ────────────────────────────────────────────────────── */
.navbar2 {
  position: absolute;
  display: flex;
  width: 100%;
  height: 3rem;
  /* Extra right padding so the Contact CTA clears the viewport edge. */
  padding: 0 2rem 0 1.25rem;
  align-items: center;
  background: transparent;
  font-family: "Compass Sans - Regular", var(--font-body, sans-serif);
}

.navbar-container {
  display: flex;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  justify-content: space-between;
  align-items: center;
}

/* ── Logo ────────────────────────────────────────────────────────────────── */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 4px;
  text-decoration: none;
  color: #fff;
  transition: all 200ms cubic-bezier(0.455, 0.03, 0.515, 0.955);
  cursor: pointer;
  z-index: 10;
  white-space: nowrap;
}

.navbar-logo > div,
.gn-logo-rive > div {
  width: 138px !important;
  height: 70px !important;
  flex-shrink: 0;
}

.navbar-logo:hover {
  color: rgba(255, 255, 255, 0.8);
}

.gn-logo-rive {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.gn-logo-mobile {
  display: none;
  /* 24px reads a touch smaller than the wide Rive lockup at 767px and below,
     so the monogram matches the desktop logo's visual weight. */
  width: 24px;
  height: 24px;
  color: #fff;
}

.nav-logo-text {
  font-family: var(--font-heading, "Compass Sans - Regular");
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ── Nav Menu (desktop) ──────────────────────────────────────────────────── */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}

/* ── Flat Links ──────────────────────────────────────────────────────────── */
.navbar-link {
  display: inline-flex;
  max-width: 11rem;
  min-height: 2.5rem;
  min-width: 4rem;
  padding: 0.5rem 1rem;
  justify-content: center;
  align-items: center;
  border: 1.5px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-family: "Compass Sans - Regular", var(--font-body, sans-serif);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.5;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.navbar-link:hover {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  color: #fff;
}

/* Contact CTA — same treatment as the other nav items, no button chrome */
.navbar-link.navbar-link--cta {
  background: transparent;
  border-color: transparent;
  color: #fff;
  font-family: "Compass Sans - Regular", var(--font-body, sans-serif);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

/* ── Dropdown ────────────────────────────────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  max-width: 9rem;
  min-height: 2.5rem;
  min-width: 4rem;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  justify-content: center;
  align-items: center;
  gap: 0.375rem;
  border: 1.5px solid transparent;
  border-radius: 4px;
  background: transparent;
  font-family: "Compass Sans - Regular", var(--font-body, sans-serif);
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
  position: relative;
  white-space: nowrap;
}

.nav-dropdown-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}

.nav-dropdown-chevron {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  transition: transform 160ms ease;
}

.nav-dropdown-chevron.open {
  transform: translateY(-50%) rotate(180deg);
}

/* ── Dropdown List ───────────────────────────────────────────────────────── */
.nav-dropdown-list {
  position: absolute;
  top: 100%;
  /* Right-align to the trigger so panels near the right edge never run off
     screen (the wide grid panels especially). */
  right: 0;
  left: auto;
  z-index: 9999;
  margin-top: -2px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  min-width: 200px;
  overflow: hidden;
  animation: ddFadeIn 120ms ease;
}

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

.nav-dropdown-inner {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

/* Two-column grid panels (Services, Resources) */
.nav-dropdown-list.is-grid .nav-dropdown-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0.75rem;
  min-width: 400px;
}

.nav-dropdown-list.is-grid .nav-dropdown-link {
  padding: 0.7rem 1rem;
}

.nav-dropdown-link {
  display: block;
  width: 100%;
  padding: 0.625rem 1rem;
  color: #fff;
  font-size: 0.875rem;
  line-height: 1.4;
  text-decoration: none;
  border-radius: 4px;
  transition: background 140ms ease, color 140ms ease;
  cursor: pointer;
  white-space: nowrap;
}

/* Self-contained hover: no theme tokens, so it can't fall back to a transparent
   background with dark text (which blended into the dark panel). Matches the
   subtle light overlay used by the top-level nav items. */
.nav-dropdown-link:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* ── Mobile Menu Button ──────────────────────────────────────────────────── */
.nav-menu-button {
  display: none;
  z-index: 99;
  padding: 0;
  cursor: pointer;
  background: none;
  border: none;
}

.hamburger-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 24px;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: all 200ms ease;
}

/* ── Mobile Nav (right-side drawer) ──────────────────────────────────────── */
.finelli-mobile-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease, visibility 250ms ease;
  z-index: 99998;
}

.finelli-mobile-scrim.open {
  opacity: 1;
  visibility: visible;
}

.finelli-mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 88vw);
  display: flex;
  flex-direction: column;
  background: rgba(9, 9, 9, 0.8);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100000;
  padding: 4.5rem 1.5rem 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1), visibility 340ms;
  will-change: transform;
}

.finelli-mobile-nav.open {
  transform: translateX(0);
  visibility: visible;
}

.finelli-mobile-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #fff;
}

.finelli-mobile-links {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.finelli-mobile-link {
  display: block;
  padding: 0.9rem 0;
  color: #fff;
  font-family: "Compass Sans - Regular", var(--font-body, sans-serif);
  font-size: 1.05rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 140ms ease;
}

.finelli-mobile-link:hover {
  color: rgba(255, 255, 255, 0.85);
}

/* Accordion sections */
.finelli-mobile-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.finelli-mobile-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.9rem 0;
  background: none;
  border: none;
  color: #fff;
  font-family: "Compass Sans - Regular", var(--font-body, sans-serif);
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
  transition: color 140ms ease;
}

.finelli-mobile-section-toggle:hover {
  color: rgba(255, 255, 255, 0.85);
}

.finelli-mobile-chevron {
  display: flex;
  transition: transform 200ms ease;
}

.finelli-mobile-chevron.open {
  transform: rotate(180deg);
}

.finelli-mobile-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.finelli-mobile-panel.open {
  grid-template-rows: 1fr;
}

.finelli-mobile-panel-inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.finelli-mobile-sublink {
  display: block;
  padding: 0.55rem 0 0.55rem 1rem;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Compass Sans - Regular", var(--font-body, sans-serif);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 140ms ease;
}

.finelli-mobile-sublink:hover {
  color: #fff;
}

.finelli-mobile-panel.open .finelli-mobile-sublink:last-child {
  padding-bottom: 1rem;
}

.finelli-mobile-contact {
  margin-top: 0.5rem;
  border-bottom: none;
  font-weight: 500;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .nav-menu {
    display: none;
  }

  .nav-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-logo-text {
    display: none;
  }
}

/* Mobile: swap the Rive logo for the static FT monogram */
@media (max-width: 767px) {
  .navbar2 {
    padding: 0 0.5rem;
  }

  .gn-logo-rive {
    display: none;
  }

  .gn-logo-mobile {
    display: block;
  }
}

/* ── Focus visibility ────────────────────────────────────────────────────── */
.navbar-link:focus-visible,
.nav-dropdown-toggle:focus-visible,
.nav-dropdown-link:focus-visible,
.nav-menu-button:focus-visible,
.finelli-mobile-link:focus-visible,
.finelli-mobile-close:focus-visible,
.finelli-mobile-section-toggle:focus-visible,
.finelli-mobile-sublink:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.nav-dropdown-link:focus-visible {
  outline-offset: -2px;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .navbar-logo,
  .navbar-link,
  .nav-dropdown-toggle,
  .nav-dropdown-link,
  .nav-dropdown-chevron,
  .hamburger-icon span,
  .finelli-mobile-link,
  .finelli-mobile-sublink,
  .finelli-mobile-chevron,
  .finelli-mobile-close,
  .finelli-mobile-section-toggle {
    transition: none;
  }

  .nav-dropdown-list {
    animation: none;
  }

  .finelli-mobile-nav,
  .finelli-mobile-scrim,
  .finelli-mobile-panel {
    transition: none;
  }
}

