/* ふるさと納税（bichikulife.net/furusato-nozei/）。ほかの独立したコンテンツ（保存食・海外通販など）と同じ作り */
:root {
  --ink: #2b2a26;
  --muted: #6f6a5f;
  --paper: #fbf9f4;
  --paper-2: #f3efe5;
  --line: #e2dccd;
  --accent: #3f6f4f;
  --accent-2: #b5562c;
  --serif: 'Shippori Mincho B1', 'Hiragino Mincho ProN', serif;
  --sans: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --w: 760px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.5; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: var(--w); margin: 0 auto; padding: 0 16px; }

/* ヘッダー・フッター */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.bar { display: flex; align-items: center; gap: 14px; min-height: 56px; }
.logo { font-family: var(--serif); font-weight: 700; font-size: 20px; letter-spacing: .08em; color: var(--ink); text-decoration: none; }
.section { padding-left: 14px; border-left: 1px solid var(--line); color: var(--accent); font-weight: 700; font-size: 14px; text-decoration: none; }
.gnav { display: flex; gap: 4px 18px; padding-bottom: 10px; overflow-x: auto; font-size: 13px; white-space: nowrap; }
.gnav a { color: var(--muted); text-decoration: none; }
.gnav a:hover { color: var(--accent); }
.site-footer { margin-top: 96px; padding: 40px 0 48px; background: var(--paper-2); border-top: 1px solid var(--line); }
.f-logo { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 20px; }
.f-logo a { color: var(--ink); text-decoration: none; }
.f-copy { margin: 4px 0 20px; color: var(--muted); font-size: 14px; }
.f-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 14px; }
.f-small { margin: 0 0 8px; color: var(--muted); font-size: 12px; }

.breadcrumbs { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--muted); }
.breadcrumbs li + li::before { content: '›'; margin-right: 8px; }
.breadcrumbs a { color: inherit; }
.breadcrumbs-bottom .breadcrumbs { margin-top: 40px; }

/* 見出し */
.head { margin: 28px 0 8px; }
.kind { display: inline-block; margin: 0 0 10px; padding: 0 10px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; line-height: 1.9; text-decoration: none; }
.kind:hover { color: #fff; opacity: .9; }
h1 { margin: 0; font-family: var(--serif); font-size: clamp(26px, 6vw, 36px); }
h1 small { display: block; margin-top: 4px; color: var(--muted); font-family: var(--sans); font-size: 14px; font-weight: 400; }
.lead { margin: 10px 0 0; color: var(--muted); }
.block { margin-top: 48px; }
.block > h2, .prose h2 { margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); font-family: var(--serif); font-size: 22px; }
.prose h2 { margin-top: 56px; }
.prose h3 { margin: 36px 0 12px; padding-left: 12px; border-left: 4px solid var(--accent); font-size: 18px; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.2em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.note { color: var(--muted); font-size: 13px; }
.small { color: var(--muted); font-size: 13px; }

/* 表 */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; margin: 12px 0 20px; border-collapse: collapse; background: #fff; font-size: 15px; }
table.t th, table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t thead th { background: var(--paper-2); font-size: 13px; }
table.t .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.t tr.me { background: #eef5ef; }

/* 数字のカード */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 18px 0 0; }
.facts div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 2px 0 0; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.4; }
.facts dd small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }

/* グラフ */
.chart { margin: 8px 0 0; }
.chart svg { width: 100%; height: auto; }
.chart .bar { fill: #b9cdbd; }
.chart .bar.last { fill: var(--accent); }
/* スマホでは文字が小さくなりすぎないよう、幅を保って横にスクロールする */
.chart { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart svg { min-width: 540px; }
.chart .grid { stroke: var(--line); }
.chart .base { stroke: var(--muted); }
.chart .axis { fill: var(--muted); font-size: 12px; }
.chart .yr { font-size: 11px; }
.chart-cap { margin: 4px 0 6px; color: var(--muted); font-size: 14px; }
.chart-cap b { color: var(--ink); font-size: 16px; }
/* 受入額・件数の切りかえ */
.chart-switch > input { position: absolute; opacity: 0; }
.chart-switch > label { display: inline-block; margin: 0 4px 6px 0; padding: 4px 14px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: 13px; font-weight: 700; cursor: pointer; }
.chart-switch > input:checked + label { background: var(--accent); color: #fff; }
.chart-switch > input:focus-visible + label { outline: 2px solid var(--accent-2); }
.chart-switch .chart-c { display: none; }
.chart-switch > input:nth-of-type(2):checked ~ .chart-m { display: none; }
.chart-switch > input:nth-of-type(2):checked ~ .chart-c { display: block; }

/* 囲み */
.box { margin: 24px 0; padding: 16px 20px; border-radius: 10px; background: var(--paper-2); }
.box > :first-child { margin-top: 0; }
.box > :last-child { margin-bottom: 0; }
.box.warn { background: #fbefe6; border-left: 4px solid var(--accent-2); }
.box-title { margin: 0 0 6px; font-weight: 700; }

/* リンクの一覧 */
.chips { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0; padding: 0; list-style: none; }
.chips a { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; text-decoration: none; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.chips small { color: var(--muted); }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.cols li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.cols li span { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.cards a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: 13px; text-decoration: none; }
.cards a:hover { border-color: var(--accent); }
.cards b { display: block; margin-bottom: 4px; color: var(--accent); font-size: 16px; }

/* 楽天市場の返礼品 */
.rk-note { color: var(--muted); font-size: 13px; }
/* カードを横に並べる（旧サイトと同じ形）。上に「◯位」の帯、画像、自治体名 → 商品名 → 寄付額 → 星 */
.rk { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px 16px; margin: 0; padding: 0; list-style: none; }
.rk a { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 16px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); transition: box-shadow .2s, transform .2s; }
.rk a:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .14); transform: translateY(-2px); }
.rk-rank { display: block; padding: 10px 0; background: #f47c75; color: #fff; font-size: 24px; font-weight: 700; text-align: center; line-height: 1.3; }
.rk li:nth-child(n+4) .rk-rank { background: #f7a7a1; font-size: 20px; }
.rk-img { display: block; background: #fff; }
.rk-img img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.rk-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 16px 18px 18px; }
.rk-shop { font-size: 15px; font-weight: 700; }
.rk-name { font-size: 15px; font-weight: 700; line-height: 1.7; }
.rk-price { margin-top: auto; color: #e0413b; font-size: 22px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.rk-price small { margin-left: 1px; font-size: 15px; }
.rk-meta { color: var(--muted); font-size: 12px; }
/* レビューの星。--p（点数÷5）のぶんだけ金色に塗る */
.rk-review { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.rk-review b { color: var(--ink); font-variant-numeric: tabular-nums; }
.rk-count { color: var(--muted); font-size: 12px; }
.stars { position: relative; display: inline-block; font-size: 16px; line-height: 1; letter-spacing: 1px; }
.stars::before { content: '★★★★★'; color: #ddd6c8; }
.stars::after { content: '★★★★★'; position: absolute; left: 0; top: 0; width: var(--p); overflow: hidden; white-space: nowrap; color: #f2a516; }
.shop-links { margin: 16px 0 0; }
.shop-links a { display: inline-block; padding: 6px 16px; border-radius: 999px; background: #bf0000; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.shop-links a:hover { color: #fff; opacity: .85; }

/* シェア */
.share { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 56px 0 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.share a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; }
.share .x { background: #111; }
.share .fb { background: #1877f2; font-size: 18px; }
.share .line { background: #06c755; font-size: 10px; }
.share .pin { background: #e60023; font-size: 17px; font-family: Georgia, serif; }

/* 入力（ツール） */
.tool { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.tool .fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }
.tool label { display: grid; gap: 4px; min-width: 0; font-size: 14px; font-weight: 700; }
.tool .u { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 400; white-space: nowrap; }
.tool input, .tool select { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 17px; }
.tool small { color: var(--muted); font-weight: 400; }
.result { margin-top: 16px; padding: 18px 20px; border-radius: 12px; background: var(--paper-2); }
.result .big { margin: 0; }
.result .big b { color: var(--accent-2); font-size: clamp(30px, 8vw, 40px); font-variant-numeric: tabular-nums; }

/* 検索 */
.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 16px; }
.hits { margin: 8px 0 0; padding: 0; list-style: none; }
.hits li a { display: block; padding: 6px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }

@media (max-width: 560px) {
  .rk { grid-template-columns: repeat(2, 1fr); gap: 12px 10px; }
  .rk-rank { padding: 6px 0; font-size: 18px; }
  .rk li:nth-child(n+4) .rk-rank { font-size: 16px; }
  .rk-body { gap: 6px; padding: 10px 12px 12px; }
  .rk-shop { font-size: 12px; }
  .rk-name { font-size: 13px; }
  .rk-price { font-size: 18px; }
  .rk-review { flex-wrap: wrap; font-size: 12px; }
  .stars { font-size: 13px; }
  .facts dd { font-size: 19px; }
}

/* トップの小さなランキング */
.cards-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mini { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mini h3 { margin: 0 0 8px; font-size: 16px; }
.mini ol { margin: 0; padding-left: 1.4em; font-size: 14px; }
.mini li span { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.mini p { margin: 8px 0 0; font-size: 13px; }
.cols li.me { background: #eef5ef; }
details summary { cursor: pointer; color: var(--accent); font-size: 14px; }

/* 右下の「トップへ戻る」ボタン */
.to-top { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 900; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s, transform .25s, visibility .25s, box-shadow .2s; }
.to-top.show { opacity: .9; visibility: visible; transform: none; }
.to-top:hover { opacity: 1; box-shadow: 0 4px 12px rgba(0, 0, 0, .28); }
.to-top:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; opacity: 1; }
main[tabindex='-1']:focus { outline: none; }
@media (max-width: 600px) { .to-top { width: 42px; height: 42px; } }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }

/* 年末の寄付で気をつけること（year-end/） */
.countdown { text-align: center; }
.countdown .big b { font-size: 44px; margin: 0 4px; }
.flow { padding-left: 0 !important; list-style: none; counter-reset: flow; }
.flow li { position: relative; margin: 0 0 14px !important; padding: 12px 14px 12px 52px; border-radius: 10px; background: var(--paper-2); }
.flow li::before { counter-increment: flow; content: counter(flow); position: absolute; left: 14px; top: 12px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; }
.flow b { display: block; color: var(--accent); }
