/* 星カフェSPICA 全ページ共通ヘッダー（固定ヘッダー＋全面メニュー）。
   新LP（index.html）のヘッダーを切り出したもの。トップページ・下層ページの両方で読み込む。
   ・クラス名・id・変数は sh- 接頭辞。style.css（.navbar など）・lp.css（lp-）とは名前が重ならない。
   ・style.css の [class*="bar"] などの一括指定に巻き込まれないよう、クラス名に bar / wrap / container を含めない。
   ・ページ側の body の文字・色・リセットに頼らず、このファイルだけで見た目が決まるようにしている。
   ・ヘッダーの高さは --sh-h（初期値 52px）。トップページは lp.css で --sh-h: var(--hdr) を指定し、
     低い画面（.lp-xshort）では 48px になる。
   ・index.html では lp.css より前に読み込む（lp.css 側のトップページ専用の上書きを後勝ちにするため）。
   HTMLの書き方は docs/site-header/README.md を参照。 */

html { scroll-padding-top: calc(var(--sh-h, 52px) + env(safe-area-inset-top, 0px)); }
/* 下層ページ：style.css の旧ナビの高さ --nav-h（スマホ88px／PC72px）を新ヘッダーの高さに置き換える。
   例：gallery.html の main の上余白 calc(var(--nav-h) + 2rem)。新ヘッダーのあるページの body 以下だけに効く
   （旧ナビのままのページ・トップページには影響しない。:has() 非対応のブラウザでは従来の余白のまま） */
body:has(> .sh-hdr) { --nav-h: calc(var(--sh-h, 52px) + env(safe-area-inset-top, 0px)); }
/* メニューを開いている間は背面をスクロールさせない。PCではこれでスクロールバーが消えて表示幅が広がり、
   ページ全体（FV写真・各セクション・フッター）が横にずれるため、消えたスクロールバーと同じ幅（--sh-sbw、
   site-header.js が開く直前に実測）の右余白を足して、閉じているときと同じ幅を保つ。閉じると --sh-sbw が消えて 0 に戻る。
   スマホなどスクロールバーが幅を取らない環境では 0。
   固定表示のヘッダーは右端も同じ幅だけ内側に保ち、予約ボタン・メニューボタンが横に動かないようにする（メニュー本体の位置は変えない） */
html.sh-menu-open { overflow: hidden; padding-right: var(--sh-sbw, 0px); }
html.sh-menu-open .sh-hdr { right: var(--sh-sbw, 0px); }

.sh-hdr, .sh-menu {
  --sh-ink: #f4f1ea;
  --sh-ink-sub: rgba(244, 241, 234, .78);
  --sh-ink-mute: rgba(244, 241, 234, .62);
  --sh-gold: #f2c14e;
  --sh-gold-ink: #1a1408;
  --sh-line: rgba(244, 241, 234, .18);
  --sh-gutter: 20px;
  box-sizing: border-box;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  font-size: 15px; line-height: 1.8; text-align: left; color: var(--sh-ink);
  -webkit-font-smoothing: antialiased;
}
/* 内側のリセット。:where() で詳細度0にし、下の個別指定を必ず優先させる */
:where(.sh-hdr, .sh-menu) :where(*, *::before, *::after) { box-sizing: border-box; margin: 0; padding: 0; }
:where(.sh-hdr, .sh-menu) :where(a) { color: inherit; }
/* 文字色は「.sh-hdr / .sh-menu ＋ クラス ＋ a」で指定する。ページ側の a, a:link { color } や a:hover { opacity }
   （例：hoshimimadoka.html の head 内 <style>）より強くするため */
.sh-hdr a:hover, .sh-menu a:hover { opacity: 1; }
:where(.sh-menu) :where(ul) { list-style: none; }
.sh-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ================= 固定ヘッダー ================= */
.sh-hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 4000;
  height: calc(var(--sh-h, 52px) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 6px 0 16px;
  display: flex; align-items: center; gap: 8px;
  background: transparent; border-bottom: 1px solid transparent;
  transition: background-color .25s, border-color .25s;
}
/* スクロールしたら黒地（site-header.js が .sh-is-solid を付ける）。メニューを開いている間も黒地 */
.sh-hdr.sh-is-solid, .sh-menu-open .sh-hdr {
  background: rgba(0,0,0,.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom-color: rgba(255,255,255,.1);
}
.sh-hdr a.sh-brand { color: var(--sh-ink); }
.sh-brand { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 44px; margin-right: auto; text-decoration: none; }
.sh-brand img { display: block; height: 34px; width: auto; max-width: none; flex: none; filter: drop-shadow(0 1px 4px rgba(0,0,0,.6)); }
.sh-brand-name { font-size: 16px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; text-shadow: 0 1px 6px rgba(0,0,0,.7); }
.sh-hdr-nav { display: none; }
/* ヘッダーの予約ボタン：通常は金の枠線。.sh-cta-strong で金地（トップページはFVの予約ボタンが隠れたら、下層ページは常に） */
.sh-hdr-cta {
  display: flex; align-items: center; justify-content: center; flex: none;
  height: 44px; padding: 0 14px;
  border: 1.5px solid var(--sh-gold); border-radius: 10px;
  background: rgba(0,0,0,.35); color: var(--sh-gold);
  font-size: 14px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; text-decoration: none;
  transition: background-color .25s, color .25s;
}
.sh-hdr a.sh-hdr-cta { color: var(--sh-gold); }
.sh-hdr.sh-cta-strong a.sh-hdr-cta { background: var(--sh-gold); color: var(--sh-gold-ink); }
.sh-menu-btn {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: transparent; color: var(--sh-ink); cursor: pointer;
  display: grid; place-items: center;
}
.sh-menu-btn svg { display: block; width: 24px; height: 24px; }
.sh-menu-btn .sh-i-close { display: none; }
.sh-menu-btn[aria-expanded="true"] .sh-i-open { display: none; }
.sh-menu-btn[aria-expanded="true"] .sh-i-close { display: block; }
.sh-menu-btn:focus-visible, .sh-hdr-cta:focus-visible, .sh-menu a:focus-visible { outline: 2px solid var(--sh-gold); outline-offset: 2px; }
@media (max-width: 359px) { .sh-brand-name { display: none; } }

/* ================= メニュー：ヘッダーの下に全面で開く。アニメーションなし ================= */
.sh-menu {
  position: fixed; z-index: 3990; left: 0; right: 0; bottom: 0;
  top: calc(var(--sh-h, 52px) + env(safe-area-inset-top, 0px));
  background: #000; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px var(--sh-gutter) calc(env(safe-area-inset-bottom, 0px) + 28px);
}
.sh-menu[hidden] { display: none; }
.sh-menu:focus { outline: none; }
.sh-menu h2 { font-size: 12px; letter-spacing: .26em; color: var(--sh-gold); font-weight: 400; line-height: 1.8; margin: 18px 0 4px; }
.sh-menu li a {
  color: var(--sh-ink);
  display: flex; align-items: center; justify-content: space-between; min-height: 52px;
  font-size: 16px; font-weight: 400; letter-spacing: .06em; text-decoration: none; border-bottom: 1px solid var(--sh-line);
}
.sh-menu li a::after { content: "›"; color: var(--sh-ink-mute); font-size: 18px; }
/* 外部サイト：› の代わりに外部リンクのアイコン（文字の「外部サイト」は出さない。読み上げは .sh-vh の文で補う） */
.sh-menu li a[target="_blank"]::after { content: none; }
.sh-menu .sh-ext { flex: none; width: 16px; height: 16px; margin-left: auto; margin-right: 1px; color: var(--sh-ink-mute); }
/* いま開いているページ */
.sh-menu li a[aria-current="page"] { color: var(--sh-gold); }
.sh-menu li a[aria-current="page"]::after { color: var(--sh-gold); }
/* メニュー内の予約ボタン（黄色） */
.sh-menu a.sh-menu-cta { color: var(--sh-gold-ink); }
.sh-menu-cta {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; margin-top: 24px; border-radius: 12px;
  background: var(--sh-gold); color: var(--sh-gold-ink); text-decoration: none;
  font-size: 17px; font-weight: 700; letter-spacing: .06em;
}

/* ================= PC（900px以上） ================= */
@media (min-width: 900px) {
  .sh-hdr, .sh-menu { --sh-gutter: 40px; }
  .sh-hdr { padding-left: 28px; padding-right: 16px; gap: 12px; }
  .sh-hdr-nav { display: flex; gap: 2px; margin-right: 8px; }
  .sh-hdr .sh-hdr-nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 13px; letter-spacing: .08em; text-decoration: none; color: var(--sh-ink-sub); text-shadow: 0 1px 6px rgba(0,0,0,.7); }
  .sh-hdr .sh-hdr-nav a:hover { color: var(--sh-ink); }
  .sh-menu { left: auto; width: 420px; border-left: 1px solid var(--sh-line); }
}
