@use "sass:math";
@use "../global/common" as global;

// ------------------------------
// サイドナビゲーション
// ------------------------------
// ナビゲーション固定
#sidebar {
  height: 100%;
  background: global.$base-bg-light-white;

  .ps__rail-y {
    right: 0;
    left: auto !important;

    .ps__thumb-y {
      width: 8px;
      background: lighten(global.$base-bg-primary, 45%);
    }
  }
  &.js-mobile{
    height: auto;
  }
}

@media screen and (min-width: global.$breakpoint-md-min){
  #sidebar {
    background: global.$base-bg-light-gray;
  }
}

.js-nav #acms-admin-main {
  position: absolute;
  top: 0;
  width: 100%;
}

.acms-icon-admin-blog-children {
  color: #999999;
}

.acms-sidebar {
  top: 0;
  bottom: 0;
  width: 100%;
  padding-bottom: 0;
}

.acms-sidebar-header .js-acms-dropdown-menu {
  padding: 0;
}

.acms-sidebar-main {
  position: relative;
  box-sizing: border-box;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overflow-scrolling: touch;
}

.acms-sidebar-alert {
  position: relative;
  margin: 0;
  padding: 10px 10px 10px 15px;
  color: #fff;
  font-weight: bold;
  background: global.$acms-alert-danger-border;
  @include global.font-size(11);

  .acms-icon-tooltip {
    margin-left: 5px;
  }
}

@media screen and (min-width: global.$breakpoint-md-min){
  .acms-sidebar {
    position: fixed;
    width: auto;
  }
  .acms-sidebar-header {
    width: 175px;
  }
  .acms-sidebar-main {
    width: 175px;
  }
}

.acms-sidebar-title {
  padding-left: calc(5px + constant(safe-area-inset-left));
  background: global.$base-bg-light-gray;
}

// SP用
.acms-sidebar-sp-list {
  display: table;
  width: 100%;
  table-layout: fixed;
  border-bottom: 1px solid #9E9E9E;

  li {
    border-bottom: 0; // acms.cssの打ち消し
  }
}
.acms-sidebar-sp-list-item {
  display: table-cell;
  width: math.div(100%, 3);
  text-align: center;
  vertical-align: middle;
  border-right: 1px solid #CCC;

  &:last-child {
    border: 0;
  }

  a {
    display: block;
    padding: 10px 2px;
    color: #333;
    @include global.font-size(20);
    font-weight: bold;
    &:hover {
      text-decoration: none;
    }
  }
  .acms-icon {
    padding: 0;
  }
  .acms-user-profile {
    display: block;
    margin: 0 auto;
    border: 0;
  }
}
.acms-sidebar-sp-list-text {
  display: block;
  margin-top: 5px;
  @include global.font-size(11);
}

.acms-sidebar-link a {
  padding: 20px 10px 20px 40px;
  padding-left: calc(10px + constant(safe-area-inset-left));
  color: #333;
  font-weight: bold;
  text-indent: -12px;
  word-break: break-all;
  background: global.$base-bg-light-white;
  @include global.font-size(14);
  &:hover {
    text-decoration: none;
  }
}

.acms-sidebar-item {
  padding: 10px 10px;
  @include global.font-size(14);
  font-weight: bold;
  line-height: 1.2;
  border-bottom: 1px solid #ccc;

  [class*="acms-label"] {
    font-weight: normal;
  }
}

.acms-sidebar-item-inner {
  display: table;
  width: 100%;
}

.acms-sidebar-item-cell {
  display: table-cell;
}

.acms-sidebar-item-cell-full {
  width: 100%;
}

.acms-sidebar-item-cell-middle {
  vertical-align: middle;
}

@media (min-width : global.$breakpoint-md-min) {
  .acms-sidebar-link a {
    padding: 10px 15px 10px 40px;
    padding-left: calc(10px + constant(safe-area-inset-left));
    text-indent: -12px;
    background: global.$base-bg-light-gray;
  }

  .acms-sidebar-link .stay a {
    background: global.$base-bg-light-white;
  }
}
