/* ================================================================
   common.css — hikaku.guide 共通スタイル
   全ページで共有するリセット・変数・UIコンポーネント
================================================================ */

/* -----------------------------------------------
   CSS カスタムプロパティ（全ページ統合）
----------------------------------------------- */
:root {
  --blue:        #1a56db;
  --blue-lt:     #eff6ff;
  --blue-dk:     #1e40af;
  --blue-xdk:    #0d2558;
  --green:       #047857;
  --green-lt:    #ecfdf5;
  --green-dk:    #065f46;
  --teal:        #0891b2;
  --teal-lt:     #e0f2fe;
  --text:        #111827;
  --text-2:      #4b5563;
  --text-muted:  #9ca3af;
  --border:      #e5e7eb;
  --border-lt:   #f3f4f6;
  --bg:          #ffffff;
  --bg-gray:     #f9fafb;
  --bg-dark:     #111827;
  --radius:      8px;
  --radius-lg:   14px;
  --shadow:      0 1px 3px rgba(0,0,0,.09), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 8px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:   0 10px 24px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.07);
}

/* -----------------------------------------------
   リセット & ベース
----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN',
               'Hiragino Sans', 'Meiryo', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* -----------------------------------------------
   レイアウト共通（デフォルト860px／各ページで上書き可）
----------------------------------------------- */
.container    { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.section      { padding: 52px 0; }
.section-alt  { background: var(--bg-gray); }

/* -----------------------------------------------
   スキップリンク
----------------------------------------------- */
.skip-link {
  position: absolute; top: -999px; left: 4px;
  background: var(--blue); color: #fff; padding: 8px 16px;
  border-radius: 0 0 var(--radius) var(--radius); font-size: 14px; z-index: 9999;
}
.skip-link:focus { top: 0; }

/* -----------------------------------------------
   PR表記バー
----------------------------------------------- */
.pr-bar {
  background: #fef9c3; border-bottom: 1px solid #fde68a;
  padding: 9px 16px; text-align: center;
  font-size: 12px; color: #713f12; line-height: 1.6;
}
.pr-bar strong { font-weight: 700; }

/* -----------------------------------------------
   サイトヘッダー — 共通ベース（スティッキー）
----------------------------------------------- */
.site-header {
  background: var(--bg);
  border-bottom: 2px solid var(--blue);
  padding: 10px 0;
  position: sticky; top: 0; z-index: 200;
  box-shadow: var(--shadow);
}

/* 簡易ヘッダー（内部ページ用: .site-logo + .header-cta） */
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.site-logo { display: flex; align-items: center; flex-shrink: 0; }
.site-logo img { height: 36px; width: auto; display: block; }
.site-logo:hover { opacity: .85; text-decoration: none; }

.header-cta {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--green); color: #fff;
  font-size: 12px; font-weight: 700; padding: 8px 14px;
  border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}
.header-cta:hover { background: var(--green-dk); text-decoration: none; }

/* フルヘッダー（TOPページ用: .logo + .desktop-nav + .hamburger） */
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 16px;
}
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo:hover { text-decoration: none; opacity: .85; }
.logo-img { height: 38px; width: auto; display: block; }

.desktop-nav { display: none; }
.desktop-nav ul { display: flex; align-items: center; gap: 4px; }
.desktop-nav a {
  display: inline-block; padding: 6px 12px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  border-radius: var(--radius); transition: background .15s, color .15s;
}
.desktop-nav a:hover { background: var(--bg-gray); color: var(--blue); text-decoration: none; }
.nav-cta {
  display: inline-flex; align-items: center;
  background: var(--green) !important; color: #fff !important;
  padding: 7px 14px !important; border-radius: 4px !important;
  font-weight: 700 !important;
}
.nav-cta:hover { background: var(--green-dk) !important; }

.hamburger {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--text);
}
.ham-bar {
  display: block; width: 22px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .22s, opacity .22s;
}
.hamburger.is-open .ham-bar:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.is-open .ham-bar:nth-child(2) { opacity: 0; }
.hamburger.is-open .ham-bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-nav {
  display: none; background: var(--bg);
  border-top: 1px solid var(--border);
  position: absolute; top: 100%; left: 0; right: 0;
  box-shadow: var(--shadow-md); z-index: 290;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a {
  display: block; padding: 13px 20px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  border-bottom: 1px solid var(--border-lt);
}
.mobile-nav a:last-child { border-bottom: none; }
.mobile-nav a:hover { background: var(--bg-gray); color: var(--blue); text-decoration: none; }
.mobile-nav .mob-cta { color: var(--green); font-weight: 700; }

/* -----------------------------------------------
   パンくずリスト
----------------------------------------------- */
.breadcrumb {
  background: var(--bg-gray); border-bottom: 1px solid var(--border); padding: 8px 0;
}
.breadcrumb ol {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 4px; font-size: 12px; color: var(--text-2);
}
.breadcrumb li:not(:last-child)::after { content: '›'; margin-left: 4px; color: var(--text-muted); }
.breadcrumb a { color: var(--blue); }

/* -----------------------------------------------
   ボタン共通
----------------------------------------------- */
.btn-main {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff;
  font-weight: 800; font-size: 15px;
  padding: 15px 28px; border-radius: 6px;
  box-shadow: 0 4px 12px rgba(4,120,87,.25);
  transition: background .2s, transform .1s, box-shadow .2s;
  width: 100%; text-align: center; line-height: 1.3;
}
.btn-main:hover { background: var(--green-dk); text-decoration: none; box-shadow: 0 6px 16px rgba(4,120,87,.32); }
.btn-main:active { transform: translateY(1px); }
.btn-main.sm { font-size: 14px; padding: 12px 24px; }

.btn-outline {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 2px solid var(--blue); color: var(--blue);
  font-weight: 700; font-size: 14px;
  padding: 11px 24px; border-radius: 6px; background: var(--bg);
  transition: background .2s; width: 100%; text-align: center;
}
.btn-outline:hover { background: var(--blue-lt); text-decoration: none; }

.btn-sub {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); color: var(--text-2);
  font-weight: 600; font-size: 13.5px;
  padding: 10px 20px; border-radius: 6px; background: var(--bg-gray);
  transition: background .2s; width: 100%; text-align: center;
}
.btn-sub:hover { background: var(--border); text-decoration: none; color: var(--text); }

/* -----------------------------------------------
   セクション見出し共通（左ボーダー型／内部ページ用）
   ※ TOPページは各ページのインラインCSSで上書き
----------------------------------------------- */
.section-head { margin-bottom: 28px; }
.section-head h2 {
  font-size: clamp(17px, 4vw, 22px); font-weight: 800; line-height: 1.4;
  color: var(--text); padding-left: 13px;
  border-left: 4px solid var(--blue); margin-bottom: 10px;
}
.section-head .lead { font-size: 14px; color: var(--text-2); line-height: 1.85; }

/* -----------------------------------------------
   目次（TOC）
----------------------------------------------- */
.toc {
  background: var(--bg-gray); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; margin: 26px 0;
}
.toc-heading { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }

/* グリッド型 TOC（fuyouhin カテゴリページ） */
.toc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px;
}
.toc-grid li { font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid var(--border-lt); }
.toc-grid li:last-child, .toc-grid li:nth-last-child(2) { border-bottom: none; }
.toc-grid a { color: var(--text-2); }
.toc-grid a:hover { color: var(--blue); text-decoration: none; }
.toc-counter { counter-reset: toc-c; }
.toc-counter li { counter-increment: toc-c; }
.toc-counter li::before { content: counter(toc-c) '. '; color: var(--blue); font-weight: 700; }

/* リスト型 TOC（東京比較ページ） */
.toc-list { counter-reset: toc; }
.toc-list li {
  counter-increment: toc; padding: 5px 0;
  border-bottom: 1px solid var(--border-lt); font-size: 13px;
}
.toc-list li:last-child { border-bottom: none; }
.toc-list li::before { content: counter(toc) '. '; color: var(--blue); font-weight: 700; }
.toc-list a { color: var(--text-2); }
.toc-list a:hover { color: var(--blue); text-decoration: none; }

/* -----------------------------------------------
   FAQ アコーディオン
----------------------------------------------- */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.faq-btn {
  width: 100%; background: none; border: none; font-family: inherit;
  padding: 15px 18px; text-align: left; cursor: pointer;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.5;
  transition: background .15s;
}
.faq-btn:hover { background: var(--bg-gray); }
.faq-q { color: var(--blue); font-size: 17px; font-weight: 900; flex-shrink: 0; line-height: 1.3; }
.faq-toggle { margin-left: auto; flex-shrink: 0; font-size: 18px; color: var(--text-muted); transition: transform .22s; }
.faq-item.open .faq-toggle { transform: rotate(45deg); }
.faq-answer {
  display: none; padding: 12px 18px 15px; border-top: 1px solid var(--border-lt);
}
.faq-item.open .faq-answer { display: block; }
.faq-a { color: var(--green); font-size: 17px; font-weight: 900; margin-right: 6px; }
.faq-answer p { font-size: 13.5px; color: var(--text-2); line-height: 1.85; }
.faq-answer a { color: var(--blue); font-weight: 600; }

/* -----------------------------------------------
   トップへ戻るボタン
----------------------------------------------- */
.back-top {
  position: fixed; bottom: 20px; right: 14px; z-index: 100;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--blue); color: #fff; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
  transition: opacity .3s; text-decoration: none;
}
.back-top.show { opacity: 1; pointer-events: auto; }
.back-top:hover { background: var(--blue-dk); text-decoration: none; }

/* -----------------------------------------------
   フッター — シンプル注記型（内部ページ用）
----------------------------------------------- */
.page-footer {
  background: var(--bg-gray); border-top: 1px solid var(--border); padding: 18px 0;
}
.footer-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.75; }
.footer-sub-nav {
  margin-top: 12px; display: flex; flex-wrap: wrap; gap: 4px 16px;
}
.footer-sub-nav a {
  font-size: 12px; color: var(--text-muted); text-decoration: none;
}
.footer-sub-nav a:hover { text-decoration: underline; }

/* -----------------------------------------------
   フッター — フルナビ型（TOPページ用）
----------------------------------------------- */
.site-footer {
  background: var(--bg-dark); color: rgba(255,255,255,.7);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 32px; margin-bottom: 40px;
}
.footer-logo { display: flex; align-items: center; margin-bottom: 10px; }
.footer-logo .logo-img { height: 32px; width: auto; filter: brightness(0) invert(1); }
.footer-about { font-size: 13px; line-height: 1.8; color: rgba(255,255,255,.6); }
.footer-col-title {
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,.9);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px;
}
.footer-nav-list { display: flex; flex-direction: column; gap: 8px; }
.footer-nav-list a { font-size: 13px; color: rgba(255,255,255,.6); transition: color .15s; }
.footer-nav-list a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center; text-align: center;
}
.footer-legal-links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.footer-legal-links a { font-size: 12px; color: rgba(255,255,255,.4); }
.footer-legal-links a:hover { color: rgba(255,255,255,.7); text-decoration: none; }
.footer-copy { font-size: 12px; color: rgba(255,255,255,.3); }

/* -----------------------------------------------
   レスポンシブ — 共通ブレークポイント
----------------------------------------------- */
@media (min-width: 768px) {
  .hamburger    { display: none; }
  .desktop-nav  { display: block; }
  .footer-grid  { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}

@media (min-width: 600px) {
  .toc-grid { grid-template-columns: repeat(3, 1fr); }
}
