.works-section img {
  width: 100%;
}

/* サイドメニュー */
.works-section .sidebar {
  align-self: start;
  background: var(--color-white);
  flex-shrink: 0;
  max-height:calc(100vh - 40px);
  overflow: auto;
  position: sticky;
  top: 20px;
}
.works-section .menu-title {
  background: var(--color-dark-green);
  color: var(--color-white);
  font-weight: bold;
  padding: 14px 16px;
  text-align: center;
}

/* メニュー（共通） */
.works-section .menu {
  list-style: none;
  margin: 0;
}
.works-section .menu li {
  border-top: 1px dashed var(--color-border-light);
}
.works-section .menu li:first-child {
  border-top: none;
}

.works-section .row {
  align-items: center;
  background: var(--color-green);
  border: 0;
  color: var(--color-white);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  text-decoration: none;
  text-align: left;
  transition: background .18s ease;
  width: 100%;
}

.works-section .plus {
  display: inline-block;
  min-width: 1.1em;
  text-align: center;
  color: var(--color-white);
  padding: 2px 6px;
  font-size: 1rem;
  transition: transform .18s ease, background .18s ease;
}

/* --- サブメニュー：スライド開閉（display: none を使わない） --- */

.works-section .submenu {
  list-style: none;
  margin: 0;
  background: var(--color-white);
  overflow: hidden;
  max-height: 0;                 /* ← 高さ0から */
  opacity: 0;                    /* ← フェード */
  transform: translateY(-4px);   /* ← ちょい上から */
  transition:
    max-height .28s ease,
    opacity .20s ease,
    transform .28s ease;
  border-top:0;
}
.works-section .submenu a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--color-text);
  border-top: 1px dashed var(--color-border-light);
}
.works-section .submenu a:first-child {
  border-top: none;
}
.works-section .submenu a:hover{
  color: var(--color-primary);
}
.works-section .submenu a.active{
  color: var(--color-primary);
}

/* 開いた状態 */
.works-section .has-children.open > .submenu {
  max-height: 560px; /* ← 目安上限まで伸ばす */
  opacity: 1;
  transform: translateY(0);
}
.works-section .has-children.open > .toggle .plus {
  transform: rotate(180deg);      /* ← ＋が少し回転して“開いた”雰囲気に */
}



/* モバイル：下固定ナビ */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: var(--color-dark-green);
  color: var(--color-white);
}
.bottom-nav .bar {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.2);
}
.bottom-toggle {
  align-items: center;
  background: transparent;
  color: var(--color-white);
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
}
.bottom-toggle span:first-child {
  opacity: 0;
}

/* パネルをスライド開閉（高さ+フェード） */
.bottom-nav .panel {
  background: var(--color-white);
  max-height: 0;
  overflow: scroll;
  opacity: 0;
  transition: max-height .25s ease, opacity .18s ease;
}
.bottom-nav[aria-expanded="true"] .panel {
  opacity: 1; /* 高さは JS が maxHeight を指定済み（滑らかに開閉） */
}

.bottom-nav .has-children .toggle .plus {
  display: block;
  text-align: center;
  width: 30px;
}
.bottom-nav .has-children .toggle .plus::after {
  content: '＋';
}
.bottom-nav .has-children.open .toggle .plus::after {
  content: '−';
}

/* レスポンシブ切替 */
@media screen and (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .bottom-nav {
    display: block;
    z-index: 1;
  }
}
