/* =========================================
   NEW HEADER SYSTEMS (nh-)
   Completely revamped header independent of old styles
   ========================================= */

:root {
  --nh-bg-initial: transparent;
  --nh-bg-scrolled: #ffffff;
  --nh-text-initial: #ffffff;
  --nh-text-scrolled: #003c34;
  --nh-accent: #f6630c;
  --nh-font: 'Montserrat', sans-serif;
  --nh-height: 100px;
  --nh-height-scrolled: 100px;
  --nh-transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.nh-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 10000;
  background-color: var(--nh-bg-initial);
  transition: var(--nh-transition);
  font-family: var(--nh-font);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);

}

.nh-header.scrolled {
  background-color: var(--nh-bg-scrolled);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nh-container {
  position: relative; /* For absolute centering of nav */
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: var(--nh-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: height 0.4s ease;
}

.nh-header.scrolled .nh-container {
  height: var(--nh-height-scrolled);
}

/* --- LOGO --- */
.nh-logo {
  display: flex;
  align-items: center;
  z-index: 10002;
}

.nh-logo-img {
  height: 65px;
  width: auto;
  transition: var(--nh-transition);
}

.nh-header.scrolled .nh-logo-img {
  /* Height remains same as initial (65px) */
  filter: brightness(0) saturate(100%) invert(18%) sepia(26%) saturate(3015%) hue-rotate(143deg) brightness(96%) contrast(102%); /* Transforms white to #003c34ish */
}
/* If you have a separate color logo, handle it via JS source swap or CSS content, filters are cleaner for SVGs/PNGs if predictable */


/* --- DESKTOP NAV --- */
.nh-nav {
  display: none; /* hidden on mobile */
  height: 100%;
}

@media (min-width: 1024px) {
  .nh-nav {
    display: flex;
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
  }
}

.nh-menu {
  display: flex;
  gap: 3.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
  align-items: center;
}

.nh-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.nh-link {
  color: var(--nh-text-initial);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.5px;

  transition: var(--nh-transition);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  position: relative;
  padding-right: 25px; /* Reserve space for arrow on ALL items for equal spacing */
}

.nh-header.scrolled .nh-link {
  color: var(--nh-text-scrolled);
}



/* Dropdown Arrow */
/* Dropdown Arrow using image */
.nh-dropdown-btn::after {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  background: url('../images/menudrop.svg') no-repeat center center;
  background-size: contain;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}

/* Remove padding from last item to fix visual centering offset */
.nh-item:last-child .nh-link {
  padding-right: 0;
}

/* Default state (unscrolled home): arrow is white (natively white SVG) */
.nh-header:not(.scrolled) .nh-dropdown-btn::after {
  filter: none; /* Keep white */
}


/* Hover state: arrow becomes orange */
/* Universal Hover Logic (All States) */
/* Universal Hover Logic (All States) */
.nh-link:hover {
  color: var(--nh-accent) !important;
}

.nh-link:hover::after {
  filter: brightness(0) saturate(100%) invert(56%) sepia(85%) saturate(3500%) hue-rotate(350deg) brightness(98%) contrast(95%) !important; /* #f6630c */
}

/* --- SUBMENU --- */
.nh-submenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #ffffff;
  min-width: 220px;
  padding: 1rem 0;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  list-style: none;
  z-index: 10001;
}

/* Submenu top triangle - purely CSS is fine/better than svg image for a tooltip triangle */
.nh-submenu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #fff;
}

.nh-item:hover .nh-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nh-sublink {
  display: block;
  padding: 0.7rem 1.5rem;
  color: #003c34;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nh-sublink:hover {
  background: #ffffff;
  color: var(--nh-accent);
  
}

/* --- ACTIONS --- */
.nh-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  z-index: 10002;
}

.nh-lang {
  color: #ffffff;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--nh-transition);
}

.nh-header.scrolled .nh-lang {
  color: #003c34;
}

.nh-lang:hover {
  color: var(--nh-accent);
}

.nh-cta {
  background: #ff6630;
    color: #fff;
    font-weight: 500;
    font-size: .95rem;
    padding: 0.6em 1em;
    text-decoration: none;
    
    border-radius: 6px;
 
}

.nh-cta:hover {
  background: #e05500;
  
}

/* --- MOBILE TOGGLE --- */
.nh-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 10003;
}

@media (max-width: 1023px) {
  .nh-mobile-toggle {
    display: flex;
  }
}

.nh-bar {
  display: block;
  width: 25px;
  height: 2px;
  background-color: var(--nh-text-initial);
  transition: all 0.3s ease;
}

.nh-header.scrolled .nh-bar {
  background-color: var(--nh-text-scrolled);
}

/* Mobile Toggle Animation */
.nh-header.mobile-open .nh-bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
  background-color: #003c34;
}
.nh-header.mobile-open .nh-bar:nth-child(2) {
  opacity: 0;
}
.nh-header.mobile-open .nh-bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
  background-color: #003c34;
}

/* --- MOBILE MENU OVERLAY --- */
.nh-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100vh;
  background: #fff;
  z-index: 10001;
  padding: 100px 2rem 2rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.77, 0, 0.175, 1);
  overflow-y: auto;
}

.nh-header.mobile-open .nh-mobile-menu {
  transform: translateX(0);
}

.nh-mobile-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.nh-mobile-link {
  font-size: 1.25rem;
  color: #003c34;
  font-weight: 600;
  text-decoration: none;
  display: block;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5rem;
}

.nh-mobile-dropdown-content {
  display: none;
  padding-left: 1rem;
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nh-mobile-item.active .nh-mobile-dropdown-content {
  max-height: 500px; /* arbitrary large height */
  margin-bottom: 1rem;
}

.nh-mobile-sublink {
  color: #666;
  text-decoration: none;
  font-size: 1rem;
  display: block;
}

.nh-mobile-actions {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nh-mobile-item.has-dropdown > .nh-mobile-link::after {
  content: '+';
  float: right;
  font-weight: 300;
}

.nh-mobile-item.has-dropdown.active > .nh-mobile-link::after {
  content: '-';
}

/* Specific Page Overrides (Non-home pages need dark text initially) */
body:not(.home) .nh-header:not(.scrolled) {
  background-color: #fff;
  border-bottom: 1px solid #eee;
}
body:not(.home) .nh-header:not(.scrolled) .nh-link,
body:not(.home) .nh-header:not(.scrolled) .nh-lang,
body:not(.home) .nh-header:not(.scrolled) .nh-bar {
  color: #003c34;
 
}

/* Fix logo for non-home pages initially */
body:not(.home) .nh-header:not(.scrolled) .nh-logo-img {
   filter: brightness(0) saturate(100%) invert(18%) sepia(26%) saturate(3015%) hue-rotate(143deg) brightness(96%) contrast(102%);
}

#site-header-placeholder {
  min-height: 0; /* Prevents layout jumps */
}
