@charset "utf-8";
/* CSS Document */
html {
  container-type: scroll-state;
}
#nav_sp {
  position: relative;
}
.sp_menu_open {
  width: 75px;
  height: 75px;
  border-radius: 35%;
  background: rgba(51, 51, 51, 0.75);
  padding: 17.5px;
  position: fixed;
  top: 12.5px;
  right: 12.5px;
  cursor: pointer;
  z-index: 4;
  display: inline-block;
  &:hover, &:active {
    background: rgba(0, 0, 0, 0.7);
  }
  & span {
    display: block;
    height: 4px;
    margin: 6px 0;
    background: #fff;
    border-radius: 2px;
    transition: 0.3s;
    top: -5px;
  }
  & p {
    color: #fff;
    font-size: 0.875rem;
    top: -5px;
    left: -4px;
  }
}
/* ハンバーガー変形 */
#sp_menu_toggle:checked + .sp_menu_open span {
  &:nth-child(1) {
    transform: translateY(10px) rotate(45deg);
  }
  &:nth-child(2) {
    opacity: 0;
  }
  &:nth-child(3) {
    transform: translateY(-10px) rotate(-45deg);
  }
}
/* オーバーレイ背景 */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
  z-index: 2;
}
#sp_menu_toggle:checked ~ .overlay {
  opacity: 1;
  pointer-events: auto;
}
/* メニュー本体 */
.sp_menu {
  position: fixed;
  top: 0;
  right: -250px;
  width: 250px;
  height: 100%;
  background: #fff;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
  transition: right 0.3s ease;
  z-index: 3;
  & ul {
    padding: 60px 20px;
  }
  & li {
    width: 200px;
    margin: clamp(1vh, 2vh, 20px) 0;
    border-bottom: 1px solid #ccc;
  }
  & a {
    display: block;
    font-size: 1.25rem;
    margin: 10px 0;
    padding: clamp(1vh, 2vh, 20px) 25px;
    transition: color 0.3s;
    &:hover, &:active {
      color: #007bff;
      &::after {
        visibility: visible;
        width: 100%;
      }
    }
    &::after {
      content: '';
      width: 0;
      position: absolute;
      bottom: -11px;
      left: 0%;
      height: 2px;
      background: #007bff;
      transition: all 0.5s ease;
      transform: translateX(0%);
      visibility: hidden;
    }
  }
}
#sp_menu_toggle:checked ~ .sp_menu {
  right: 0;
}
/* 領域外クリックで閉じる設定 */
.sp_menu_hidden {
  display: none;
  &:checked ~ .sp_menu {
    right: 0;
  }
  &:checked ~ .sp_menu_close {
    display: block;
  }
}
.sp_menu_close {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
}