/* MIEKATA 共通ヘッダー（全ページ。2026-10-23 吉田さんの改修指示書 A5）
   - AIKATA のヘッダー（public/aikata-lish/sections/header.css）と同じ形・同じ寸法。色だけ MIEKATA の変数
   - AIKATA の CSS は読み込まない（AIKATA を直したときに MIEKATA が崩れないように）。class は mhd- で始める
   - 中身は src/components/Miekata/generated/pages/*.ts の header.mhd（scripts/miekata-shell-2026-10-23.py が入れる）
   - 古い CSS（site.css・navigation108.css など）に負けないよう、:is(#mhd×6, *) で強くする
   - 高さはスクロールしても変えない。帯になるときは transform で上へ寄せる（下の中身が動かないように） */

:root {
  --mhd-ink: #1b1e2b;
  --mhd-sub: var(--ds-sub, #4b5375);
  --mhd-blue: var(--ds-blue, #2448d8);
  --mhd-cta: var(--ds-cta, #bf5139);
  --mhd-cta-hover: var(--ds-cta-dk, #a8452f);
  --mhd-rule: #d5dae3;
  --mhd-white: #fff;
  --mhd-ease: cubic-bezier(.43, .05, .17, 1);
}

html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd {
  --hd-h: 72px;
  --hd-gap: 14px;
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  display: flex !important;
  align-items: center !important;
  gap: 24px !important;
  box-sizing: border-box !important;
  width: auto !important;
  max-width: none !important;
  height: calc(var(--hd-h) + var(--hd-gap) * 2) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: var(--hd-gap) clamp(12px, 2.5vw, 40px) !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  font-family: 'Noto Sans JP', sans-serif !important;
  transform: none;
  transition: transform .4s var(--mhd-ease), opacity .4s var(--mhd-ease) !important;
}
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd * { box-sizing: border-box; }
/* 白い板（中身の並びに影響しないよう ::before で描く） */
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd::before {
  content: '' !important;
  position: absolute !important;
  inset: var(--hd-gap) clamp(12px, 2.5vw, 40px) !important;
  z-index: -1 !important;
  display: block !important;
  border-radius: 100px !important;
  background: var(--mhd-white) !important;
  box-shadow: 0 3px 14px rgba(27, 30, 43, .1), 0 0 0 1px rgba(27, 30, 43, .04) !important;
  transition: inset .4s var(--mhd-ease), border-radius .4s var(--mhd-ease), box-shadow .4s var(--mhd-ease) !important;
}
/* スクロールしたら：横いっぱいの帯（is-scrolled160 は header160.js が付ける） */
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd.is-scrolled160::before {
  inset: 0 0 calc(var(--hd-gap) * 2) 0 !important;
  border-radius: 0 !important;
  box-shadow: 0 2px 10px rgba(27, 30, 43, .08) !important;
}
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd > * { transition: transform .4s var(--mhd-ease); }
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd.is-scrolled160 > * { transform: translateY(calc(var(--hd-gap) * -1)); }

/* ロゴ（トップだけ h1 で包む。h1 は見た目に影響させない） */
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-h1 {
  display: contents !important;
  margin: 0 !important;
  font: inherit !important;
}
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-brand {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  flex: 0 0 auto !important;
  margin: 0 0 0 clamp(16px, 2vw, 32px) !important;
  padding: 0 !important;
  color: var(--mhd-ink) !important;
  text-decoration: none !important;
  line-height: 1 !important;
}
/* ロゴは仮で Barlow Condensed（DIN Next Condensed の SVG が届いたら画像に差し替え）。箱は AIKATA と同じ 120×35 */
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-logo {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex: 0 0 auto !important;
  width: 120px !important;
  height: 35px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  font: 500 32px/1 'Barlow Condensed', 'Noto Sans JP', sans-serif !important;
  letter-spacing: .08em !important;
  color: var(--mhd-ink) !important;
  white-space: nowrap !important;
}
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-cap {
  display: block !important;
  margin: 0 !important;
  padding: 0 0 0 14px !important;
  border-left: 1px solid var(--mhd-rule) !important;
  font: 400 12px/1.45 'Noto Sans JP', sans-serif !important;
  letter-spacing: .04em !important;
  color: var(--mhd-sub) !important;
  white-space: nowrap !important;
}

/* メニュー（PC） */
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-nav {
  display: flex !important;
  align-items: center !important;
  gap: clamp(14px, 1.6vw, 28px) !important;
  margin: 0 0 0 auto !important;
  padding: 0 8px 0 0 !important;
  background: transparent !important;
  border: 0 !important;
  position: static !important;
}
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-link {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  height: var(--hd-h) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  font: 500 14px/1 'Noto Sans JP', sans-serif !important;
  letter-spacing: .04em !important;
  color: var(--mhd-ink) !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transition: color .4s var(--mhd-ease) !important;
}
/* 下線：ふだんは幅0、乗せたとき・今いるページで伸びる */
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-link::after {
  content: '' !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 18px !important;
  height: 3px !important;
  border-radius: 3px !important;
  background: var(--mhd-blue) !important;
  transform: scaleX(0) !important;
  transform-origin: left !important;
  transition: transform .4s var(--mhd-ease) !important;
}
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-link:hover,
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-link[aria-current="page"] { color: var(--mhd-blue) !important; }
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-link:hover::after,
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-link[aria-current="page"]::after { transform: scaleX(1) !important; }

/* 主ボタン（無料診断）：朱の丸ボタン。右に白い丸と朱の矢印 */
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-cta {
  display: inline-flex !important;
  align-items: center !important;
  gap: 12px !important;
  height: 52px !important;
  min-height: 0 !important;
  margin: 0 0 0 clamp(4px, .8vw, 12px) !important;
  padding: 0 8px 0 24px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: var(--mhd-cta) !important;
  box-shadow: none !important;
  color: var(--mhd-white) !important;
  font: 700 14px/1 'Noto Sans JP', sans-serif !important;
  letter-spacing: .04em !important;
  text-decoration: none !important;
  text-shadow: none !important;
  white-space: nowrap !important;
  transition: background-color .4s var(--mhd-ease) !important;
}
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-cta:hover { background: var(--mhd-cta-hover) !important; }
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-cta-icon {
  display: grid !important;
  place-items: center !important;
  flex: 0 0 36px !important;
  width: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--mhd-white) !important;
  color: var(--mhd-cta) !important;
  transition: transform .4s var(--mhd-ease) !important;
}
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-cta:hover .mhd-cta-icon { transform: translateX(3px) !important; }
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-cta-icon svg { display: block !important; width: 18px !important; height: 18px !important; }
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd :is(.mhd-link, .mhd-cta, .mhd-brand, .mhd-menu):focus-visible {
  outline: 2px solid var(--mhd-blue) !important;
  outline-offset: 3px !important;
}

/* スマホ用のメニューボタン（PC では隠す） */
html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-menu { display: none !important; }

/* 幅が足りないときは、ロゴ横の説明を消す */
@media (max-width: 1360px) {
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-cap { display: none !important; }
}

/* スマホ・タブレット：丸い板のまま、右にメニューボタン。無料診断は画面下の固定ボタン（fixed-cta.css） */
@media (max-width: 1100px) {
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd { --hd-h: 60px; --hd-gap: 10px; justify-content: space-between !important; }
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-brand { margin-left: 18px !important; }
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-logo { width: 96px !important; height: 28px !important; font-size: 26px !important; }
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-nav { display: none !important; }
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-menu {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    height: 44px !important;
    min-height: 0 !important;
    margin: 0 8px 0 auto !important;
    padding: 0 18px 0 14px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--mhd-ink) !important;
    box-shadow: none !important;
    color: var(--mhd-white) !important;
    font: 700 14px/1 'Noto Sans JP', sans-serif !important;
    letter-spacing: .06em !important;
    cursor: pointer !important;
  }
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-burger { display: grid !important; gap: 4px !important; width: 18px !important; }
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd .mhd-burger i { display: block !important; width: 18px !important; height: 2px !important; margin: 0 !important; border-radius: 2px !important; background: var(--mhd-white) !important; }
}

/* 最後の申し込みの区画まで来たらヘッダーを隠す（header160.js が html に hd160-off を付ける） */
html.hd160-off body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd { transform: translateY(-110%) !important; opacity: 0 !important; pointer-events: none !important; }
@media (prefers-reduced-motion: reduce) {
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd,
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd *,
  html body:is(#mhd#mhd#mhd#mhd#mhd#mhd, *) header.mhd::before { transition: none !important; }
}
