/* nav-menu.css */
#menu-toggle{
  font-size: 1.5rem;
  width: 2em;
  height: 2em;

  margin: 0;
  padding: 5px 10px;

  border: none;
  border-radius: 30%;
  color: var(--color-header-text);
  background: none;
  cursor: pointer;
  margin-right: .5rem;
}

/* オーバーレイ */
#menu-overlay {
  z-index: 200;
  position: fixed;
  top: 0;
  left: 0;

  width: 100vw;
  height: 100vh;
  
  background-color: rgba(0,0,0,.5);
  display: none;
}

/* メニューオーバーレイがアクティブの時 */
#menu-overlay.active {
  display: block;
}
#menu-contents {
  z-index: 200;
  position: fixed;
  top: 0;
  left: 0;

  width: 450px;
  max-width: 75%;
  height: 100vh;

  background-color: #000;
  color: #fff;
  overflow-y: auto;

  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}
#menu-contents.active {
  transform: translateX(0%);
  opacity: 1;
  pointer-events: auto;
}

/**********************************
TOPメニュー
*/
.top_menu a{ color: #333; }
.top_menu a:hover{ color: #6d0b0b; }
.top_menu{
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  
  font-weight: bold;
  font-size: 14px;
  font-family: "Noto Sans JP", sans-serif;
  position: relative; 
}
.top_menu .menu-item{
  margin: 10px 20px 10px 0px;
  list-style: none;
}
.top_menu .menu-item-has-children .sub-menu {
  position: absolute; /* top_menuをrelativeとするためtop / leftは未指定 */
  
  z-index: 2;
  padding: 0 10px;
  border: 2px solid #000;
  background-color: #dadf00;

  transition: max-height 0.3s ease, opacity 0.3s ease;
  visibility: hidden;
  opacity: 0;
  max-height: 0;
}
/* ホバー時に子要素を表示 */
.top_menu .menu-item-has-children:hover .sub-menu {
  visibility: visible;
  opacity: 1;
  max-height: 100vh; /* メニューの高さに合わせて調整（多めにしておく） */
}

.top_menu .menu-item-has-children .sub-menu li{
  padding: .5em;
}
.top_menu li:before {
  vertical-align: middle;
  margin-right: 3px;
  display: inline-block;
  content: "\f055";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}
.top_menu li:first-child:before {
  content: "\f015";
}
.top_menu .sub-menu li:before {
  padding-left:10px;
  margin-right: 5px;
  content: "\f549";
}

/**********************************
サイドメニュー
*/
.side_menu{
  padding: .75em;
  padding-top: 2em;
  padding-bottom: 0;
  margin: 0;
}
.side_menu_append{
  padding-top: 0;
  border-top: 1px solid #222;
}

.side_menu .menu-item {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: start;
  align-items: center;
  flex-wrap: wrap;
}
.side_menu .menu-item:not(:last-child) {
  border-bottom: 1px solid #222;
}

.side_menu .menu-item a {
  min-width: 60%;
  display: block;
  padding: 10px 15px;
  font-size: 1rem;
  text-decoration: none;
  letter-spacing: 1px;
  transition: background-color 0.3s, color 0.3s;
}
.side_menu li.menu-item.open{
  background-color: #080808;
}

/** 子要素 */
.side_menu .sub-menu {
  margin: 0;
  padding: 0;
  width: 100%;
  overflow: hidden;

  transition: max-height 0.3s ease, opacity 0.3s ease;
  visibility: hidden;
  opacity: 0;
  max-height: 0;
}
.side_menu .sub-menu .menu-item{
  margin-left: 1.5em;
}
/* 開閉マークを右側に表示 */
.side_menu .menu-item-has-children {
  position: relative;
}
.side_menu .menu-item-has-children.open > .sub-menu {
  visibility: visible;
  opacity: 1;
  max-height: 500px; /* メニューの高さに合わせて調整（多めにしておく） */
}
/* サブメニュー開閉マーク */
.side_menu .submenu-toggle {
  margin-left: auto;
  font-size: 0.9em;
  cursor: pointer;
  user-select: none;
  padding-left: 0.5em;
  padding-right: 1em;
}

@media (max-width: 768px) {
  .side_menu_append{
    padding-bottom: 15vh;
  }
  .side_menu .menu-item a {
    font-size: 0.9rem;
  }
}