:root {
  --hb-nav-bg: #1A2332;
  --hb-nav-height: 56px;
  --hb-menu-width: 220px;
  --hb-duration: 0.3s;
  --hb-overlay-bg: rgba(0, 0, 0, 0.45);
}

/* ===== デモコンテナ上書き ===== */
/* グローバルCSSのflex指定を上書きして縦積みレイアウトにする */
.demo-container {
  display: block;
  padding: 0;
  overflow: hidden;
  min-height: 320px;
  position: relative;
  background: #F4F6F9;
}

/* ===== ナビゲーションバー ===== */
/* ナビバーは overlay(z:3)・panel(z:4) より上に配置してボタンを常に操作可能にする */
.hb-nav {
  position: relative;
  z-index: 5;
  background: var(--hb-nav-bg);
}

.hb-nav__bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--hb-nav-height);
  padding: 0 20px;
}

.hb-nav__logo {
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

/* ===== ハンバーガーボタン ===== */
.hb-nav__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s;
}

.hb-nav__toggle:hover { background: rgba(255, 255, 255, 0.1); }

.hb-nav__line {
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--hb-duration) ease, opacity var(--hb-duration) ease;
  transform-origin: center;
}

/* 開いているとき: 3本線を × に変形 */
.hb-nav__toggle[aria-expanded="true"] .hb-nav__line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hb-nav__toggle[aria-expanded="true"] .hb-nav__line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hb-nav__toggle[aria-expanded="true"] .hb-nav__line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== デモ本文エリア ===== */
.hb-demo-body {
  padding: 32px 24px;
  font-size: 14px;
  line-height: 1.7;
  color: #5A6A7A;
}

.hb-demo-hint {
  font-size: 15px;
  font-weight: 600;
  color: #1A2332;
  margin: 0 0 8px;
}

/* ===== オーバーレイ（背景暗幕） ===== */
/* display: none だと transition が効かないため visibility + opacity で制御する */
/* ※ デモ内スコープのため position: absolute を使用。実際のサイトでは position: fixed */
.hb-overlay {
  position: absolute;
  inset: 0;
  background: var(--hb-overlay-bg);
  z-index: 3;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--hb-duration) ease, visibility var(--hb-duration) ease;
}

.hb-overlay.is-open {
  visibility: visible;
  opacity: 1;
}

/* ===== メニューパネル ===== */
/* ※ デモ内スコープのため position: absolute を使用。実際のサイトでは position: fixed */
.hb-menu {
  position: absolute;
  top: var(--hb-nav-height); /* ナビバーの下から開始 */
  right: 0;
  height: calc(100% - var(--hb-nav-height));
  width: var(--hb-menu-width);
  background: #fff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 4;
  transform: translateX(100%); /* 初期状態: 右外に待機 */
  transition: transform var(--hb-duration) ease;
  overflow-y: auto;
}

.hb-menu.is-open {
  transform: translateX(0); /* スライドイン */
}

/* ===== メニューリスト ===== */
.hb-menu__list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.hb-menu__item {
  display: block;
  padding: 14px 24px;
  color: #1A2332;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid #F0F4F8;
  transition: background 0.15s, color 0.15s;
}

.hb-menu__item:hover {
  background: #F4F6F9;
  color: #2B7FE8;
}
