/*
Theme Name: 比較ベース
Description: 比較サイト講座の土台テーマ。記事ページ・固定ページ・404・サイト全体のデザインを担当します。主要ページ（店舗／エリア／都道府県／TOP）は講座の手順で自作テンプレートを追加します。記事作成ツール（Article Craft）内蔵。
Version: 1.0.0
Author: AIサブスク講座
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: hikaku-base
*/

/* =============================================================
   デザイントークン（サイト全体の色・サイズはここだけ触ればOK）
   例：「アクセント色を変えて」→ --accent の1行を変えるだけで全体が変わる
   ============================================================= */
:root {
  --accent: #1e3a5f;        /* アクセント色（ネイビー）。ボタン・見出し・リンクに効く */
  --accent-dark: #152a46;   /* アクセントの濃い版（ホバー時など） */
  --accent-pale: #eef2f7;   /* アクセントの超うすい版（背景に使う） */
  --text: #333333;          /* 本文の文字色 */
  --muted: #777777;         /* 補足・日付などの控えめな文字色 */
  --bg: #ffffff;            /* ページ背景 */
  --bg-soft: #f7f8fa;       /* 少しだけ色のついた背景（フッターなど） */
  --border: #e3e6ea;        /* 罫線の色 */
  --maxw: 1160px;           /* コンテンツの最大幅 */
  --radius: 5px;            /* 角丸の大きさ */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif; /* システムフォント（読み込み待ちゼロ） */
}

/* ===== リセット＆土台 ===== */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;               /* 行間ひろめ＝読みやすさ優先 */
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }
a:hover { opacity: .85; }

/* コンテンツの幅を揃える共通クラス */
.inner { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ===== ヘッダー（サイト名＋グロナビ） ===== */
.site-header { background: var(--bg); border-bottom: 1px solid var(--border); }
.site-header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 64px; flex-wrap: wrap;
}
.site-brand { font-size: 20px; font-weight: 700; }
.site-brand a { color: var(--text); text-decoration: none; }
.site-brand .site-tagline { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }

/* グロナビ（PC） */
.global-nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.global-nav-list a {
  display: block; padding: 20px 14px; text-decoration: none;
  color: var(--text); font-size: 14px; font-weight: 500;
}
.global-nav-list a:hover { color: var(--accent); opacity: 1; }

/* ハンバーガー（スマホ用・CSSだけで開閉＝JSなし） */
.nav-toggle { display: none; }
.nav-toggle-btn { display: none; cursor: pointer; padding: 10px; }
.nav-toggle-btn span { display: block; width: 24px; height: 2px; background: var(--text); margin: 5px 0; transition: .2s; }

/* ===== メイン領域 ===== */
.site-main { max-width: var(--maxw); margin: 0 auto; padding: 24px 16px 64px; }

/* ===== パンくずリスト ===== */
.breadcrumb { font-size: 12px; color: var(--muted); margin: 0 0 20px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ===== 記事本文（single/pageの中身） ===== */
.entry-header { margin-bottom: 24px; }
.entry-title { font-size: 28px; line-height: 1.5; margin: 0 0 12px; }
.entry-meta { font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.entry-meta .cat-label {
  background: var(--accent-pale); color: var(--accent);
  padding: 1px 10px; border-radius: var(--radius); text-decoration: none; font-size: 12px;
}
.entry-thumbnail { margin: 0 0 28px; }
.entry-thumbnail img { border-radius: var(--radius); display: block; width: 100%; }

/* 本文中の見出し＝アクセント色＋下線（Article Craftの出力が映える形） */
.entry-content { max-width: 760px; margin: 0 auto; }
.entry-content h2 {
  font-size: 24px; line-height: 1.5; color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px; margin: 48px 0 20px;
}
.entry-content h3 {
  font-size: 20px; line-height: 1.5; color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px; margin: 36px 0 16px;
}
.entry-content h4 { font-size: 17px; margin: 28px 0 12px; }
.entry-content p { margin: 0 0 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.6em; margin: 0 0 1.4em; }
.entry-content li { margin-bottom: .4em; }
.entry-content blockquote {
  margin: 0 0 1.4em; padding: 14px 18px;
  background: var(--bg-soft); border-radius: var(--radius); color: var(--muted);
}
.entry-content img { border-radius: var(--radius); }

/* 本文中の表（自動で横スクロール対応） */
.entry-content table {
  width: 100%; border-collapse: collapse; margin: 0 0 1.6em; font-size: 14px;
}
.entry-content th, .entry-content td {
  border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top;
}
.entry-content th { background: var(--accent-pale); color: var(--accent); font-weight: 700; }
.entry-content tr:nth-child(even) td { background: var(--bg-soft); }

/* ===== 目次（toc.jsが自動で差し込む箱） ===== */
.toc {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px; margin: 0 0 36px;
}
.toc-title { font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 1.4em; }
.toc li { margin-bottom: .3em; font-size: 14px; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ===== 記事一覧（index/archive のカード） ===== */
.archive-title { font-size: 24px; color: var(--accent); border-bottom: 2px solid var(--accent); padding-bottom: 8px; margin: 0 0 24px; }
.post-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; list-style: none; margin: 0; padding: 0; }
.post-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--bg); display: flex; flex-direction: column;
}
.post-card a.post-card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.post-card-thumb { aspect-ratio: 16 / 9; background: var(--accent-pale); overflow: hidden; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.post-card-title { font-size: 15px; font-weight: 700; line-height: 1.5; margin: 0; }
.post-card-excerpt { font-size: 13px; color: var(--muted); margin: 0; }
.post-card-date { font-size: 12px; color: var(--muted); margin-top: auto; }

/* ページ送り（1 2 3 …） */
.pagination { margin-top: 36px; text-align: center; }
.pagination .nav-links { display: inline-flex; gap: 6px; }
.pagination .page-numbers {
  display: inline-block; min-width: 38px; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; font-size: 14px; color: var(--text); background: var(--bg);
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); opacity: 1; }

/* ===== 404ページ ===== */
.error-404 { text-align: center; padding: 64px 16px; }
.error-404 .error-code { font-size: 72px; font-weight: 700; color: var(--accent); line-height: 1; margin: 0 0 8px; }
.error-404 p { color: var(--muted); }
.error-404 .btn-home {
  display: inline-block; margin-top: 20px; padding: 12px 32px;
  background: var(--accent); color: #fff; text-decoration: none;
  border-radius: var(--radius); font-weight: 700;
}
.error-404 .btn-home:hover { background: var(--accent-dark); opacity: 1; }

/* ===== フッター ===== */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); margin-top: 40px; }
.site-footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 32px 16px; text-align: center; }
.footer-nav ul { list-style: none; margin: 0 0 16px; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a { font-size: 13px; color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }
.copyright { font-size: 12px; color: var(--muted); }

/* =============================================================
   スマホ対応（768px以下）
   ============================================================= */
@media (max-width: 768px) {
  .site-main { padding-top: 16px; }
  .entry-title { font-size: 22px; }
  .entry-content h2 { font-size: 20px; }
  .entry-content h3 { font-size: 17px; }
  .post-list { grid-template-columns: 1fr; }

  /* グロナビ→ハンバーガーに切り替え */
  .nav-toggle-btn { display: block; }
  .global-nav { display: none; width: 100%; }
  .nav-toggle:checked ~ .global-nav { display: block; }
  .global-nav-list { flex-direction: column; gap: 0; border-top: 1px solid var(--border); padding: 8px 0; }
  .global-nav-list a { padding: 12px 8px; }
}
