/* common.css — サイト全体で使う共通スタイル
 * 設計: _docs/DESIGN-site-page-split-ai-discoverability-2026-07-17.md §D
 *
 * 「共通は外部・固有はインラインのまま」の二層構成。
 * ここに入れるのは複数ページで再出現するパターンのみ。ページ固有の見た目
 * （ヒーローのグラデーション、各STEP専用モックアップの配色等）は各ページの
 * <style>に残す。ビルドツールなしの静的HTMLサイトのため、キャッシュバストは
 * クエリ文字列（common.css?v=1）を手動更新する運用。
 *
 * ヘッダー・フッターのHTML本体は scripts/site-chrome.js が実行時に差し込む
 * （24ページに生HTMLをコピペしていたのを廃止・2026-08-22）。ここにあるのは
 * その見た目のスタイルのみ。
 *
 * ─────────────────────────────────────────────────────────────
 * ■ 目次（Ctrl+Fで見出しの記号を検索）
 *   基本リセット・共通ユーティリティ ............ 直後
 *   ヘッダー（ロゴ・PC横並びナビ） .............. ── ヘッダー ──
 *   ハンバーガーメニュー（幅1100px以下） ......... ── ハンバーガーメニュー ──
 *   サイト共通フッター .......................... ── サイト共通フッター ──
 *   コマ（吹き出し＋画面。howto系ページ共通） .... ── コマ ──
 *   モックアップ画面の共通枠 .................... ── モックアップ画面の共通枠 ──
 *   矢印ポインター ............................... ── 矢印ポインター ──
 *   ステップバッジ ............................... ── ステップバッジ ──
 *   セクション共通（chapterカード） .............. ── セクション共通 ──
 *   パンくず ..................................... ── パンくず ──
 *   前後ナビ ..................................... ── 前後ナビ ──
 *   ページ末尾フッター（見た目のみ。本体は上記footer） ── フッター ──
 *   AIへの指示ブロック（コピペ用。機能ページ共通） ── AIへの指示ブロック ──
 *   AIへの指示 一覧（全ページ共通・フッター直前） .... ── AIへの指示 一覧 ──
 *
 * ■ ブレークポイント一覧（このファイル内。ページ固有<style>は含まない）
 *   max-width: 1100px … ヘッダーnavをハンバーガーに切り替え
 *   max-width: 500px  … koma-talk（吹き出し）を縦積みに変更
 *   ※ LP（index.html）は本文レイアウト用の追加ブレークポイントを持つ。
 *     common.cssとは別管理なので、ヘッダーの折り返し幅を変えるときは両方確認すること。
 * ─────────────────────────────────────────────────────────────
 */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { overflow-x: hidden; max-width: 100%; }

body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  color: #1a1a1a;
  line-height: 1.8;
}

/* ── モバイル幅での横あふれ対策（サイト全体） ── */
h1, h2, h3, p, li, td, th, .sub { overflow-wrap: break-word; word-break: break-word; }
table { display: block; max-width: 100%; overflow-x: auto; white-space: nowrap; }
table tr { display: table-row; }
table th, table td { display: table-cell; }
img, video { max-width: 100%; height: auto; }

/* ── ヘッダー ── */
header {
  background: white;
  border-bottom: 3px solid #eee;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
header img.logo { height: 40px; }
header nav { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
header nav a {
  color: #555;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
header nav a:hover { background: #f0f0ff; color: #667eea; }
header nav a.active { background: #667eea; color: white; }

/* ── AIに共有ボタン（ヘッダー常設・ハンバーガーに隠れない） ── */
.share-to-ai-btn {
  flex-shrink: 0;
  margin-left: auto;
  background: #1a1a2e;
  color: white;
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.share-to-ai-btn:hover { background: #667eea; }
.share-to-ai-btn:active { transform: scale(0.97); }
/* ハンバーガーが出る幅では nav が margin-left:auto を失うので、
   このボタン側の margin-left:auto は不要になるが、悪さもしないため単純化のため残す */
@media (max-width: 1100px) {
  .share-to-ai-btn { margin-left: 0; }
}
@media (max-width: 480px) {
  .share-to-ai-btn { padding: 7px 10px; font-size: 0.72rem; }
}

/* ── ハンバーガーメニュー（幅1100px以下でnavを折りたたむ） ── */
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  position: relative;
  transition: background 0.15s;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: transform 0.2s;
}
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1100px) {
  .nav-toggle { display: flex; }
  header nav {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px 18px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  }
  header nav.nav-open { display: flex; }
  header nav a { font-size: 0.88rem; padding: 10px 12px; }
}

/* ── サイト共通フッター（全ページ主要リンク集） ──
   注意: サイト共通フッターの実体は <footer class="site-footer"> なので、
   下の「── フッター ──」にある要素セレクタ footer{} の見た目（黒背景・中央寄せ）と
   ここの .site-footer{}（余白・幅）が両方効く。競合ではなく意図した二層適用:
     footer          … 外枠の見た目（背景色・パディング・文字色）
     .site-footer    … 内側の中身のレイアウト（リンクの並び・最大幅） */
.site-footer { margin-top: 40px; padding-top: 20px; border-top: 1px solid #e7eaf0; max-width: 760px; margin-left: auto; margin-right: auto; padding-left: 18px; padding-right: 18px; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; }
.site-footer-links a { color: #1565c0; text-decoration: none; font-size: .85em; font-weight: 700; }
.site-footer-links a:hover { text-decoration: underline; }
.site-footer-copy { font-size: .78em; color: #6b7280; }

/* ── コマ（吹き出し＋画面）── howto系ページ共通 */
.koma { margin-bottom: 36px; }
.koma:last-child { margin-bottom: 0; }
.koma-talk { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.koma-talk.reverse { flex-direction: row-reverse; }
.koma-talk img { width: 60px; flex-shrink: 0; }
.talk-bubble {
  background: #f0f0ff;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 0.9rem;
  line-height: 1.75;
  position: relative;
  max-width: 500px;
}
.koma-talk:not(.reverse) .talk-bubble::before {
  content: '';
  position: absolute;
  left: -8px; top: 16px;
  border: 8px solid transparent;
  border-right-color: #f0f0ff;
  border-left: 0;
}
.koma-talk.reverse .talk-bubble { background: #e8f5e9; }
.koma-talk.reverse .talk-bubble::after {
  content: '';
  position: absolute;
  right: -8px; top: 16px;
  border: 8px solid transparent;
  border-left-color: #e8f5e9;
  border-right: 0;
}
.talk-bubble strong { color: #667eea; }
.talk-bubble .hl { background: #fff3cd; padding: 1px 4px; border-radius: 4px; font-weight: 700; }
.char-name { font-size: 0.7rem; color: #aaa; text-align: center; margin-top: 4px; }

/* ── モックアップ画面の共通枠 ── */
.mockup {
  background: #1e1e2e;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 0 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.mockup-bar {
  background: #2a2a3e;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mockup-bar .dot { width: 10px; height: 10px; border-radius: 50%; }
.mockup-bar .dot.r { background: #ff5f57; }
.mockup-bar .dot.y { background: #febc2e; }
.mockup-bar .dot.g { background: #28c840; }
.mockup-bar .url {
  background: #3a3a50;
  border-radius: 6px;
  padding: 3px 12px;
  font-size: 0.75rem;
  color: #aaa;
  margin-left: 8px;
  flex: 1;
}
.mockup-body { padding: 20px; }

/* ── 矢印ポインター ── */
.pointer {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff3cd;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #856404;
  margin-top: 8px;
}
.pointer::before { content: '👆'; font-size: 1.1rem; }

/* ── ステップバッジ ── */
.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: 800;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

/* ── セクション共通（chapterカード）── */
.chapter { max-width: 720px; margin: 0 auto 64px; padding: 0 24px; }
.chapter-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  color: white;
  border-radius: 20px 20px 0 0;
  padding: 20px 28px;
  margin-bottom: 0;
}
.chapter-header .ch-num {
  background: #f6c90e;
  color: #1a1a2e;
  font-weight: 900;
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chapter-header h2 { font-size: 1.2rem; font-weight: 900; }
.chapter-header .ch-sub { font-size: 0.82rem; opacity: 0.75; margin-top: 2px; }
.chapter-body {
  background: white;
  border-radius: 0 0 20px 20px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* ── パンくず（新規: ページ分割で追加） ── */
.breadcrumb {
  max-width: 720px;
  margin: 16px auto 0;
  padding: 0 24px;
  font-size: 0.8rem;
  color: #888;
}
.breadcrumb a { color: #667eea; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── 前後ナビ（新規: ページ分割で追加） ── */
.step-nav {
  max-width: 720px;
  margin: 24px auto 0;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.step-nav a {
  flex: 1;
  min-width: 140px;
  background: white;
  border-radius: 12px;
  padding: 14px 18px;
  text-decoration: none;
  color: #1a1a1a;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  font-size: 0.85rem;
  font-weight: 700;
}
.step-nav a.next { text-align: right; }
.step-nav a:hover { transform: translateY(-2px); }
.step-nav .nav-label { display: block; font-size: 0.7rem; color: #888; font-weight: 400; margin-bottom: 2px; }

/* ── フッター（外枠。中身のリンク配置は上の「── サイト共通フッター ──」を見る） ── */
footer {
  background: #1a1a2e;
  color: #aaa;
  text-align: center;
  padding: 32px 24px;
  font-size: 0.85rem;
}
/* footer a はリンク色の既定値。.site-footer-links a（#1565c0）の方が詳細度で勝つため、
   共通フッター配下では実際には使われない（他ページの単発フッターへの保険として残す）。 */
footer a { color: #f6c90e; text-decoration: none; margin: 0 8px; font-size: 0.82em; display: inline-block; }

@media (max-width: 500px) {
  .koma-talk { flex-direction: column; align-items: flex-start; }
  .koma-talk.reverse { flex-direction: column; }
  .koma-talk .talk-bubble::before,
  .koma-talk.reverse .talk-bubble::after { display: none; }
}

/* ── AIへの指示ブロック（コピペ用。機能ページ共通） ──
   正本はHTMLではなく assets/data/ai-instructions.json。
   使い方: ページには空の <div class="ai-box-slot" data-ai-key="診断キー名"></div> だけを置き、
   scripts/ai-box.js を読み込む（site-chrome.js の直後）。実行時にJSONを取得して
   中身（見出し・指示文・コピーボタン・注記）を差し込み、クラスを ai-box-slot → ai-box に
   差し替える。1ページに複数機能が乗る場合は data-ai-key の異なるスロットを並べるだけでよい
   （features/health-check/ が3スロットの実例）。手順書のパスが変わった／新しい機能が
   増えたときは ai-instructions.json だけを直せば全ページに反映される。HTMLへの直書きはしない。
   2026-08-22 データ駆動化。 */
.ai-box, .ai-box-slot {
  background: #1a1a2e;
  color: #e8e8f0;
  border-radius: 14px;
  padding: 20px 22px;
  margin: 32px 0 0;
  min-height: 40px;
}
.ai-box h2, .ai-box h3 { font-size: 1.05rem; color: #fff; margin-bottom: 4px; }
.ai-box .ai-sub { font-size: 0.82rem; color: #9a9ac0; margin-bottom: 14px; }
.ai-copy {
  background: #0f0f1e;
  border: 1px solid #34345a;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  color: #d6d6f0;
  white-space: pre-wrap;
  position: relative;
}
.ai-copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
.ai-copy-btn:hover { background: #5568d3; }
.ai-box .ai-note { font-size: 0.78rem; color: #8888aa; margin-top: 10px; line-height: 1.7; }
.ai-box .ai-note a { color: #a0b4ff; }

/* ── AIへの指示 一覧（全ページ共通フッター直前。site-chrome.js が差し込むスロット） ──
   個別の ai-box とは別物: 「このキットで何をAIに任せられるか」の総覧をリンクだけで出す。
   健康診断ページ以外の機能ページに気づけないという声を受けて追加（2026-08-22）。 */
.ai-index-slot { min-height: 1px; }
.ai-index {
  max-width: 760px;
  margin: 40px auto 0;
  padding: 16px 18px;
  border-top: 1px dashed #d8dce6;
}
.ai-index-title { font-size: 0.82rem; font-weight: 800; color: #667eea; margin-bottom: 8px; }
.ai-index-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ai-index-links a { color: #1565c0; text-decoration: none; font-size: .85em; font-weight: 700; }
.ai-index-links a:hover { text-decoration: underline; }
