@use '../global/common' as global;

// ------------------------------
// ヘッダー ナビゲーション
// ------------------------------

// ブログ名全体
.acms-navbar-admin {
  z-index: global.zIndex(acms-navbar-admin);
  box-sizing: border-box;
  width: 100vw;
  height: 60px;
  padding: 0 10px;
  padding-right: calc(5px + constant(safe-area-inset-right));
  padding-left: calc(5px + constant(safe-area-inset-left));
  text-align: center;
  background: global.$base-bg-primary;

  .logo {
    float: left;
    margin: 0;
    line-height: 1;
  }
}

@include global.media-breakpoint-up(md) {
  .acms-navbar-admin {
    width: 50px;
    height: 100vh;
  }
}

/* ナビゲーションリンク */
.acms-navbar-admin-nav {
  padding-left: 0;
  margin: 0 -10px;

  @include global.font-size(22);

  > li {
    margin-bottom: 10px;
    list-style: none;

    > a,
    > button {
      display: block;
      padding: 5px 0;
      margin: 0 auto;
      line-height: 1.2;
      color: global.$acms-color-white;
      text-align: center;
      background: 0;
      border: 0;

      @include global.font-size(22);

      &:focus {
        outline: 0;
      }

      &:hover,
      &:focus,
      &:active {
        opacity: 0.6;
      }
    }

    // ナビゲーションリンク ボタンは回避
    .acms-btn {
      padding: 8px 10px;
    }
  }

  [class*='acms-icon-'] {
    padding: 0;
  }
}

.acms-user-profile {
  border: 2px solid global.$acms-color-gray20;
  border-radius: 100%;
}

// ブログ名
.acms-title-blog,
.acms-title-rule {
  margin: 0;
  font-weight: bold;
  border-bottom: 1px solid #9e9e9e;

  @include global.font-size(13);

  button {
    display: block;
    width: 100%;
    padding: 20px 10px 20px 20px;
    font-weight: bold;
    color: global.$acms-color-black;
    text-align: left;
    appearance: none;
    background: 0;
    border: 0;
  }
}

// hover
.acms-navbar-admin-nav > li > a:hover,
.acms-title-blog button:hover {
  text-decoration: none;
  opacity: 0.5;
}

.acms-title-blog .acms-arrow-right {
  position: absolute;
  right: 10px;
  margin: 5px 0 0;
}

@include global.media-breakpoint-up(md) {
  .acms-title-blog,
  .acms-title-rule {
    button {
      padding: 10px 20px;
    }
  }

  .acms-navbar-admin-profile {
    position: absolute;
    bottom: 15px;
    left: 10px;

    .js-acms-dropdown-menu {
      top: -60px;
    }
  }
}

.acms-nav {
  z-index: global.zIndex(acms-nav);
}

@include global.media-breakpoint-up(md) {
  .acms-nav {
    position: fixed;
    top: 0;
  }
}

.acms-navbar-system {
  position: relative;

  // a-blog cmsのロゴを固定
  .acms-list-blog-sp {
    position: absolute;
    top: 15px;
    right: 15px;
    width: auto;
    margin: 0;
    color: global.$acms-color-white;

    @include global.font-size(30);
  }
}

.acms-title-cms {
  padding: 15px 0 20px;
  margin: 0;

  @include global.font-size(26);
}

.acms-icon-logo {
  padding: 0;
}

.acms-icon-logo.acms-blog-color {
  display: block;
  color: global.$acms-color-white;
}

// スクロール
.acms-list-scroll {
  max-height: 400px;
  overflow: auto;
}

@include global.media-breakpoint-down(md) {
  // オフキャンバス
  .js .js-offcanvas {
    display: none;

    &.js-acms-offcanvas-sidebar {
      display: block;
    }
  }

  .no-js {
    overflow: inherit;

    .acms-sidebar {
      position: static;
      width: 100%;
    }

    .acms-nav {
      position: static;
    }

    #acms-admin-main {
      height: auto;
      overflow: inherit;
    }
  }
}

.acms-navbar-admin-nav-header {
  display: flex;
  min-width: 210px;
  padding: 10px 15px;
  background-color: global.$acms-color-gray20;
  border-bottom: 1px solid global.$acms-color-gray60;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}

.acms-navbar-admin-nav-status {
  flex: 1;
  padding-left: 10px;
}

.acms-navbar-admin-nav-username {
  margin: 0 0 2px;
  font-size: 12px;
  font-weight: bold;
  overflow-wrap: break-word;
}

.acms-navbar-admin-nav-usercode {
  margin: 0 0 2px;
  font-size: 10px;
}
