/* VISION24 | header-footer.css — 全ページ共通のヘッダー／フッター
   ──────────────────────────────────────────────────────────────
   【サイズ方針】
   ページ側の rem 基準（top-v2 は 1rem=16px、旧 top / style は ≒10px、24h は 15px）に左右されないよう、
   ヘッダー／フッター配下の文字・余白はすべて px で固定する。
   クラス（BEM）:
     .site-header / .site-header__* / .nav-dropdown / .nav-dropdown__*
     .site-footer / .site-footer__*
   ────────────────────────────────────────────────────────────── */

/* ── 共通トークン（このファイル内のみ。ページの :root rem に依存しない） ──
   .page-top-btn は footer の外にあるため、色トークンが届くようここに含める */
.site-header,
.site-footer,
.page-top-btn {
  --hf-font: Roboto, "Noto Sans JP", system-ui, sans-serif;
  /* PC 基準（SP は max-width:900px で下書き戻し） */
  --hf-nav-size: 16px;
  --hf-store-size: 16px;
  --hf-cta-size: 16px;
  --hf-footer-size: 16px;
  --hf-footer-sub-size: 16px;
  --hf-arrow-size: 16px;
  --hf-pad-x: 20px;
  --hf-maxw: 1400px;
  --hf-ink-white: #FFFFFF;
  --hf-ink-black: #0C0C0C;
  --hf-ink-yellow: #FEE801;
  --hf-ink-line: #E0E0E0;
  --hf-ink-accent: #FEE801;
  --hf-fill-white: #FFFFFF;
  --hf-fill-black: #0C0C0C;
  --hf-fill-yellow: #FEE801;
  --hf-bg-lightgray: #F0F0F0;
  --hf-r-sm: 6px;

  font-family: var(--hf-font);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* テーマ色があるページはアクセントだけ継承（サイズは px 固定のまま） */
body.gym-24h .site-header,
body.gym-24h .site-footer {
  --hf-ink-accent: var(--ink-accent, #FEE801);
}

.site-header .container {
  max-width: var(--hf-maxw);
  margin-inline: auto;
  padding-inline: var(--hf-pad-x);
  box-sizing: border-box;
  width: 100%;
}

.site-footer .container {
  max-width: var(--hf-maxw);
  margin-inline: auto;
  padding-inline: var(--hf-pad-x);
  box-sizing: border-box;
  width: 100%;
}

/* ══════════════════════════════════════════════════════════
   ヘッダー
   ══════════════════════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  /* 旧トップ同様の初期：透過黒 → スクロール後に is-solid で白 */
  background: rgba(0, 0, 0, .75);
  transition: background-color .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  font-size: 16px; /* em 用の基準。子要素の文字サイズは px 指定 */
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-height: 72px;
  /* common.css の rem 指定（トップ用 1rem≒10px 前提）を打ち消す */
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ── ブランド（ロゴ＋店舗名） ── */
.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--hf-ink-white);
}

.site-header__logo-img {
  height: 48px;
  width: auto;
  display: block;
  transition: height .3s ease;
}

.site-header.is-solid .site-header__logo-img {
  content: url("/wp-content/themes/my-custom-theme/assets/images/24h/common/logo-black.svg");
}

.site-header__store {
  font-size: var(--hf-store-size);
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: .02em;
  color: inherit;
  display: inline;
}

/* ── 店舗名の出し分け ── */
.site-header__store-name {
  display: none;
  font-size: var(--hf-store-size);
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

.site-header__store-name--all {
  display: inline;
}

body.store--hirao .site-header__store-name--all,
body.store--ropponmatsu .site-header__store-name--all,
body.store--corporate .site-header__store-name--all {
  display: none;
}

body.store--hirao .site-header__store-name--hirao,
body.store--ropponmatsu .site-header__store-name--ropponmatsu,
body.store--corporate .site-header__store-name--corporate {
  display: inline;
}

/* ── ナビ ── */
.site-header__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-header__nav-link {
  text-decoration: none;
  color: var(--hf-ink-white);
  font-size: var(--hf-nav-size);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.4;
  white-space: nowrap;
  transition: color .3s ease;
}

.site-header__cta,
.site-header .btn.site-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  font-size: var(--hf-cta-size);
  font-weight: 900;
  font-family: var(--hf-font);
  line-height: 1.3;
  color: var(--hf-ink-black);
  background: var(--hf-fill-yellow);
  border: 2px solid var(--hf-ink-yellow);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}

/* ── スクロール後（白背景化） ── */
.site-header.is-solid {
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hf-ink-line);
}

/* 文字色：common.css の `header span` / `a{color:inherit}` / body.top-v2 の白文字継承を打ち消す */
.site-header.is-solid,
.site-header.is-solid .site-header__brand,
.site-header.is-solid .site-header__store,
.site-header.is-solid .site-header__store-name,
.site-header.is-solid .site-header__nav-link,
.site-header.is-solid .nav-dropdown__trigger,
.site-header.is-solid span {
  color: var(--hf-ink-black);
}

.site-header.is-solid .site-header__nav-link:hover,
.site-header.is-solid .nav-dropdown__trigger:hover {
  color: var(--hf-ink-accent);
}

.site-header.is-solid .site-header__cta {
  color: var(--hf-ink-black);
}

/* ── 常時ソリッド（明るいページ）
   ※ 法務（privacy / company / 特商法）はトップと同じ：
     fixed + 透過黒 → スクロールで is-solid（白） ── */
.site-header--static,
body.page-hirao-personal-gym .site-header,
body.page-ropponmatsu-personal-gym .site-header,
body.page-hirao-access .site-header,
body.page-ropponmatsu-access .site-header,
body.v24-thanks-page .site-header,
body.v24-coming-soon-page .site-header {
  position: static;
  background: var(--hf-fill-white);
  border-bottom: 1px solid var(--hf-ink-line);
}

.site-header--static .site-header__brand,
.site-header--static .site-header__nav-link,
.site-header--static .nav-dropdown__trigger,
body.page-hirao-personal-gym .site-header__brand,
body.page-hirao-personal-gym .site-header__nav-link,
body.page-hirao-personal-gym .nav-dropdown__trigger,
body.page-ropponmatsu-personal-gym .site-header__brand,
body.page-ropponmatsu-personal-gym .site-header__nav-link,
body.page-ropponmatsu-personal-gym .nav-dropdown__trigger,
body.page-hirao-access .site-header__brand,
body.page-hirao-access .site-header__nav-link,
body.page-hirao-access .nav-dropdown__trigger,
body.page-ropponmatsu-access .site-header__brand,
body.page-ropponmatsu-access .site-header__nav-link,
body.page-ropponmatsu-access .nav-dropdown__trigger,
body.v24-thanks-page .site-header__brand,
body.v24-thanks-page .site-header__nav-link,
body.v24-thanks-page .nav-dropdown__trigger,
body.v24-coming-soon-page .site-header__brand,
body.v24-coming-soon-page .site-header__nav-link,
body.v24-coming-soon-page .nav-dropdown__trigger {
  color: var(--hf-ink-black);
}

.site-header--static .site-header__logo-img,
body.page-hirao-personal-gym .site-header__logo-img,
body.page-ropponmatsu-personal-gym .site-header__logo-img,
body.page-hirao-access .site-header__logo-img,
body.page-ropponmatsu-access .site-header__logo-img,
body.v24-thanks-page .site-header__logo-img,
body.v24-coming-soon-page .site-header__logo-img {
  content: url("/wp-content/themes/my-custom-theme/assets/images/24h/common/logo-black.svg");
}

/* ══════════════════════════════════════════════════════════
   ドロップダウン
   ══════════════════════════════════════════════════════════ */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown__trigger {
  background: none;
  border: none;
  color: var(--hf-ink-white);
  font-family: var(--hf-font);
  font-size: var(--hf-nav-size);
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.4;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: color .3s ease;
}

.nav-dropdown__arrow {
  font-size: var(--hf-arrow-size);
  transition: transform .3s ease;
}

.nav-dropdown__menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--hf-fill-white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  min-width: 168px;
  border-radius: var(--hf-r-sm);
  padding: 8px 0;
  margin-top: 10px;
  z-index: 100;
}

.nav-dropdown__menu a {
  display: block;
  padding: 10px 20px;
  color: var(--hf-ink-black);
  text-decoration: none;
  text-align: center;
  font-size: var(--hf-nav-size);
  font-weight: 700;
  line-height: 1.4;
  transition: background-color .2s ease, color .2s ease;
}

.nav-dropdown__menu a:hover {
  background-image: linear-gradient(rgba(0, 0, 0, .04), rgba(0, 0, 0, .04));
  color: var(--hf-ink-accent);
}

.nav-dropdown.is-active .nav-dropdown__menu {
  display: block;
}

.nav-dropdown.is-active .nav-dropdown__arrow {
  transform: rotate(180deg);
}

/* ══════════════════════════════════════════════════════════
   ハンバーガー（SPのみ表示）
   ══════════════════════════════════════════════════════════ */
.site-header__menu-btn {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
}

.site-header__menu-bar {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 2px;
  background: var(--hf-ink-white);
  transition: transform .3s ease, opacity .2s ease, background-color .3s ease;
}

.site-header__menu-bar:nth-child(1) { top: 15px; }
.site-header__menu-bar:nth-child(2) { top: 21px; }
.site-header__menu-bar:nth-child(3) { top: 27px; }

.site-header.is-solid .site-header__menu-bar,
.site-header--static .site-header__menu-bar,
.site-header.is-nav-open .site-header__menu-bar,
body.page-hirao-personal-gym .site-header__menu-bar,
body.page-ropponmatsu-personal-gym .site-header__menu-bar,
body.page-hirao-access .site-header__menu-bar,
body.page-ropponmatsu-access .site-header__menu-bar,
body.v24-thanks-page .site-header__menu-bar,
body.v24-coming-soon-page .site-header__menu-bar {
  background: var(--hf-ink-black);
}

.site-header.is-nav-open .site-header__menu-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header.is-nav-open .site-header__menu-bar:nth-child(2) {
  opacity: 0;
}

.site-header.is-nav-open .site-header__menu-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ══════════════════════════════════════════════════════════
   SPレイアウト
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .site-header {
    /* バー上の店舗名のみ縮小。ハンバーガー内（ナビ／CTA）は 16px のまま */
    --hf-store-size: 9px;
  }

  .site-footer {
    --hf-footer-size: 12px;
    --hf-footer-sub-size: 11px;
  }

  .site-header__inner {
    min-height: 60px;
  }

  .site-header__logo-img {
    height: 36px;
  }

  .site-header__menu-btn {
    display: block;
  }

  .site-header__nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(255, 255, 255, .98);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--hf-ink-line);
    display: none;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .site-header.is-nav-open .site-header__nav {
    display: flex;
  }

  .site-header__nav-link {
    padding: 16px var(--hf-pad-x);
    border-top: 1px solid var(--hf-ink-line);
    color: var(--hf-ink-black);
    white-space: normal;
  }

  .site-header__cta,
  .site-header .btn.site-header__cta {
    margin: 14px var(--hf-pad-x);
  }

  .nav-dropdown {
    display: block;
    width: 100%;
    border-top: 1px solid var(--hf-ink-line);
  }

  .nav-dropdown__trigger {
    width: 100%;
    justify-content: space-between;
    padding: 16px var(--hf-pad-x);
    color: var(--hf-ink-black);
  }

  .nav-dropdown__menu {
    position: static;
    transform: none;
    box-shadow: none;
    width: 100%;
    padding: 0;
    border-radius: 0;
    margin-top: 0;
    background-color: var(--hf-bg-lightgray);
  }

  .nav-dropdown__menu a {
    padding: 14px 36px;
    text-align: left;
    border-top: 1px solid rgba(0, 0, 0, .05);
  }
}

body.is-nav-locked {
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════
   フッター
   ══════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--hf-fill-black);
  color: rgba(255, 255, 255, .68);
  font-size: var(--hf-footer-size);
}

.site-footer .container {
  padding-block: 66px;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px 44px;
}

.site-footer strong {
  color: var(--hf-ink-white);
  font-weight: 900;
  font-size: var(--hf-footer-size);
}

.site-footer__nap {
  font-style: normal;
  font-size: var(--hf-footer-size);
  line-height: 1.7;
}

.site-footer__nap a {
  color: rgba(255, 255, 255, .68);
  text-decoration: none;
  font-size: inherit;
}

.site-footer__nap a:hover {
  color: var(--hf-ink-yellow);
}

.site-footer__links,
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 0;
  margin: 0 0 16px;
  list-style: none;
}

.site-footer__links a,
.site-footer__legal a {
  text-decoration: none;
  color: rgba(255, 255, 255, .68);
  font-weight: 700;
  font-size: var(--hf-footer-size);
  line-height: 1.4;
}

.site-footer__links a:hover,
.site-footer__legal a:hover {
  color: var(--hf-ink-yellow);
}

.site-footer__legal {
  margin-bottom: 0;
}

.site-footer__legal a {
  font-size: var(--hf-footer-sub-size);
}

.site-footer__copy {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  color: rgba(255, 255, 255, .42);
  font-size: var(--hf-footer-sub-size);
}

@media (max-width: 767px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
}

/* ページトップへ戻る */
.page-top-btn {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 50px;
  height: 50px;
  background-color: var(--hf-fill-yellow);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, background-color 0.3s ease;
  text-decoration: none;
}

.page-top-btn::after {
  content: "";
  width: 10px;
  height: 10px;
  border-top: 3px solid var(--hf-ink-black);
  border-right: 3px solid var(--hf-ink-black);
  transform: rotate(-45deg);
  margin-top: 4px;
}

@media (hover: hover) {
  .page-top-btn:hover {
    transform: translateY(-5px);
    background-image: linear-gradient(rgba(0, 0, 0, .10), rgba(0, 0, 0, .10));
  }
}
