/* ============================================================
   tgken_common_patch.css
   ── 既存の tgken_common.css の末尾に <link> で追加
   ============================================================ */

/* ============================================================
   PCナビ：テキスト化・文字サイズ拡大・1行収め
   ============================================================ */
#global ul {
  display: flex;          /* 均等分割で1行に収める */
  width: 980px;
  flex-wrap: nowrap;
}

#global ul li {
  flex: 1;                /* 均等幅 */
  width: auto;            /* 既存の 245px を上書き */
  float: none;
}

#global ul li a {
  height: auto;
  min-height: 65px;
  text-indent: 0;                   /* 画像非表示の解除 */
  background: none !important;      /* 画像背景を無効化 */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 6px;
  font-size: 1.1em;                 /* 既存0.82em → 約1.5倍 */
  font-weight: bold;
  color: #fff;
  line-height: 1.3;
  letter-spacing: 0.01em;
  white-space: nowrap;              /* 折り返し禁止で1行確保 */
  position: relative;
}

/* 区切り線（既存スタイルを flex 対応で再定義） */
#global ul li a:before {
  content: "";
  width: 1px;
  height: 32px;
  position: absolute;
  left: 0;
  top: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(0, -50%);
  pointer-events: none;
}
#global ul li:last-child a:after {
  content: "";
  width: 1px;
  height: 32px;
  position: absolute;
  right: 0;
  top: 50%;
  background: rgba(255,255,255,0.2);
  transform: translate(0, -50%);
  pointer-events: none;
}

/* ============================================================
   PCナビ：サブメニュー（portal 固定方式）
   owl-carousel.min.css が .owl-carousel に
   position:relative; z-index:1 の積み重ねコンテキストを設定するため、
   header 内の子要素では z-index をいくら大きくしても勝てない。
   → サブメニューを JS で <body> 直下に移動し position:fixed で配置。
      これで owl-carousel と完全に別の積み重ねになり必ず前面に出る。
   ============================================================ */

/* 親メニューに ▾ 矢印 */
#global ul li.has-sub > a::after {
  content: " ▾";
  font-size: 0.75em;
  opacity: 0.8;
  position: static;
  width: auto;
  height: auto;
  background: none;
  transform: none;
}

/* portal サブメニュー本体 */
.global-sub-menu {
  display: none;
  /* ★変更：fixed(画面基準の座標)→absolute(ページ全体基準の座標)に変更。
     このサブメニューの位置を計算しているJS側(各HTMLの<head>内スクリプト)は
     rect.bottom + window.scrollY / rect.left + window.scrollX という
     「ページ全体基準」の座標を計算しているため、fixed(画面基準)のままだと
     スクロールした分だけ実際の位置とズレてしまい、
     マウスに追随して分離しているように見えていた。
     body直下に移動して表示する要素であり、bodyやhtmlにposition指定も無いため、
     absoluteに変更してもJS側の計算と基準が一致し、
     owl-carouselのz-index問題を回避する目的（下記コメント参照）も引き続き満たせる。 */
  position: absolute;
  z-index: 9999;
  background: #006CD9;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  white-space: nowrap;
  min-width: 200px;
}
.global-sub-menu.is-open {
  display: block;
}
.global-sub-menu a {
  display: block;
  padding: 12px 20px;
  font-size: 0.9em;
  font-weight: normal;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  text-indent: 0;
  background: none !important;
  height: auto;
  min-height: auto;
  line-height: 1.4;
}
.global-sub-menu a:before,
.global-sub-menu a:after {
  display: none !important;
}
.global-sub-menu a:hover {
  background: #005bb5 !important;
  color: #fff;
}

/* ============================================================
   SPナビ：ハンバーガーボタン CSS のみで描画
   ============================================================ */
@media only screen and (max-width: 768px) {
  header #spMenu #switchBtn {
    background: none !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
  }
  header #spMenu #switchBtn::before,
  header #spMenu #switchBtn::after {
    content: "";
    display: block;
    width: 26px;
    height: 2px;
    background: #492e65;
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
  }
  /* 中棒は box-shadow で追加（擬似要素2つで3本線） */
  header #spMenu #switchBtn::before {
    box-shadow: 0 8px 0 #492e65;
  }
  /* × 状態 */
  header #spMenu #switchBtn.btnClose::before {
    transform: translateY(4px) rotate(45deg);
    box-shadow: none;
  }
  header #spMenu #switchBtn.btnClose::after {
    transform: translateY(-4px) rotate(-45deg);
  }
}

/* ============================================================
   フッター：関連校リンク
   ============================================================ */
footer .ftRelated {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  margin: 12px auto 8px;
  padding: 8px 0;
  /* ★ ライン不要なので border を削除 */
  width: 980px;
}

footer .ftRelated li {
  position: relative;
  float: none;
}

/* 区切り線 */
footer .ftRelated li + li::before {
  content: "|";
  /* ★ 直下メニューと同じ色 #555 */
  color: #999;
  margin: 0 8px;
}

footer .ftRelated li a {
  font-size: 0.857em;     /* ftSitemap li a と同じ */
  font-weight: bold;
  /* ★ 直下メニュー(ftSitemap)と同じ文字色 */
  color: #555;
  text-decoration: none;
  padding: 2px 0;
}

footer .ftRelated li a:hover {
  color: #492e65;
  text-decoration: underline;
}

/* 外部リンクアイコン */
footer .ftRelated li a::after {
  content: '\f35d';
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  font-size: 0.75em;
  margin-left: 4px;
  opacity: 0.6;
}

@media only screen and (max-width: 768px) {
  footer .ftRelated {
    width: 90%;
    flex-direction: column;
    align-items: center;
  }
  footer .ftRelated li {
    width: 100% !important;
    float: none !important;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    padding: 10px 0;
    color: #555;
  }
  footer .ftRelated li + li::before {
    display: none;
  }
}
