/* hp-factory 共通の土台。見た目は縛らない。壊れやすい部分（デモの帯・スマホメニュー・動きを減らす配慮・設定で変わる色/文字）だけを持つ。
   各社のデザインは demo/css/site.css に書き、ここで定義した変数（--hpf-*）を使う。
   品質基準（業務指示書 §8）：ヘッダーに transform / backdrop-filter を付けっぱなしにしない（固定配置のメニューが閉じ込められる） */

:root {
  /* 配色：hpf.config.json の palette で上書きされる */
  --hpf-main: #1f4e79;
  --hpf-accent: #e0892b;
  --hpf-bg: #ffffff;
  --hpf-surface: #f4f6f8;
  --hpf-text: #1d2329;
  --hpf-muted: #2f3740; /* 灰色にしない（site-design 型9。地との差 7:1 以上） */
  --hpf-on-main: #ffffff;
  /* 文字の雰囲気：mood で切り替わる */
  --hpf-font-head: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --hpf-font-body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
  --hpf-head-weight: 700;
  --hpf-radius: 6px;
  --hpf-header-h: 64px;
  --hpf-banner-h: 28px;
}
body.hpf-mood-soft {
  --hpf-font-head: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Noto Sans JP", sans-serif;
  --hpf-head-weight: 700;
  --hpf-radius: 18px;
}
body.hpf-mood-firm {
  --hpf-font-head: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --hpf-head-weight: 600;
  --hpf-radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--hpf-bg);
  color: var(--hpf-text);
  font-family: var(--hpf-font-body);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
img, video { max-width: 100%; height: auto; }
h1, h2, h3, h4 { font-family: var(--hpf-font-head); font-weight: var(--hpf-head-weight); line-height: 1.4; }

/* ---------- デモの帯（必須。消さない） ---------- */
.hpf-demo-banner {
  position: sticky; top: 0; z-index: 1000;
  height: var(--hpf-banner-h); line-height: var(--hpf-banner-h);
  background: #222; color: #fff; text-align: center;
  font: 600 12px/var(--hpf-banner-h) "Noto Sans JP", sans-serif; letter-spacing: .04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
}
.hpf-demo-text { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* 見本だけ：動きの強さを試すボタン（hpf-base.js が帯に足す） */
.hpf-motion-switch { display: inline-flex; align-items: center; gap: 2px; flex: none; letter-spacing: 0; }
.hpf-motion-label { opacity: .7; margin-right: 4px; }
.hpf-motion-switch button {
  font: inherit; font-size: 11.5px; line-height: 1; color: #fff; cursor: pointer;
  background: transparent; border: 1px solid rgba(255,255,255,.35); padding: 4px 8px; border-radius: 99px;
  min-height: 22px; transition: background-color .2s, color .2s;
}
.hpf-motion-switch button[aria-pressed="true"] { background: #fff; color: #222; border-color: #fff; }
.hpf-motion-switch button:focus-visible { outline: 2px solid #ffd54a; outline-offset: 1px; }
/* スマホ：帯を2段にして「動きの強さ」の文字も出す（何の切り替えか分かるように） */
@media (max-width: 600px) {
  :root:has(.hpf-demo-banner .hpf-motion-switch) { --hpf-banner-h: 54px; }
  .hpf-demo-banner { flex-direction: column; gap: 3px; line-height: 1.2; font-size: 11px; letter-spacing: 0; padding: 4px 8px; }
  .hpf-motion-label { opacity: .85; }
  .hpf-motion-switch button { font-size: 11px; padding: 3px 10px; }
}

/* ---------- ヘッダーとメニュー ---------- */
.hpf-header {
  position: sticky; top: var(--hpf-banner-h); z-index: 900;
  height: var(--hpf-header-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: var(--hpf-bg);
  transition: transform .3s ease, box-shadow .3s ease;
}
.hpf-header.is-scrolled { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
/* 隠す時だけ transform。表示中は transform なし（スマホメニューが閉じ込められないように） */
.hpf-header.is-hidden { transform: translateY(calc(-100% - var(--hpf-banner-h))); }
body.hpf-nav-open .hpf-header { transform: none; }

.hpf-logo { font-family: var(--hpf-font-head); font-weight: var(--hpf-head-weight); font-size: 18px; color: var(--hpf-text); text-decoration: none; white-space: nowrap; }
.hpf-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.hpf-nav a { display: block; padding: 10px 12px; color: var(--hpf-text); text-decoration: none; font-size: 14.5px; font-weight: 600; border-radius: var(--hpf-radius); }
.hpf-nav a:hover, .hpf-nav a[aria-current="page"] { color: var(--hpf-main); background: var(--hpf-surface); }
.hpf-menu-btn { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; border-radius: 8px; }
.hpf-menu-btn span { display: block; width: 22px; height: 2px; margin: 5px auto; background: var(--hpf-text); transition: .2s; }

/* 電話・問い合わせボタン（cta.position で表示場所が変わる） */
.hpf-cta { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border-radius: var(--hpf-radius); background: var(--hpf-accent); color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; }
.hpf-cta-header { margin-left: 8px; }
.hpf-cta-floating { display: none; position: fixed; right: 16px; bottom: 16px; z-index: 800; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
body.hpf-cta-pos-floating .hpf-cta-header, body.hpf-cta-pos-none .hpf-cta-header { display: none; }
body.hpf-cta-pos-floating .hpf-cta-floating, body.hpf-cta-pos-both .hpf-cta-floating { display: inline-flex; }
/* スマホ：ボタンの文字が長ければ文節で折り返す。画面より広くしない
   （2026-11-15 ZEIRA のHPで、折り返さないボタンが Safari で横揺れ・はみ出しを起こした。tools/safari_check.py で検査） */
@media (max-width: 600px) {
  .hpf-cta { white-space: normal; text-align: center; max-width: calc(100vw - 32px); }
}

@media (max-width: 900px) {
  .hpf-menu-btn { display: block; }
  .hpf-cta-header { display: none; }
  body:not(.hpf-cta-pos-none) .hpf-cta-floating { display: inline-flex; }
  .hpf-nav {
    position: fixed; left: 0; right: 0; bottom: 0;
    top: calc(var(--hpf-banner-h) + var(--hpf-header-h));
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 20px 40px; margin: 0; overflow-y: auto;
    background: var(--hpf-bg);
    visibility: hidden; opacity: 0; transition: opacity .2s, visibility .2s;
  }
  body.hpf-nav-open { overflow: hidden; }
  body.hpf-nav-open .hpf-nav { visibility: visible; opacity: 1; }
  .hpf-nav a { padding: 16px 4px; font-size: 16px; border-bottom: 1px solid rgba(0,0,0,.08); border-radius: 0; }
  body.hpf-nav-open .hpf-menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.hpf-nav-open .hpf-menu-btn span:nth-child(2) { opacity: 0; }
  body.hpf-nav-open .hpf-menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ---------- 「仮」の黄色マーカー（事実が確認できない内容） ---------- */
.hpf-tbd { background: linear-gradient(transparent 55%, #fff27a 55%); }
.hpf-tbd::after { content: "（仮）"; font-size: .8em; color: #8a6d00; }

/* ---------- 未制作ページ ---------- */
.hpf-stub { max-width: 720px; margin: 80px auto; padding: 40px 24px; text-align: center; border: 1px dashed rgba(0,0,0,.2); border-radius: var(--hpf-radius); }
.hpf-stub h1 { font-size: 24px; margin: 0 0 12px; }
.hpf-stub p { color: var(--hpf-muted); margin: 0 0 24px; }

/* ---------- 追加用セクション（hpf-sections.js）の最低限の形 ---------- */
.hpf-sec { padding: 72px 20px; }
.hpf-sec:nth-of-type(even) { background: var(--hpf-surface); }
.hpf-sec-inner { max-width: 1080px; margin: 0 auto; }
.hpf-sec-title { font-size: clamp(22px, 3vw, 30px); margin: 0 0 32px; color: var(--hpf-main); }
.hpf-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.hpf-card { background: var(--hpf-bg); border-radius: var(--hpf-radius); padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.hpf-card .ph { aspect-ratio: 4/3; background: var(--hpf-surface); border-radius: var(--hpf-radius); display: grid; place-items: center; color: var(--hpf-muted); font-size: 13px; margin-bottom: 12px; }
.hpf-table { width: 100%; border-collapse: collapse; }
.hpf-table th, .hpf-table td { padding: 14px 12px; border-bottom: 1px solid rgba(0,0,0,.1); text-align: left; }
.hpf-news li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(0,0,0,.1); list-style: none; }
.hpf-news { padding: 0; margin: 0; }
.hpf-news time { color: var(--hpf-muted); white-space: nowrap; }
@media (max-width: 600px) { .hpf-news li { flex-direction: column; gap: 2px; } }

/* ---------- 動き：読み込み前は隠し、失敗しても4秒で出す（hpf-base.js / head の保険） ---------- */
html.hpf-js [data-motion] { opacity: 0; }
html.hpf-js.hpf-motion-ready [data-motion], html.hpf-reveal-all [data-motion], body.hpf-motion-off [data-motion] { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  html.hpf-js [data-motion] { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ヒアリング中に変わった部分を一瞬光らせる */
.hpf-flash { animation: hpf-flash 1.2s ease; }
@keyframes hpf-flash { 0% { box-shadow: 0 0 0 0 rgba(255,200,0,.0); } 20% { box-shadow: 0 0 0 6px rgba(255,200,0,.8); } 100% { box-shadow: 0 0 0 0 rgba(255,200,0,0); } }
