@charset "UTF-8";

/* =====================================
   共通レイアウト
   ===================================== */

.inner {
  width: 960px;
  margin: 0 auto;
  position: relative;
}
.inner::after {
  content: "";
  display: block;
  clear: both;
}

/* =====================================
     ヘッダー・グローバルナビ（PC）
     ===================================== */

#top-head {
  position: absolute;
  top: 0;
  width: 100%;
  margin: 2em auto 0;
  padding: 0;
  line-height: 1;
  z-index: 999;
}

#top-head,
#top-head a {
  color: #222;
  text-decoration: none;
}

#top-head .inner {
  position: relative;
}

#global-nav ul {
  list-style: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  font-size: 0.9em;
  display: flex;
  justify-content: center;
}

#global-nav ul li a {
  position: relative;
  display: inline-block;
  padding: 5px 8px;
}

/* 下線アニメーション前提の hover（::after は別CSSで定義されている想定） */
#global-nav ul li a:hover::after {
  transform: scaleX(1);
}

/* =====================================
     スクロール時の固定ヘッダー（PC）
     ===================================== */

#top-head.fixed {
  position: fixed;
  top: 0;
  margin-top: 0;
  padding-top: 40px;
  height: 10px;
  background: rgba(255, 255, 255, 0.8);
  transition: top 0.65s ease-in;
}

/* =====================================
     ハンバーガーメニュー（共通）
     ===================================== */

#nav-toggle {
  display: none;
  position: absolute;
  top: 14px;
  right: 12px;
  width: 34px;
  height: 36px;
  cursor: pointer;
  z-index: 101;
}

#nav-toggle div {
  position: relative;
}

#nav-toggle span {
  position: absolute;
  left: 0;
  display: block;
  width: 100%;
  height: 4px;
  background: #666;
  transition: 0.35s ease-in-out;
}

#nav-toggle span:nth-child(1) {
  top: 0;
}
#nav-toggle span:nth-child(2) {
  top: 11px;
}
#nav-toggle span:nth-child(3) {
  top: 22px;
}

/* =====================================
     モバイルレイアウト（〜900px）
     ===================================== */

@media screen and (max-width: 900px) {
  #top-head,
  .inner {
    width: 100%;
    padding: 0;
  }

  #top-head {
    position: fixed;
    top: 0;
    margin-top: 0;
  }

  /* 固定時スタイルの簡略版（モバイル時） */
  #top-head.fixed {
    padding-top: 0;
    background: transparent;
  }

  #mobile-head {
    position: relative;
    z-index: 999;
    width: 100%;
    height: 56px;
    background: #fff;
  }

  .fixed #global-nav ul {
    margin-bottom: 3px;
  }

  #global-nav {
    position: absolute;
    top: -500px; /* 閉じているときは画面外 */
    width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    transition: 0.5s ease-in-out;
  }

  #global-nav ul {
    list-style: none;
    position: static;
    right: 0;
    bottom: 0;
    font-size: 14px;
    display: block;
    margin: 0;
    padding: 0;
  }

  #global-nav ul li {
    position: static;
    float: none;
  }

  #top-head #global-nav ul li a,
  #top-head.fixed #global-nav ul li a {
    display: block;
    width: 100%;
    padding: 18px 0;
    color: #333;
  }

  /* ハンバーガー表示 */
  #nav-toggle {
    display: block;
  }

  /* ハンバーガー開閉アニメーション */
  .open #nav-toggle span:nth-child(1) {
    top: 11px;
    transform: rotate(315deg);
  }
  .open #nav-toggle span:nth-child(2) {
    width: 0;
    left: 50%;
  }
  .open #nav-toggle span:nth-child(3) {
    top: 11px;
    transform: rotate(-315deg);
  }

  /* ナビゲーションのスライドダウン */
  .open #global-nav {
    transform: translateY(556px);
  }
}
