/*
 * サイト共通ヘッダー(backtest/scripts/site_header.mjs が出力する HTML 用)
 * 各ページのスタイルに影響されないよう .sh 配下だけを指定する。
 */
.sh {
  --sh-bg: #1b2538;
  --sh-bg-2: #141c2b;
  --sh-fg: #ffffff;
  --sh-muted: #c3cde0;
  --sh-red: #ff6b6f;
  position: relative;
  z-index: 50;
  background: var(--sh-bg);
  color: var(--sh-fg);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", system-ui, sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
.sh *, .sh *::before, .sh *::after { box-sizing: border-box; }
.sh a { text-decoration: none; }

.sh-bar {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 22px; min-height: 56px;
}
.sh-logo { color: var(--sh-fg); font-weight: 800; font-size: 19px; letter-spacing: .01em; white-space: nowrap; }
.sh-logo span { color: var(--sh-red); }
.sh-logo:hover { color: var(--sh-fg); }

.sh-nav { display: flex; align-items: center; gap: 4px 20px; margin-left: auto; }
.sh-nav a {
  color: var(--sh-muted); font-size: 14px; font-weight: 700; white-space: nowrap;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.sh-nav a:hover { color: var(--sh-fg); }
.sh-nav a[aria-current="page"] { color: var(--sh-fg); border-bottom-color: var(--sh-red); }

/* ☰ ドロワー(JS不要の <details>) */
.sh-more { flex: none; }
.sh-more > summary {
  list-style: none; cursor: pointer; width: 40px; height: 40px; margin-right: -8px;
  display: flex; align-items: center; justify-content: center; border-radius: 8px;
}
.sh-more > summary::-webkit-details-marker { display: none; }
.sh-more > summary:hover { background: rgba(255,255,255,.08); }
.sh-more > summary:focus-visible { outline: 2px solid var(--sh-red); outline-offset: 2px; }
.sh-burger, .sh-burger::before, .sh-burger::after {
  display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--sh-fg); position: relative; transition: .15s;
}
.sh-burger::before, .sh-burger::after { content: ""; position: absolute; left: 0; }
.sh-burger::before { top: -6px; } .sh-burger::after { top: 6px; }
.sh-more[open] .sh-burger { background: transparent; }
.sh-more[open] .sh-burger::before { top: 0; transform: rotate(45deg); }
.sh-more[open] .sh-burger::after { top: 0; transform: rotate(-45deg); }
/* 開いている間は画面全体を覆う背景(押すと閉じる: summary の一部なので) */
.sh-more[open] > summary::after {
  content: ""; position: fixed; inset: 0; background: rgba(10,14,21,.45); z-index: 60; cursor: default;
}
.sh-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: min(300px, 82vw); overflow-y: auto; padding: 64px 20px 28px;
  background: #fff; color: #1b2538; box-shadow: -8px 0 24px rgba(0,0,0,.25);
}
.sh-close {
  position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 8px;
  background: #f1f3f7; color: #1b2538; font-size: 22px; line-height: 1; cursor: pointer;
}
.sh-close:hover { background: #e3e8f0; }
.sh-drawer .sh-group { margin: 16px 0 2px; font-size: 12px; font-weight: 700; color: #7a8496; letter-spacing: .04em; }
.sh-drawer .sh-group:first-child { margin-top: 0; }
.sh-drawer a {
  display: block; padding: 11px 0; border-bottom: 1px solid #eef1f5;
  color: #1b2538; font-size: 15px; font-weight: 700;
}
.sh-drawer a:hover { color: #2f6fdb; }

/* パンくず */
.sh-bc { background: var(--sh-bg-2); }
.sh-bc ol {
  list-style: none; margin: 0 auto; max-width: 1180px; padding: 7px 20px;
  display: flex; flex-wrap: wrap; gap: 2px 0; font-size: 12.5px; color: var(--sh-muted);
}
.sh-bc li { display: inline-flex; align-items: center; min-width: 0; }
.sh-bc li + li::before { content: "›"; margin: 0 8px; opacity: .6; }
.sh-bc a { color: #9fc0ff; }
.sh-bc a:hover { text-decoration: underline; }
.sh-bc [aria-current="page"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }

/* スマホ: ロゴ+☰ の1段目、メニューは横スクロールの2段目 */
@media (max-width: 760px) {
  .sh-bar { flex-wrap: wrap; gap: 0 12px; padding: 0 14px; min-height: 0; }
  .sh-logo { padding: 12px 0; font-size: 18px; }
  .sh-more { margin-left: auto; }
  .sh-nav {
    order: 3; flex-basis: calc(100% + 28px); margin: 0 -14px; padding: 0 10px 8px;
    gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .sh-nav::-webkit-scrollbar { display: none; }
  .sh-nav a { font-size: 13px; padding: 6px 11px; border: 0; border-radius: 999px; }
  .sh-nav a[aria-current="page"] { background: #fff; color: var(--sh-bg); }
  .sh-bc ol { padding: 6px 14px; font-size: 12px; }
}
