/* header.css - Final Version */

/* ============================================
   Header Base Styles
   ============================================ */
.header {
  margin: 0 !important;
  padding: 0 !important;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  font-family: "Inter", "Noto Sans JP", sans-serif;

  background: linear-gradient(
    135deg,
    rgba(3, 105, 161, 0.8) 0%,
    rgba(14, 165, 233, 0.8) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  height: 80px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--max-width, 1200px);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.logo a {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: var(--color-bg-light);
  letter-spacing: 0.5px;
}

/* ============================================
   PC Navigation
   ============================================ */
.nav {
  display: flex;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--spacing-2xl);
}

.nav-link {
  font-family: var(--font-display);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-bg-light);
  text-decoration: none;
  position: relative;
  transition: var(--transition-fast);
  letter-spacing: 0.3px;
  padding: 5px 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-secondary-light);
  transition: var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--color-secondary-light);
}

/* ============================================
   Hamburger Button
   ============================================ */
.hamburger-button {
  display: none; /* Default: hidden on PC */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1010; /* Must be on top of the menu */
  position: relative;
  width: 45px;
  height: 45px;
}

.hamburger-bar {
  display: block;
  width: 26px;
  height: 3px;
  margin: 5px auto;
  background-color: var(--color-bg-light);
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}

/* ============================================
   Responsive Design (Breakpoint: 768px)
   ============================================ */
@media (max-width: 768px) {
  .header {
    height: 70px;
  }
  .header-container {
    padding: 0 var(--spacing-md);
  }

  /* --- Hamburger Button Visibility --- */
  .hamburger-button {
    display: block;
  }

  /* --- Mobile Navigation Menu Styling --- */
  .nav {
    /* This is the overlay container */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* Full viewport width */
    height: 100vh; /* Full viewport height */
    background-color: rgba(3, 105, 161, 0.8);

    /* Centering the inner nav-list */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Hide by default */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .nav.is-active {
    /* Show when active */
    opacity: 1;
    visibility: visible;
  }

  /* --- Menu Items List --- */
  .nav-list {
    flex-direction: column;
    gap: var(--spacing-xl);
    text-align: center;
    padding: 0;
    margin: 0;
    width: 100%; /* Ensure it doesn't overflow */
  }

  /* --- Menu Item Link --- */
  .nav-link {
    font-size: var(--font-size-2xl);
    padding: var(--spacing-sm);
    display: block; /* Make the entire area clickable */
  }
  .nav-link::after {
    display: none; /* Remove underline effect on mobile */
  }

  /* --- Hamburger "X" Animation --- */
  .hamburger-button.is-active .hamburger-bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger-button.is-active .hamburger-bar:nth-child(2) {
    opacity: 0;
  }
  .hamburger-button.is-active .hamburger-bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

@media (max-width: 480px) {
  .header {
    height: 60px;
  }
  .logo-text {
    font-size: var(--font-size-base);
  }
}
