
/*
 * TOPCOURT Navigation
 * 共通ドロワーメニュー
 */

.p-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(350px, 100vw);
  height: 100dvh;
  background: #08465d;
  color: #fff;
  z-index: 10001;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .3s ease, visibility .3s;
}

body.show-drawer .p-drawer {
  transform: translateX(0);
  visibility: visible;
}

.p-drawer-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 10000;
  transition: opacity .3s ease;
}

body.show-drawer .p-drawer-bg {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 閉じるボタン */
.p-drawer .p-drawer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
}

.p-drawer .p-drawer-close::before,
.p-drawer .p-drawer-close::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 19px;
  width: 16px;
  height: 2px;
  background: #fff;
}

.p-drawer .p-drawer-close::before {
  transform: rotate(45deg);
}

.p-drawer .p-drawer-close::after {
  transform: rotate(-45deg);
}

/* メニュー */
.p-drawer-nav {
  list-style: none;
  margin: 0;
  padding: 38px 20px 20px;
}

.p-drawer-nav > .menu-item {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-drawer-nav > .menu-item > a {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 12px 0;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
}

/* サブメニュー矢印 */
.p-drawer-nav .js-drawer-toggle {
  display: inline-block;
  visibility: visible;
  position: relative;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin-left: auto;
  cursor: pointer;
}

.p-drawer-nav .js-drawer-toggle::after {
  content: "";
  position: absolute;
  top: 9px;
  left: 9px;
  width: 8px;
  height: 8px;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  transform: rotate(45deg);
}

.p-drawer-nav .is-open > a .js-drawer-toggle::after {
  transform: rotate(225deg);
  top: 13px;
}


/* サブメニュー：高さアニメーション */
.p-drawer-nav > .menu-item-has-children > .p-drawer-nav__submenu,
.p-drawer-nav > .menu-item-has-children > .js-drawer-submenu {
  display: block;
  visibility: visible;

  height: 0;
  overflow: hidden;

  margin: 0 -20px;
  padding: 0;
  width: calc(100% + 40px);

  background: #245b70;
  list-style: none;

  transition: height 300ms cubic-bezier(.17,.84,.44,1);
}

/* サブメニュー項目 */
.p-drawer-nav__submenu > li,
.js-drawer-submenu > li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-drawer-nav__submenu a,
.js-drawer-submenu a {
  display: block;
  padding: 15px 20px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none;
}

.p-drawer a:hover {
  opacity: .85;
}


/* 共通ヘッダーロゴ */
#js-header .p-header-logo,
#js-header .c-logo {
  width: auto;
  height: 60px;
  display: flex;
  align-items: center;
}

#js-header .c-logo__image {
  display: block;
  width: auto;
  height: 32px;
  max-height: 32px;
  max-width: 100%;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .p-drawer,
  .p-drawer-bg,
  .p-drawer-nav__submenu {
    transition: none;
  }
}
