/*!
 * NavStow.js v0.1.0 — Sample CSS (Flex base)
 * カスタマイズのベースとしてお使いください
 * MIT License
 */

/* ══════════════════════════════════════
   メニュー本体
══════════════════════════════════════ */
.ns-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  z-index: 9999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 60px 24px 48px;
  box-sizing: border-box;
}

/* ══════════════════════════════════════
   各要素のラッパー
══════════════════════════════════════ */
.ns-wrap {
  margin-bottom: 24px;
}
.ns-wrap:last-child {
  margin-bottom: 0;
}

/* ── list-1col：メインnav向け ── */
/* ul/ol 構造
   !important でホスト側の display/flex 系プロパティ競合を確実に上書き。
   color・font-size・padding は上書き可にするため !important を使わない。 */
.ns-wrap-list-1col ul,
.ns-wrap-list-1col ol {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;  /* ホスト側 align-items:center を上書き */
  gap: 0 !important;                /* ホスト側 gap を上書き */
}
.ns-wrap-list-1col li {
  position: relative;
  display: block !important;        /* inline-block 等を上書き */
  width: 100% !important;           /* flex 子アイテムを横幅いっぱいに */
  box-sizing: border-box !important;
  border-bottom: 1px solid #eee;
}
/* div/span/a 直置き構造：コンテナをflexにする */
.ns-wrap-list-1col .ns-cloned:not(ul):not(ol) {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 0 !important;
}
/* div/span ラッパー → li 相当 */
.ns-wrap-list-1col .ns-cloned > div,
.ns-wrap-list-1col .ns-cloned > span {
  position: relative;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-bottom: 1px solid #eee;
}
/* a 直置き → li > a 相当 */
.ns-wrap-list-1col .ns-cloned > a {
  border-bottom: 1px solid #eee;
}
/* リンク共通（ul/li/div/span/a すべてに適用） */
.ns-wrap-list-1col a {
  display: block !important;        /* inline 等を上書き */
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 14px 40px 14px 0;
  text-decoration: none;
  color: inherit;
  font-size: 15px;
}

/* ── list-2col：サブリンク向け ── */
/* ul/ol 構造 */
.ns-wrap-list-2col ul,
.ns-wrap-list-2col ol {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 4px;
}
.ns-wrap-list-2col li {
  width: calc(50% - 2px) !important;
  box-sizing: border-box !important;
  position: relative;
}
/* div/span/a 直置き構造：コンテナをflexにする */
.ns-wrap-list-2col .ns-cloned:not(ul):not(ol) {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 4px;
}
/* div/span ラッパー → li 相当 */
.ns-wrap-list-2col .ns-cloned > div,
.ns-wrap-list-2col .ns-cloned > span {
  width: calc(50% - 2px) !important;
  box-sizing: border-box !important;
  position: relative;
}
/* a 直置き → 50%幅 */
.ns-wrap-list-2col .ns-cloned > a {
  width: calc(50% - 2px) !important;
  box-sizing: border-box !important;
}
/* リンク共通（ul/li/div/span/a すべてに適用） */
.ns-wrap-list-2col a {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 8px 10px;
  font-size: 12px;
  text-decoration: none;
  color: #666;
  background: #f5f5f5;
  border-radius: 4px;
}
.ns-wrap-list-2col a:hover {
  background: #eee;
}

/* ── links：フラット構造向け（div/span/a 直置きなど） ── */
/*
  対応パターン：
    <div><a>リンク</a></div>
    <span><a>リンク</a></span>
    <a>リンク</a>
*/
.ns-wrap-links {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 0 !important;
}
/* div・span ラッパーをブロックに */
.ns-wrap-links > div,
.ns-wrap-links > span {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
/* リンク本体のスタイル */
.ns-wrap-links a {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 14px 0;
  text-decoration: none;
  color: inherit;
  font-size: 15px;
}
/* 区切り線：div・span・a の直下要素すべてに */
.ns-wrap-links > div,
.ns-wrap-links > span,
.ns-wrap-links > a {
  border-bottom: 1px solid #eee;
}

/* ── button：CTAボタン向け ── */
.ns-wrap-button {
  display: flex;
  justify-content: center;
  padding: 16px 0 0;
}

/* ══════════════════════════════════════
   ドロップダウン
══════════════════════════════════════ */
.ns-has-dropdown {
  position: relative;
}

.ns-dropdown {
  padding: 4px 0 8px 16px;
  list-style: none;
  margin: 0;
}
/* .ns-wrap-list-1col ul (詳細度 0-1-1) に勝つため .ns-wrap を親に付けて 0-2-0 に */
.ns-wrap .ns-dropdown {
  display: none;
}
.ns-wrap .ns-dropdown.ns-dropdown-open {
  display: block;
}
.ns-dropdown a {
  padding: 10px 0;
  font-size: 13px;
  color: #666;
  border-bottom: 1px solid #f0f0f0;
}

.ns-dropdown-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 48px;
  width: 44px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ns-dropdown-arrow {
  display: block;
  width: 8px;
  height: 8px;
  border-right: 2px solid #999;
  border-bottom: 2px solid #999;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -4px;
}
.ns-dropdown-toggle[aria-expanded="true"] .ns-dropdown-arrow {
  transform: rotate(-135deg);
  margin-top: 4px;
}

/* ══════════════════════════════════════
   ハンバーガーボタン
══════════════════════════════════════ */
.ns-button {
  background: #333;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.ns-button:focus-visible {
  outline: 2px solid #4a9eff;
  outline-offset: 2px;
}

/* fixed: true（デフォルト）— 常に画面に固定 */
.ns-button-fixed {
  position: fixed;
  z-index: 10000;
}

/* fixed: false — スクロールで流れる（position: absolute） */
.ns-button:not(.ns-button-fixed) {
  position: absolute;
  z-index: 100;
}

/* ポジション */
.ns-btn-right.ns-btn-top    { top: 16px; right: 16px; }
.ns-btn-left.ns-btn-top     { top: 16px; left: 16px; }
.ns-btn-right.ns-btn-bottom { bottom: 16px; right: 16px; }
.ns-btn-left.ns-btn-bottom  { bottom: 16px; left: 16px; }

/* 3本線 */
.ns-button-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center center;
}

/* ── cross アニメーション（デフォルト）── */
.ns-button-anim-cross.ns-open .ns-bar-1 {
  transform: translateY(7px) rotate(45deg);
}
.ns-button-anim-cross.ns-open .ns-bar-2 {
  opacity: 0;
  transform: scaleX(0);
}
.ns-button-anim-cross.ns-open .ns-bar-3 {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── spin アニメーション ── */
.ns-button-anim-spin .ns-button-bar {
  transition: transform 0.4s ease, opacity 0.2s ease;
}
.ns-button-anim-spin.ns-open .ns-bar-1 {
  transform: translateY(7px) rotate(135deg);
}
.ns-button-anim-spin.ns-open .ns-bar-2 {
  opacity: 0;
}
.ns-button-anim-spin.ns-open .ns-bar-3 {
  transform: translateY(-7px) rotate(-135deg);
}

/* ── arrow アニメーション ── */
.ns-button-anim-arrow.ns-open .ns-bar-1 {
  transform: translateY(4px) translateX(-4px) rotate(-45deg) scaleX(0.6);
}
.ns-button-anim-arrow.ns-open .ns-bar-2 {
  transform: scaleX(0.9);
}
.ns-button-anim-arrow.ns-open .ns-bar-3 {
  transform: translateY(-4px) translateX(-4px) rotate(45deg) scaleX(0.6);
}

/* ══════════════════════════════════════
   オーバーレイ
══════════════════════════════════════ */
.ns-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}
.ns-overlay.ns-overlay-show {
  display: block;
}

/* ══════════════════════════════════════
   bodyスクロール制御
══════════════════════════════════════ */
body.ns-menu-open {
  overflow: hidden;
}
