/* === assets/css/components/header.css === */

/* === BASE HEADER === */
.site-header {
  width: 100%;
  max-width: 100vw;                 /* ← stop 100% + padding from exceeding the viewport */
  background: linear-gradient(135deg, rgba(8, 10, 31, 0.9), rgba(18, 21, 56, 0.9));
  padding: var(--spacing-m) var(--spacing-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 0 15px var(--color-accent-glow);
  border-bottom: 2px solid var(--color-accent-glow);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  box-sizing: border-box;           /* ← belt-and-suspenders (base.css already sets this) */
}

/* === LOGO === */
.logo {
  font-size: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease-in-out;
  text-shadow: none;
}

.logo:hover {
  transform: scale(1.05);
}

.header-logo-image {
  height: 100px;
  width: auto;
  filter: drop-shadow(0 0 8px var(--color-highlight-cyber));
  transition: filter 0.3s ease-in-out;
}

.logo:hover .header-logo-image {
  filter: drop-shadow(0 0 15px var(--color-accent-glow)) drop-shadow(0 0 25px var(--color-highlight-cyber));
}

/* === NAVIGATION === */
nav {
  width: 100%;
  max-width: 100%;                  /* ← never wider than the header */
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;                 /* ← prevents stray 1–2px overflows from flex gap */
}

#nav-links {
  list-style: none;
  display: flex;
  gap: var(--spacing-l);
  flex-wrap: wrap;                  /* ← allow wrapping instead of forcing horizontal scroll */
  max-width: 100%;                  /* ← stay inside nav */
}

/* === HAMBURGER BUTTON === */
.mobile-menu-button {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
}

.mobile-menu-button .line {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--color-text-headings);
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}

/* === MOBILE STYLES === */
@media screen and (max-width: 768px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-s) var(--spacing-m);
  }

  nav {
    flex-direction: column;
    gap: var(--spacing-m);
    width: 100%;
    max-width: 100%;
  }

  #nav-links {
    /* off-canvas sheet under the header */
    position: fixed;
    top: calc(56px + var(--spacing-s)); /* adjust if your header is taller */
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - 56px);
    overflow-y: auto;

    display: flex;                  /* keep flex so .active only changes transform */
    flex-direction: column;
    gap: 0;

    background-color: var(--color-primary-bg);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-m) 0;
    margin: 0;

    transform: translateX(-120%);   /* hidden by default */
    transition: transform .25s ease;
  }

  /* show menu when active */
  #nav-links.active { transform: translateX(0); }

  #nav-links li { width: 100%; text-align: center; }

  #nav-links li a {
    display: block;
    padding: var(--spacing-m);
    font-size: 1.2rem;
    font-family: var(--font-headings);
    color: var(--color-text-main);
    transition: background-color .2s, color .2s;
  }

  #nav-links li a:hover,
  #nav-links li a.active {
    background-color: var(--color-accent-glow);
    color: var(--color-primary-bg);
    text-shadow: none;
  }

  .mobile-menu-button {
    display: flex;
    margin-top: var(--spacing-s);
  }
}


/* === TRANSITION FOR SMOOTHNESS === */
#nav-links {
  transition: max-height 0.3s ease-in-out;
}
