/* 福井くらしのお金ナビ 共通スタイル */
:root {
  --primary: #0e7c66;
  --primary-dark: #0a5d4d;
  --primary-light: #e6f4f1;
  --accent: #cf6a1a; /* 行動の色: 楽天(アフィリエイト)ボタン .btn-accent 専用。他で使わない(網のデザイン原則④) */
  --accent-light: #fdf1e4;
  --text: #2b3230;
  --text-sub: #5f6b68;
  --bg: #f7faf9;
  --card: #ffffff;
  --border: #dde6e3;
  --danger: #c0392b;
  --radius: 12px;
}

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

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic", Meiryo, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  font-size: 16px;
}

a { color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ヘッダー */
.site-header {
  background: var(--card);
  border-bottom: 3px solid var(--primary);
  padding: 0.7rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-decoration: none;
}
.brand small { font-size: 0.7rem; font-weight: 400; color: var(--text-sub); display: block; line-height: 1.2; }
.site-header nav { display: flex; gap: 1rem; font-size: 0.9rem; }
.site-header nav a { text-decoration: none; display: inline-block; padding: 0.7rem 0.35rem; }

/* メイン */
main { max-width: 860px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.breadcrumb { font-size: 0.8rem; color: var(--text-sub); margin-bottom: 1rem; }
.breadcrumb a { color: var(--text-sub); display: inline-block; padding: 0.5rem 0.1rem; }

h1 { font-size: 1.5rem; color: var(--primary-dark); margin-bottom: 0.8rem; line-height: 1.4; }
h2 { font-size: 1.2rem; margin: 2rem 0 0.8rem; padding-left: 0.6rem; border-left: 4px solid var(--primary); }
h3 { font-size: 1.05rem; margin: 1.2rem 0 0.5rem; }
p { margin-bottom: 0.8rem; }
ul, ol { margin: 0 0 0.8rem 1.4rem; }

.lead { color: var(--text-sub); margin-bottom: 1.5rem; }

/* カード */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

/* ツールカード一覧 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.9rem;
  margin: 1rem 0;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: box-shadow 0.15s, transform 0.15s;
}
.tool-card:hover { box-shadow: 0 4px 14px rgba(14, 124, 102, 0.15); transform: translateY(-2px); color: var(--text); }
.tool-card .tool-icon { font-size: 1.6rem; }
.tool-card h3 { color: var(--primary-dark); margin: 0.3rem 0; font-size: 1rem; }
.tool-card p { font-size: 0.82rem; color: var(--text-sub); margin: 0; }

/* 3本柱 */
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; margin: 1rem 0; }
.pillar {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 1rem;
  display: block;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.15s, transform 0.15s;
}
a.pillar:hover { box-shadow: 0 4px 14px rgba(14, 124, 102, 0.2); transform: translateY(-2px); color: var(--text); }
.pillar h3 { margin-top: 0; color: var(--primary-dark); }
.pillar p { font-size: 0.85rem; margin: 0; }
.pillar .tag { display: inline-block; font-size: 0.72rem; font-weight: 700; background: var(--card); border-radius: 999px; padding: 0.15rem 0.7rem; color: var(--primary-dark); margin-top: 0.5rem; }

/* アンカーで飛んだとき見出しがヘッダーに隠れないように */
h2[id] { scroll-margin-top: 1rem; }

/* フォーム */
.tool-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; margin-bottom: 1.2rem; }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; font-weight: 700; font-size: 0.9rem; margin-bottom: 0.3rem; }
.form-row .note { font-size: 0.78rem; color: var(--text-sub); font-weight: 400; }
input[type="number"], input[type="text"], select {
  width: 100%;
  max-width: 320px;
  padding: 0.6rem 0.7rem;
  font-size: 16px;
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--primary); border-color: var(--primary); }
.input-unit { display: inline-flex; align-items: center; gap: 0.4rem; }
.input-unit input, .input-unit select { width: auto; }

.radio-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.radio-group label {
  font-weight: 400;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.6rem 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  background: #fff;
}
.radio-group input { margin-right: 0.3rem; }
.radio-group label:has(input:checked) { border-color: var(--primary); background: var(--primary-light); font-weight: 700; }

button.calc-btn {
  background: var(--primary);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 2.2rem;
  cursor: pointer;
}
button.calc-btn:hover { background: var(--primary-dark); }
button.sub-btn {
  background: #fff;
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  padding: 0.6rem 1rem;
  min-height: 44px;
  font-size: 0.9rem;
  cursor: pointer;
}
button.sub-btn:hover { background: var(--primary-light); }
button.remove-btn { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1.1rem; padding: 0.5rem 0.7rem; min-width: 44px; min-height: 44px; }

/* 結果表示 */
.result-box {
  background: var(--card);
  border: 1.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin: 1.2rem 0;
}
.result-box.hidden { display: none; }
.result-main { font-size: 0.9rem; }
.result-main .big { font-size: 2rem; font-weight: 700; color: var(--primary-dark); }
.result-sub { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 0.8rem; font-size: 0.85rem; }
.result-sub .item strong { display: block; font-size: 1.2rem; color: var(--text); }

table.result-table { border-collapse: collapse; width: 100%; margin: 0.8rem 0; font-size: 0.88rem; background: #fff; }
table.result-table th, table.result-table td { border: 1px solid var(--border); padding: 0.45rem 0.6rem; text-align: right; }
table.result-table th { background: var(--primary-light); text-align: center; }
table.result-table td:first-child { text-align: center; }
.table-scroll { overflow-x: auto; }

/* 注意書き */
.disclaimer {
  font-size: 0.78rem;
  color: var(--text-sub);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin: 1.5rem 0;
}
.disclaimer strong { color: var(--danger); }

/* 関連リンク・CTA */
.cta-box {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}
.cta-box a { font-weight: 700; display: inline-block; padding: 0.4rem 0; }
.related { margin: 2rem 0 0; }
.related ul { list-style: none; margin-left: 0; }
.related li { margin-bottom: 0.2rem; }
.related li a { display: inline-block; padding: 0.45rem 0; }
.related li::before { content: "▶ "; color: var(--primary); font-size: 0.8rem; }

/* フッター */
.site-footer {
  background: var(--primary-dark);
  color: #dceee9;
  padding: 1.5rem 1rem 2rem;
  font-size: 0.85rem;
  text-align: center;
}
.site-footer a { color: #fff; }
.site-footer nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.6rem 0; }
.site-footer nav a { display: inline-block; padding: 0.6rem 0.2rem; }
.site-footer .copyright { font-size: 0.75rem; color: #cfe6e0; margin-top: 0.8rem; }

@media (max-width: 480px) {
  body { font-size: 15px; }
  h1 { font-size: 1.3rem; }
  .result-main .big { font-size: 1.6rem; }
}

/* 次の一手ボタン(結果画面) */
.next-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; padding-top: 0.9rem; border-top: 1px solid var(--border); }
.next-actions .label { width: 100%; font-size: 0.8rem; color: var(--text-sub); margin-bottom: -0.2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  min-height: 48px; padding: 0.6rem 1.2rem; border-radius: 10px; font-weight: 700;
  text-decoration: none; font-size: 0.95rem; flex: 1 1 220px; text-align: center; line-height: 1.4;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #b45a12; color: #fff; }
.btn-outline { background: #fff; color: var(--primary-dark); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

/* スマホ固定フッターナビ */
.bottom-nav { display: none; }
@media (max-width: 768px) {
  body { padding-bottom: 64px; }
  .site-header nav { display: none; } /* スマホは固定フッターナビに集約 */
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--card); border-top: 1px solid var(--border);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  }
  .bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 60px; text-decoration: none; color: var(--text-sub); font-size: 0.72rem; font-weight: 700; gap: 0.1rem;
  }
  .bottom-nav a .ic { font-size: 1.3rem; line-height: 1; }
}

/* ふるさと納税ランキング(横棒グラフ・1色) */
.rank-bars { list-style: none; margin: 0.6rem 0 0.4rem; }
.rank-bars li { display: grid; grid-template-columns: 2.2rem 6.5rem 1fr; align-items: center; gap: 0.5rem; padding: 0.35rem 0; }
.rank-bars .rk { font-weight: 700; color: var(--text-sub); text-align: center; font-size: 0.85rem; }
.rank-bars .nm { font-size: 0.92rem; }
.rank-bars .nm a { text-decoration: none; font-weight: 700; }
.rank-bars .bar { position: relative; height: 22px; background: var(--primary-light); border-radius: 4px; }
.rank-bars .bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 0 4px 4px 0; }
.rank-bars li:first-child .bar > i { background: var(--primary-dark); }
.rank-bars .val { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; font-size: 0.8rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.rank-bars .val.in { right: 0.5rem; left: auto !important; color: #fff; }
.rank-bars .genre { grid-column: 3; font-size: 0.75rem; color: var(--text-sub); margin-top: -0.25rem; }
details.table-view { margin: 0.4rem 0 1rem; font-size: 0.85rem; }
details.table-view summary { cursor: pointer; color: var(--primary-dark); padding: 0.4rem 0; }

/* 市町カードの色帯 */
.tool-card.city { border-top: 6px solid var(--band, var(--primary)); }
.city-tsuruga { --band: #2b6cb0; }
.city-sabae { --band: #5a6270; }
.city-awara { --band: #d26a8c; }
.city-sakai { --band: #c9a227; }
.city-minamiechizen { --band: #c0392b; }
.city-fukui { --band: #0e7c66; }

/* ジャンル別ガイド チップ */
.genre-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.4rem 0 1.4rem; }
.genre-nav a { display: inline-block; padding: 0.55rem 0.9rem; border: 1.5px solid var(--primary); border-radius: 999px; background: #fff; color: var(--primary-dark); font-weight: 700; font-size: 0.9rem; }
.genre-nav a.cur { background: var(--primary); color: #fff; }

/* 季節枠(assets/seasonal.js が期間内だけ差し込む) */
.seasonal { margin: 1rem 0 1.4rem; }
.seasonal-item { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; padding: 0.8rem 1rem; margin-bottom: 0.5rem;
  background: var(--primary-light); border: 1px solid var(--primary); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.seasonal-item .ic { font-size: 1.4rem; }
.seasonal-item .txt { flex: 1 1 14em; font-size: 0.95rem; }
.seasonal-item strong { color: var(--primary-dark); white-space: nowrap; }
.seasonal-item:hover { background: #d6efe9; }

/* 文章中心の表(越前がに早見表など): 左寄せ・上揃え */
table.text-table { min-width: 560px; }
table.text-table th, table.text-table td { text-align: left; vertical-align: top; }
table.text-table thead th { text-align: center; }
table.text-table tbody th { white-space: nowrap; background: var(--primary-light); font-weight: 700; }

/* 運営者情報: 福井生活情報網のサイト一覧 */
.network-list { list-style: none; margin: 0.6rem 0 1.2rem; padding: 0; }
.network-list li { padding: 0.55rem 0.2rem; border-bottom: 1px solid var(--border); line-height: 1.6; }
.network-list li:last-child { border-bottom: none; }

/* よくある質問(details折りたたみ) */
.faq { margin: 0.6rem 0 1.2rem; }
.faq details { border: 1px solid var(--border); border-radius: 10px; background: #fff; margin-bottom: 0.5rem; padding: 0 0.9rem; }
.faq summary { cursor: pointer; font-weight: 700; padding: 0.7rem 0; color: var(--primary-dark); list-style: none; display: flex; gap: 0.5rem; align-items: flex-start; }
.faq summary::before { content: "＋"; color: var(--primary); flex: 0 0 auto; }
.faq details[open] summary::before { content: "－"; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { margin: 0 0 0.8rem; font-size: 0.93rem; line-height: 1.7; }

/* 3本柱の季節の主役(assets/seasonal.js が .has-main / .is-main を付与) */
.pillars.has-main { grid-template-columns: repeat(2, 1fr); }
.pillars.has-main .pillar.is-main { grid-column: 1 / -1; order: -1; background: var(--card); border: 2px solid var(--primary); padding: 1.3rem 1.2rem; }
.pillars.has-main .pillar.is-main h3 { font-size: 1.35rem; }
.pillars.has-main .pillar.is-main p { font-size: 0.95rem; }
.pillars.has-main .pillar.is-main .tag { background: var(--primary); color: #fff; font-size: 0.85rem; padding: 0.45rem 1rem; margin-top: 0.8rem; }
.pillars.has-main .pillar:not(.is-main) { padding: 0.75rem 0.85rem; }
.pillars.has-main .pillar:not(.is-main) h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.pillars.has-main .pillar:not(.is-main) p { font-size: 0.78rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pillars.has-main .pillar:not(.is-main) .tag { font-size: 0.7rem; border-radius: 8px; line-height: 1.45; padding: 0.25rem 0.55rem; }
