@use 'global/common' as global;

/* ------------------------------
 ナビゲーション
------------------------------- */
.acms-navbar {
  z-index: global.zIndex(acms-navbar);
  width: 100%;
  margin: 0 0 20px;
  clear: both;
  list-style: none outside none;
  background-color: global.$acms-color-black;
  border-top: solid 1px global.$acms-color-black;
  border-bottom: solid 1px global.$acms-color-black;

  // リスト全体
  ul {
    display: block;
    padding: 0;
    margin: 0 auto;
    list-style: none;
  }

  // リンク
  a:link,
  a:visited,
  a:hover,
  a:active,
  #viewing {
    display: block;
    _display: inline-block;
    padding: 0 30px;
    font-size: 14px;
    line-height: 4.5;
    color: global.$acms-color-white;
    text-decoration: none;
    letter-spacing: 0 !important;
  }

  a:hover,
  #viewing {
    text-decoration: none;
    background: global.$acms-color-gray90;
  }

  .stay a,
  a:active {
    background: global.$acms-color-gray90;
  }

  #viewing {
    background: global.$acms-color-gray30;
  }

  /* リストの1段目 */
  li {
    position: relative;
    top: 0;
    font-weight: bold;
    white-space: nowrap;
    border-left: solid 1px global.$acms-color-gray60;

    &:last-child {
      border-right: solid 1px global.$acms-color-gray60;
    }
  }

  /* 2段目以降 */
  ul ul {
    position: absolute;
    top: 60px;
    left: 0;
    z-index: global.zIndex(acms-navbar-deep);
    display: none;
    width: auto;
    padding: 0;

    li {
      position: relative;
      width: 100%;
      height: 40px;
      clear: left;
      font-size: 13px;
      border-right: none;
      border-left: none;
    }

    a {
      *width: 240px;
      height: 40px !important;
      padding: 0 20px;
      *overflow: visible;
      font-size: 13px;
      line-height: 3 !important;
      background: global.$acms-color-black;
      border-top: solid 1px global.$acms-color-black;
      border-bottom: solid 1px global.$acms-color-gray80;

      &:hover {
        background-color: global.$acms-color-gray90;
      }
    }
  }

  ul li.stay ul a {
    background-color: global.$acms-color-black;
    box-shadow: 0 0 0 rgb(0 0 0 / 50%);

    &:hover {
      background-color: global.$acms-color-gray90;
    }
  }

  /* 3段目以降 */
  ul ul ul {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;

    a {
      background: global.$acms-color-black;
      border-top: solid 1px global.$acms-color-black;
      border-bottom: solid 1px global.$acms-color-gray80;
    }
  }
}

// 3段目を表示
.acms-navbar ul li:hover > ul {
  display: block;
}

* + html .acms-navbar ul li ul a {
  /* IE用 */
  width: 200px; /* （94-10-10-1-1）パディングとボーダーの分を引いた値 */
  white-space: normal; /* 幅に応じて改行 */
}

@media (min-width: global.$breakpoint-md-min) {
  .acms-navbar {
    height: 60px;

    ul {
      display: block;
      width: 940px;
      padding: 0;
      margin: 0 auto;
      list-style: none;
    }

    li {
      float: left;
    }

    a:link,
    a:visited,
    a:hover,
    a:active,
    #viewing {
      height: 60px;
    }

    /* 2段目以降 */
    ul ul {
      position: absolute;
      top: 60px;
      left: 0;

      li {
        position: relative;
        width: 100%;
        height: 40px;
      }

      a {
        *width: 240px;
        height: 40px !important;
        padding: 0 20px;
      }
    }
  }
}
