/*
 * NF Services - Header Styles
 * Top Bar, Logo, Advertisement and Navigation
 */

/* =========================================
   1. HEADER VARIABLES
========================================= */

:root {
  --nf-header-bg: var(--nf-bg-secondary);
  --nf-topbar-bg: var(--nf-card);
  --nf-navigation-bg: var(--nf-surface);

  --nf-header-height: 130px;
  --nf-navigation-height: 52px;
}


/* =========================================
   2. SITE HEADER
========================================= */

.site-header {
  width: 100%;
  background: var(--nf-header-bg);
}

.nf-header-container {
  width: 100%;
  max-width: var(--nf-container-width);
  margin: 0 auto;
  padding: 0 var(--nf-container-padding);
}


/* =========================================
   3. TOP BAR
========================================= */

.nf-topbar {
  width: 100%;
  min-height: 36px;
  background: var(--nf-topbar-bg);
  border-bottom: 1px solid var(--nf-border);
}

.nf-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 36px;
}

.nf-topbar-left,
.nf-topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.nf-language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--nf-text-muted);
  font-size: 12px;
}

/* =========================================
   SOCIAL ICONS
========================================= */

.nf-social-icons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.nf-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--nf-text-muted);
  background: var(--nf-surface);
  border: 1px solid var(--nf-border);
  border-radius: var(--nf-radius-sm);
  text-decoration: none;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.nf-social-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.5;
}

.nf-social-icon:hover {
  color: #FFFFFF;
  background: var(--nf-primary);
  border-color: var(--nf-primary);
  transform: translateY(-2px);
}

.nf-social-icon:focus-visible {
  outline: 2px solid var(--nf-primary);
  outline-offset: 3px;
}

.nf-social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--nf-text-muted);
  font-size: 14px;
  transition: color 0.2s ease;
}

.nf-social-links a:hover {
  color: var(--nf-primary);
}


/* =========================================
   4. MAIN HEADER
========================================= */

.nf-header-main {
  width: 100%;
  background: var(--nf-header-bg);
}

.nf-header-main-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: var(--nf-header-height);
  padding-top: 20px;
  padding-bottom: 20px;
}


/* =========================================
   5. LOGO AREA
========================================= */

.nf-header-logo {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  min-width: 0;
}

.nf-header-logo img {
  display: block;
  width: auto;
  max-width: 300px;
  max-height: 100px;
  object-fit: contain;
}

.nf-header-logo .custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.nf-header-logo .site-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.nf-header-logo .site-title a {
  color: var(--nf-text-light);
}

.nf-header-logo .site-description {
  margin: 5px 0 0;
  color: var(--nf-text-muted);
  font-size: 12px;
}


/* =========================================
   6. ADVERTISEMENT AREA
========================================= */

.nf-header-ad {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.nf-header-ad img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.nf-header-ad iframe {
  max-width: 100%;
  border: 0;
}

.nf-header-ad:empty {
  display: none;
}


/* =========================================
   7. PRIMARY NAVIGATION
========================================= */

.nf-navigation {
  width: 100%;
  background: var(--nf-navigation-bg);
  border-top: 1px solid var(--nf-border);
  border-bottom: 1px solid var(--nf-border);
}

.nf-navigation-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--nf-navigation-height);
}

.nf-primary-menu {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nf-primary-menu>li {
  position: relative;
  margin: 0;
  padding: 0;
}

.nf-primary-menu>li>a {
  display: block;
  padding: 15px 18px;
  color: var(--nf-text-light);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.nf-primary-menu>li>a:hover,
.nf-primary-menu>li.current-menu-item>a {
  color: var(--nf-primary);
  background: color-mix(in srgb, var(--nf-primary) 10%, transparent);
}


/* =========================================
   8. DROPDOWN MENUS
========================================= */

.nf-primary-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 999;
  display: none;
  min-width: 210px;
  margin: 0;
  padding: 8px 0;
  background: var(--nf-surface);
  border: 1px solid var(--nf-border);
  list-style: none;
  box-shadow: var(--nf-shadow);
}

.nf-primary-menu li:hover>.sub-menu,
.nf-primary-menu li:focus-within>.sub-menu {
  display: block;
}

.nf-primary-menu .sub-menu a {
  display: block;
  padding: 10px 15px;
  color: var(--nf-text);
}

.nf-primary-menu .sub-menu a:hover {
  color: var(--nf-primary);
  background: var(--nf-card);
}


/* =========================================
   9. MOBILE NAVIGATION
========================================= */

.nf-mobile-menu-toggle {
  display: none;
  padding: 10px 14px;
  color: var(--nf-text-light);
  background: var(--nf-primary);
  border: 0;
  border-radius: var(--nf-radius-sm);
  cursor: pointer;
}

.nf-mobile-menu-toggle:hover {
  background: var(--nf-primary-hover);
}


/* =========================================
   10. TABLET
========================================= */

@media (max-width: 1024px) {

  .nf-header-main-inner {
    gap: 20px;
  }

  .nf-header-logo img {
    max-width: 240px;
  }

  .nf-primary-menu>li>a {
    padding: 14px 12px;
  }

}


/* =========================================
   11. MOBILE
========================================= */

@media (max-width: 768px) {

  .nf-header-main-inner {
    min-height: auto;
    flex-wrap: wrap;
    gap: 15px;
    padding-top: 15px;
    padding-bottom: 15px;
  }

  .nf-header-logo {
    flex: 1 1 auto;
  }

  .nf-header-logo img {
    max-width: 180px;
    max-height: 70px;
  }

  .nf-header-ad {
    flex: 1 1 100%;
    justify-content: center;
  }

  .nf-header-ad img {
    max-height: 90px;
  }

  .nf-topbar-inner {
    flex-wrap: wrap;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .nf-navigation-inner {
    flex-wrap: wrap;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .nf-mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nf-primary-menu {
    display: none;
    flex: 1 1 100%;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .nf-primary-menu.is-open {
    display: flex;
  }

  .nf-primary-menu>li>a {
    padding: 12px 15px;
    border-bottom: 1px solid var(--nf-border);
  }

  .nf-primary-menu .sub-menu {
    position: static;
    display: none;
    width: 100%;
    box-shadow: none;
  }

  .nf-primary-menu li:focus-within>.sub-menu {
    display: block;
  }

}


/* =========================================
   12. SMALL MOBILE
========================================= */

@media (max-width: 480px) {

  .nf-topbar-inner {
    gap: 8px;
  }

  .nf-social-links {
    gap: 10px;
  }

  .nf-header-logo img {
    max-width: 150px;
  }

}


/* =========================================
   13. NEON ANIMATED MENU UNDERLINE
========================================= */

.nf-primary-menu>li>a {
  position: relative;
  background: transparent;
}

/* Neon underline */

.nf-primary-menu>li>a::after {
  content: "";
  position: absolute;
  left: 15%;
  bottom: 5px;

  width: 70%;
  height: 2px;

  background: linear-gradient(90deg,
      transparent,
      var(--nf-primary),
      var(--nf-primary-hover),
      var(--nf-primary),
      transparent);

  box-shadow:
    0 0 4px var(--nf-primary),
    0 0 8px color-mix(in srgb, var(--nf-primary) 80%, transparent),
    0 0 14px color-mix(in srgb, var(--nf-primary) 50%, transparent);

  transform: scaleX(0);
  transform-origin: center;

  opacity: 0;

  transition:
    transform 0.35s ease,
    opacity 0.25s ease;
}

/* Hover animation */

.nf-primary-menu>li>a:hover::after,
.nf-primary-menu>li>a:focus-visible::after,
.nf-primary-menu>li.current-menu-item>a::after,
.nf-primary-menu>li.current-menu-ancestor>a::after {
  transform: scaleX(1);
  opacity: 1;
}

/* Remove old background hover */

.nf-primary-menu>li>a:hover,
.nf-primary-menu>li.current-menu-item>a {
  background: transparent;
  color: var(--nf-primary);
}

/* Mobile adjustment */

@media (max-width: 768px) {

  .nf-primary-menu>li>a::after {
    bottom: 3px;
    left: 15px;
    width: 50px;
  }

}

/* =========================================
   14. CUSTOM HEADER IMAGE
========================================= */

.nf-header-main {
  position: relative;
  overflow: hidden;
}

.nf-header-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.nf-header-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.nf-header-main-inner {
  position: relative;
  z-index: 1;
}

/* =========================================
   15. VISITOR THEME TOGGLE
========================================= */

.nf-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin-right: 12px;
  border: 1px solid var(--nf-border);
  border-radius: var(--nf-radius-sm);
  background: var(--nf-surface);
  color: var(--nf-text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nf-theme-toggle:hover {
  background: var(--nf-primary);
  color: #FFFFFF;
  border-color: var(--nf-primary);
}

.nf-theme-toggle:focus-visible {
  outline: 2px solid var(--nf-primary);
  outline-offset: 3px;
}

.nf-theme-toggle__icon {
  display: block;
}