/* すまい算 共通スタイル（外部フォント・外部リソースなし） */
:root {
  --text: #222;
  --muted: #5b6470;
  --bg: #fff;
  --line: #d9dee5;
  --accent: #1d5a8a;
  --accent-soft: #eef4f9;
  --pr-bg: #fff3d6;
  --pr-border: #e0a100;
  --pr-text: #7a4b00;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.85;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ヘッダー・ナビ */
.site-header {
  border-bottom: 1px solid var(--line);
  padding: 14px 0 0;
}

.site-name {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.4;
}

.site-name a { color: var(--accent); text-decoration: none; }

.site-tagline {
  margin: 0 0 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

nav a {
  display: inline-block;
  padding: 8px 0;
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

nav a:hover,
nav a:focus { border-bottom-color: var(--accent); }

/* 本文 */
main { padding: 24px 0 40px; }

h1 {
  font-size: 1.5rem;
  line-height: 1.5;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.5;
  margin: 2.4em 0 0.8em;
  padding: 0 0 6px;
  border-bottom: 2px solid var(--accent);
}

h3 {
  font-size: 1.05rem;
  margin: 1.8em 0 0.6em;
}

p { margin: 0 0 1.1em; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.4em; }

li { margin-bottom: 0.4em; }

a { color: var(--accent); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.92em;
}

/* PR表記（広告であることを目立たせる） */
.pr-notice {
  margin: 0 0 20px;
  padding: 10px 14px;
  background: var(--pr-bg);
  border: 2px solid var(--pr-border);
  border-radius: 4px;
  color: var(--pr-text);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* 広告枠 */
.ad-slot {
  margin: 24px 0;
  padding: 18px 14px;
  text-align: center;
  background: #fafafa;
  border: 1px dashed var(--pr-border);
  color: var(--pr-text);
  font-size: 0.9rem;
}

.ad-slot::before {
  content: "PR ";
  font-weight: 700;
}

/* 自社ツール枠（広告ではないので「PR」は付けない） */
.tool-slot {
  margin: 24px 0;
  padding: 18px 14px;
  text-align: center;
  background: #fafafa;
  border: 1px dashed var(--pr-border);
  color: var(--pr-text);
  font-size: 0.9rem;
}

.tool-slot small {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

/* 結論ボックス */
.answer {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 12px 14px;
  margin: 0 0 1.4em;
}

.answer p:last-child { margin-bottom: 0; }

/* 表：横スクロール */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 0 1.4em;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 0.9rem;
  line-height: 1.6;
}

th, td {
  border: 1px solid var(--line);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}

th { background: var(--accent-soft); font-weight: 700; }

td.num, th.num { text-align: right; white-space: nowrap; }

tr.group th {
  background: #e2ecf4;
  text-align: left;
}

/* 数式・計算 */
.formula {
  background: #f6f7f9;
  border: 1px solid var(--line);
  padding: 10px 14px;
  margin: 0 0 1.1em;
  overflow-x: auto;
}

/* 記事一覧 */
.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.article-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.article-list .title { font-weight: 700; }

.article-list .desc {
  display: block;
  margin-top: 4px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

.pending {
  color: var(--muted);
  text-decoration: none;
  cursor: default;
}

/* 出典 */
.sources {
  margin-top: 2.4em;
  padding: 14px;
  background: #f6f7f9;
  border: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.7;
}

.sources h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.sources li { overflow-wrap: anywhere; }

.disclaimer-box {
  margin-top: 2em;
  padding: 12px 14px;
  border: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.7;
}

.meta {
  font-size: 0.85rem;
  color: var(--muted);
}

/* フッター */
footer {
  border-top: 1px solid var(--line);
  padding: 20px 0 32px;
  font-size: 0.85rem;
  color: var(--muted);
}

footer ul {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

footer p { margin: 0; }

footer .affiliate-note { margin-bottom: 4px; }

@media (max-width: 480px) {
  body { font-size: 15.5px; }
  h1 { font-size: 1.35rem; }
}

/* 2026-10-20: アフィリエイトリンク未設置のため、広告枠と冒頭PR表記を一時非表示。
   ASP 提携後にリンクを入れたら、この2行を削除して戻す。 */
.ad-slot, .pr-notice { display: none; }
