/* ============================================================
   ヘッダー ＋ グローバルナビ ＋ スマホドロワー
   ------------------------------------------------------------
   前提: base.css で --main / --sub / --dark / --cta / --navy が定義済み
   クラス名は hd- / dw- 接頭辞。他ページと衝突しません。
   ============================================================ */

:root {
  --hd-h: 70px;        /* ヘッダーの高さ（PC） */
  --hd-h-sp: 60px;     /* ヘッダーの高さ（スマホ） */
  --hd-break: 1024px;  /* ここより狭いとハンバーガーに切り替わる（実測982pxで6項目が収まるため） */

  /* ★ヘッダーが画面の上から何px下にいるか。
       ふだんは0ですが、ログイン中はWordPressの管理バーのぶんだけ下がります。
       ページの中で「ヘッダーの真下に貼りつく」ものは、
       この値を足さないと管理バーのぶんだけ潜ります。 */
  --hd-top: 0px;
}

/* ログイン中：管理バーの高さ（WordPressが決めている値） */
body.admin-bar { --hd-top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar { --hd-top: 46px; }
}

/* ヘッダーの下端の位置。ページ内の貼りつく要素はこれを top に使います */
:root { --hd-bottom: calc(var(--hd-h) + var(--hd-top)); }
@media (max-width: 768px) {
  :root { --hd-bottom: calc(var(--hd-h-sp) + var(--hd-top)); }
}

/* 本文がヘッダーに隠れないように */
body { padding-top: var(--hd-h); }

/* キーボード操作の人向け：Tabで最初に出る「本文へスキップ」 */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1200;
  background: var(--main); color: #fff; padding: 10px 18px;
  border-radius: 0 0 6px 6px; text-decoration: none;
  font-size: 13px; font-weight: 700;
  transition: top .18s;
}
.skip-link:focus { top: 0; }

/* ---------- ヘッダー本体 ---------- */
#site-header {
  position: fixed; top: var(--hd-top); left: 0; right: 0; z-index: 1000;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .08);
  height: var(--hd-h);
  transition: transform .34s cubic-bezier(.16, 1, .3, 1), opacity .24s ease;
}

/* ★ヒーローの上では引っ込みます（assets/js/sticky.js が付け外しします）
     トップページのヒーローは上が紙色なので、白いヘッダーが重なると
     ロゴと教室名が隠れてしまいます。スクロールすると降りてきます。
     JavaScriptが動かなければ、このクラスは付かない＝出たままです。 */
#site-header.is-hidden {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  #site-header { transition: none; }
}

.hd-inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.hd-logo { display: flex; align-items: center; flex-shrink: 0; }
.hd-logo img { height: 42px; width: auto; display: block; }

/* ---------- PCナビ ---------- */
.hd-nav { margin-left: auto; }
.hd-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 0; padding: 0;
}
.hd-nav a {
  position: relative;
  display: block;
  padding: 6px 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--dark);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}
.hd-nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--main);
  transform: scaleX(0); transform-origin: center;
  transition: transform .22s ease;
}
.hd-nav a:hover { color: var(--main); }
.hd-nav a:hover::after { transform: scaleX(1); }

/* 今いるページ */
.hd-nav a[aria-current="page"] { color: var(--main); }
.hd-nav a[aria-current="page"]::after { transform: scaleX(1); }

/* ---------- ヘッダーのLINEボタン ---------- */
.hd-cta {
  display: inline-flex; align-items: center; gap: 7px;
  flex-shrink: 0;
  background: var(--cta); color: #fff; text-decoration: none;
  padding: 10px 20px; border-radius: 50px;
  font-size: 13px; font-weight: 700; letter-spacing: .05em;
  transition: opacity .2s, transform .2s;
}
.hd-cta:hover { opacity: .9; transform: translateY(-1px); }
.hd-cta svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

/* ---------- ハンバーガー（PCでは非表示） ---------- */
.hd-toggle {
  display: none;
  width: 42px; height: 42px;
  margin-left: auto;
  border: 0; background: transparent; cursor: pointer;
  padding: 0;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.hd-bar {
  display: block; width: 22px; height: 2px;
  background: var(--dark); border-radius: 2px;
  transition: transform .26s ease, opacity .2s ease;
}
[aria-expanded="true"] .hd-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
[aria-expanded="true"] .hd-bar:nth-child(2) { opacity: 0; }
[aria-expanded="true"] .hd-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- ドロワー ---------- */
.hd-overlay {
  position: fixed; inset: 0; z-index: 1010;
  background: rgba(10, 26, 46, .5);
  opacity: 0; transition: opacity .28s ease;
}
.hd-overlay.is-open { opacity: 1; }

.hd-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1020;
  width: min(360px, 86vw);
  background: #fff;
  display: flex; flex-direction: column;
  padding: calc(var(--hd-h-sp) + 12px) 0 0;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.hd-drawer.is-open { transform: translateX(0); }

.hd-drawer-list { list-style: none; margin: 0; padding: 0; flex: 1; }
.hd-drawer-list li { border-bottom: 1px solid #eef2f5; }
.hd-drawer-list li:first-child { border-top: 1px solid #eef2f5; }
.hd-drawer-list a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 17px 24px;
  text-decoration: none;
  transition: background .18s;
}
.hd-drawer-list a:hover,
.hd-drawer-list a:focus-visible { background: #f4f9fd; }
.dw-label { font-size: 15px; font-weight: 700; color: var(--dark); }
.dw-en {
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  color: var(--main); opacity: .55; margin-left: auto;
}

.hd-drawer-foot {
  padding: 22px 24px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 16px;
  background: #f7fafc;
  border-top: 1px solid #eef2f5;
}
.dw-line {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--cta); color: #fff; text-decoration: none;
  padding: 14px 20px; border-radius: 50px;
  font-size: 14px; font-weight: 700; letter-spacing: .04em;
}
.dw-line svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; }
.dw-tel {
  text-align: center; text-decoration: none;
  color: var(--dark); font-size: 17px; font-weight: 700; letter-spacing: .04em;
}
.dw-tel em {
  display: block; font-style: normal;
  font-size: 11px; font-weight: 400; color: #7b8a97; margin-top: 3px;
}

/* ドロワーを開いている間、背後をスクロールさせない */
body.nav-open { overflow: hidden; }

/* ============================================================
   レスポンシブ
   ============================================================ */
@media (max-width: 1024px) {
  .hd-nav { display: none; }
  .hd-cta { display: none; }
  .hd-toggle { display: flex; }
}

@media (max-width: 768px) {
  body { padding-top: var(--hd-h-sp); }
  #site-header { height: var(--hd-h-sp); }
  .hd-inner { padding: 0 16px; gap: 16px; }
  .hd-logo img { height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .hd-drawer, .hd-overlay, .hd-bar, .hd-nav a::after { transition: none; }
  .hd-cta:hover { transform: none; }
}


/* ------------------------------------------------------------
 *  管理バーぶんのズレ
 * ------------------------------------------------------------
 *  ログイン中だけ、画面の上にWordPressの黒い管理バーが出ます。
 *  ヘッダーは position: fixed で top:0 に貼り付いているので、
 *  そのままだと管理バーの下に潜ってロゴが切れます。
 *  ログアウトしている訪問者には関係のないズレですが、
 *  自分でサイトを見るたびに気になるので直しておきます。
 *  （32px / 46px はWordPressが決めている管理バーの高さです）
 * ---------------------------------------------------------- */
/* （位置の指定は上の --hd-top に一本化しました） */


/* ドロワーの「いま開いているページ」 */
.hd-drawer a[aria-current="page"] .dw-label { color: var(--main); }
.hd-drawer a[aria-current="page"] .dw-en    { color: var(--main); opacity: .7; }
