﻿/* リセットと基本設定 */
ul#navi, ul#navi ul, ul#navi ul ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size:0.95em;
}

/* 親メニュー */
ul#navi {
  display: flex;
  justify-content: space-between; /* 均等配置 */
  width: 950px;
  margin: 0 auto; /* 中央寄せ */
  background-color: #f8f8f8;
  padding: 0;
}

ul#navi > li {
  position: relative;
  border-left: 1px solid #ccc;

  width:158.3px;

}


ul#navi > li:first-child {
  border-left: none;
}

ul#navi > li:last-child {
  border-right: 1px solid #ccc;
}


ul#navi > li > a {
  display: block;
  padding: 10px 20px;
  color: #333;
  text-decoration: none;
  background-color: #f8f8f8;
  transition: background-color 0.3s ease, color 0.3s ease;
  text-align: center; /* ← これを追加 */

}

ul#navi > li > a:hover {
  background-color: #4E95D9;
  color: #fff;
}

/* 子メニュー（第2階層） */
ul#navi li ul {
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #f8f8f8;
  min-width: 180px;
  z-index: 1000;
}

/*ul#navi li:hover > ul {
  display: block;
}*/

/* 子メニュー項目 */
ul#navi li ul li {
  position: relative; /* 孫メニューの基準になる */
}

ul#navi li ul li a {
  display: block;
  padding: 10px 20px;
  color: #333;
  text-decoration: none;
  background-color: #f8f8f8;
  transition: background-color 0.3s ease, color 0.3s ease;
}

ul#navi li ul li a:hover {
  background-color: #87B8E5;
  color: #fff;
}

/* 孫メニュー（第3階層） */
ul#navi li ul li ul {
  display: none;
  position: absolute;
  top: 0;
  left: 100%; /* 子メニューの右横に表示 */
  background-color: #f8f8f8;
  min-width: 180px;
  z-index: 1000;
}

/*ul#navi li ul li:hover > ul {
  display: block;
}*/

/* 孫メニュー項目 */
ul#navi li ul li ul li a {
  display: block;
  padding: 10px 20px;
  color: #333;
  text-decoration: none;
  background-color: #f8f8f8;
  transition: background-color 0.3s ease, color 0.3s ease;
}

ul#navi li ul li ul li a:hover {
  background-color: #A6CAEC;
  color: #fff;
}

ul#navi > li.has-child > a {
  position: relative; /* 疑似要素を絶対配置するための基準 */
  padding-right: 20px; /* アイコン分の余白を確保（必要に応じて調整） */
}


/* 第一階層（親）に▽を表示 */
ul#navi > li.has-child > a::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 4px; /* 右端からの距離を調整 */
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-image: url("/images/down.gif");
  background-size: contain;
  background-repeat: no-repeat;
}
ul#navi li ul li.has-grandchild > a {
  position: relative;        /* 疑似要素の絶対配置の基準 */
  padding-right: 20px;       /* アイコン分の余白を確保（必要に応じて調整） */
}

/* 第二階層（子）に▷を表示 */
ul#navi li ul li.has-grandchild > a::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 4px;                /* 右端からの距離を調整 */
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-image: url("/images/right.gif");
  background-size: contain;
  background-repeat: no-repeat;
}

/*滑らかさを保つ*/
ul#navi li ul,
ul#navi li ul li ul {
  display: none; /* 初期は非表示、JSで制御 */
}

/*Gotoトップ*/
.go-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  z-index: 1000;
}

.go-top img {
  width: 100%;
  height: auto;
  cursor: pointer;
}
