/* header.css */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-img {
  height: 40px;
  width: auto;
  margin-right: 40px;
}

.main-nav ul {
  display: flex;
  gap: 30px;
}

.main-nav a {
  font-weight: 500;
  color: var(--secondary-color);
  font-size: 16px;
  padding: 5px 0;
  position: relative;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.main-nav a:hover::after {
  width: 100%;
}

/* Hamburger Menu (Mobile) */
.hamburger {
  display: none; /* Hidden on desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  cursor: pointer;
  z-index: 1001;
  position: fixed; /* スマホ時に右上に固定 */
  top: 20px;
  right: 20px;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--secondary-color);
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Nav */
.mobile-nav {
  position: fixed;
  top: 0;
  left: -100%; /* Off-screen */
  width: 80%;
  max-width: 300px;
  height: 100%;
  background-color: var(--secondary-color);
  padding-top: var(--header-height);
  transition: left 0.3s ease;
  z-index: 999;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.mobile-nav.active {
  left: 0;
}

.mobile-nav ul {
  width: 100%;
  padding: 20px 0;
}

.mobile-nav li {
  text-align: center;
  margin-bottom: 20px;
}

.mobile-nav a {
  color: var(--text-color-light);
  font-size: 20px;
  font-weight: 500;
  display: block;
  padding: 10px 0;
}

.mobile-nav a:hover {
  color: var(--primary-color);
}

/* Responsive Adjustments for Header */
@media (max-width: 992px) {
  .main-nav {
    display: none;
  }
  .hamburger {
    display: flex; /* スマホでは表示 */
  }
  .header .container {
    justify-content: center; /* ロゴを中央に */
  }
  .header .logo-img {
    margin-right: 0; /* ロゴの右マージンを解除 */
  }
}

@media (max-width: 480px) {
  .header {
    height: 70px;
  }
  .logo-img {
    height: 30px;
  }
}
