﻿@charset "UTF-8";

/* 全体のスタイル */
.global-nav {
  width: 100%;  
  background-color: #fff;
  position: fixed;
  display: flex;
  align-items: center;  
  z-index: 1000;
}

.global-nav .header_logo {
 margin-right: auto;
  padding-top: 10px;
  padding-bottom:0px;
  padding-right:30px;
  padding-left:50px;
 
}

@media (max-width: 840px) {
  .global-nav .header_logo {
    margin-right: auto;
    padding: 15px 20px;
  }
}

.logo-size {
  width: 100px;
}

#nav-menu {
  padding-right: 50px;
  padding-top: 0px;
}

.global-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
}

.global-nav ul li {
  position: relative;
}

.global-nav ul li:hover > .sub-nav {
  display: flex;
  flex-direction: column;
}

.global-nav ul li a {
  display: block;
  padding: 14px 20px;
  color: black;
  text-decoration: none;
}

.global-nav ul li a:hover {
  color: green;
  font-weight: bold;
}

/* サブナビのスタイル */
.sub-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #eee;
  opacity: 0.9;
  padding: 30px;
  z-index: 1;
  min-width: 200px;
  flex-direction: column;
  border: 3px solid #ccc;
}

.sub-nav li {
  flex: 1;
  border-bottom: 1px solid #ccc;
}

.sub-nav li:last-child {
  border-bottom: none;
}

.sub-nav li a {
  padding: 10px 20px;
  white-space: nowrap;
  display: block;
  font-size: 0.8em;
}

.sub-nav li a:hover {
  background-color: #fff;
}

/* レスポンシブデザインのスタイル */
@media (max-width: 840px) {
  #nav-menu {
    display: none; /* 初期状態では非表示 */
    padding-right: 0; /* パディングをリセット */
    padding-top: 0;
    flex-direction: column;
    width: 100%;
    position: absolute; /* Fixedではなくabsoluteに変更 */
    top: 0;
    left: 0;
    background-color: #fff;
    z-index: 1;
  }
#nav-menu li {
    border-bottom: 1px solid #ccc;
}
  .hamburger {
    display: flex;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 25px;
    height: 25px;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2;
  }

  .hamburger span {
    background-color: black;
    display: block;
    height: 3px;
    width: 100%;
    margin: 4px 0;
    transition: 0.6s;
  }

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

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

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

  .logo-size {
    width: 60px;
  }

  .global-nav .header_logo {
    display: block; /* 初期状態では表示 */
    
  }

  .global-nav ul.active {
    display: flex;
    position: absolute; /* Fixedではなくabsoluteに変更 */
    height: auto; /* 高さを自動に */
  }

  .hamburger.active + #nav-menu {
    display: flex;
  }

  .global-nav ul li {
    width: 100%;
  }

  .global-nav ul li a {
    padding: 14px;
    text-align: left;
  }

  .global-nav ul li .sub-nav {
    display: none;
    position: static;
    width: 100%;
    flex-direction: column; /* サブナビを縦方向に */
  }

  .global-nav ul li.active .sub-nav {
    display: flex;
  }
}
