/* 福井くらしのお金ナビ 共通スタイル */
:root {
  --primary: #0e7c66;
  --primary-dark: #0a5d4d;
  --primary-light: #e6f4f1;
  --accent: #e8842c;
  --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; }

/* メイン */
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); }

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.55rem 0.7rem;
  font-size: 1rem;
  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.35rem 0.9rem;
  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);
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  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.2rem 0.5rem; }

/* 結果表示 */
.result-box {
  background: var(--accent-light);
  border: 2px solid var(--accent);
  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(--accent); }
.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; }
.related { margin: 2rem 0 0; }
.related ul { list-style: none; margin-left: 0; }
.related li { margin-bottom: 0.4rem; }
.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: 1.2rem; margin: 0.6rem 0; }
.site-footer .copyright { font-size: 0.75rem; color: #a8cfc6; margin-top: 0.8rem; }

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