/* 農業用ドローン一覧のスタイル。
   ★ 姉妹サイトのCSSを流用していない（過去に流用ファイルの痕跡が本番に出たため）★
   配色はまとめてくらべて 農業共通の「土と若葉」。変数名も4サイトでそろえている。
   色は :root（白い画面）と、黒い画面（data-theme="dark"／端末がダークで未指定）の変数だけで持つ。
   黒い画面の地は theme.js の DARK_BG と揃えること。 */

:root {
  --bg: #faf7f0;
  --panel: #ffffff;
  --soft: #f1ebdd;
  --ink: #2b241b;
  --ink-weak: #6b6255;
  --line: #e2d9c8;
  --line-soft: #ece4d4;
  --main: #4a3520;
  --main-2: #654a2e;
  --accent: #9cc046;
  --accent-ink: #24301a;
  --on-main: #ffffff;
  --f-head: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  /* ★ 本文に Noto Sans JP を入れない ★ 700/900 しか読まないので、和文がその字で太字に組まれる */
  --f-body: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #1b1611;
  --panel: #241d16;
  --soft: #2a221a;
  --ink: #ece4d6;
  --ink-weak: #a99c88;
  --line: #3a3226;
  --line-soft: #30291f;
  --main: #5a4128;
  --main-2: #6e5233;
  --accent: #a9cc55;
  --accent-ink: #1f2a12;
  --on-main: #ffffff;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #1b1611;
    --panel: #241d16;
    --soft: #2a221a;
    --ink: #ece4d6;
    --ink-weak: #a99c88;
    --line: #3a3226;
    --line-soft: #30291f;
    --main: #5a4128;
    --main-2: #6e5233;
    --accent: #a9cc55;
    --accent-ink: #1f2a12;
    --on-main: #ffffff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  line-height: 1.75;
  font-size: 16px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 64px; }

/* 本文のリンクは文字色＋下線。若草は白い画面では文字として読めないので、線にだけ使う */
a { color: var(--ink); text-decoration-color: var(--main-2); text-underline-offset: 3px; }
:root[data-theme="dark"] a { text-decoration-color: var(--accent); }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

h1, h2, h3 { font-family: var(--f-head); font-weight: 900; }

/* ---------- 名乗り（「農業」札＋文字。ハブへのリンク） ---------- */
.agri-name {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-head); font-weight: 700; font-size: 13px;
  color: var(--ink); text-decoration: none;
}
.agri-name b {
  background: var(--accent); color: var(--accent-ink);
  font-weight: 900; padding: 0 6px; border-radius: 3px; line-height: 1.6;
}
.agri-name:hover { text-decoration: underline; }
.page-name { margin-bottom: 14px; }

/* ---------- 看板（トップだけ） ---------- */
.hero {
  position: relative;
  height: clamp(180px, 30vw, 340px);
  margin: 0 0 22px;
  border-radius: 6px;
  overflow: hidden;
  color: #ffffff;
  background: #4a3520;
  font-family: var(--f-head);
}
.hero picture, .hero-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.hero-img { object-fit: cover; object-position: center 38%; display: block; }
/* 下から焦げ茶。SNSカードと同じ向き */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, rgba(58,40,22,.93) 0%, rgba(58,40,22,.8) 30%, rgba(58,40,22,.28) 60%, rgba(58,40,22,.08) 80%, rgba(58,40,22,0) 100%);
}
/* 下端の若草の細帯 */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; z-index: 2;
  background: var(--accent);
}
.hero .agri-name {
  position: absolute; z-index: 3; top: 12px; left: 16px;
  color: #ffffff; background: rgba(58,40,22,.88);
  padding: 3px 10px 3px 3px; border-radius: 4px;
}
.hero-body {
  position: absolute; z-index: 3; left: 16px; right: 16px; bottom: clamp(16px, 3vw, 30px);
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: .01em;
  text-shadow: 0 2px 6px rgba(0,0,0,.45);
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero h1 .h1-pre { display: block; font-size: .5em; font-weight: 700; color: #ffffff; }
.hero h1 .h1-sub { font-size: .52em; font-weight: 700; margin-left: .35em; color: #ffffff; }
.hero-bar {
  display: inline-block; margin: 0;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--f-head); font-weight: 900; font-size: clamp(13px, 2vw, 18px);
  padding: 2px 12px; border-radius: 3px;
}
@media (min-width: 720px) {
  .hero .agri-name { top: 18px; left: 26px; font-size: 14px; }
  .hero-body { left: 26px; right: 26px; }
}

/* ---------- 下層ページの見出し ---------- */
.page-head { margin-bottom: 22px; }
.ph-body { min-width: 0; }

h1 { font-size: 25px; margin: 0 0 6px; line-height: 1.4; letter-spacing: .01em; }
/* 見出しは左に焦げ茶の縦線 */
h2 {
  font-size: 19px; margin: 34px 0 12px; line-height: 1.45;
  display: flex; align-items: center; gap: 10px;
}
h2::before { content: ""; flex: 0 0 6px; align-self: stretch; background: var(--main); border-radius: 1px; }
:root[data-theme="dark"] h2::before { background: var(--accent); }
.lead { margin: 0; color: var(--ink-weak); font-size: 14px; }
.lead-top { margin: 0 0 18px; color: var(--ink-weak); font-size: 14px; }

.notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--main);
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 14px;
  margin: 18px 0;
}
:root[data-theme="dark"] .notice { border-left-color: var(--accent); }
.notice strong { font-weight: 700; }

.terms { margin: 0; padding-left: 1.2em; font-size: 15px; }
.terms li { margin: 4px 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--main);
  border-radius: 4px;
  padding: 14px 16px;
}

.filters { display: grid; gap: 12px; }
.fgroup { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.fgroup > span { font-size: 13px; color: var(--ink-weak); min-width: 7.5em; }
.opts { display: flex; gap: 6px; flex-wrap: wrap; }
.opts button {
  font: inherit;
  font-size: 13px;
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.opts button:hover { border-color: var(--main-2); }
.opts button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.count { margin: 12px 0 0; font-size: 13px; color: var(--ink-weak); }

.legend { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--ink-weak); margin: 14px 0; }
.legend-swatch {
  flex: 0 0 auto; width: 15px; height: 15px; margin-top: 4px;
  background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--accent);
}

/* ---------- 表：見出し帯は焦げ茶・白文字／偶数行は淡い面／罫は --line ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th {
  position: sticky; top: 0;
  background: var(--main);
  color: var(--on-main);
  border-bottom: 1px solid var(--main);
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
/* 播種に使えるとメーカーが書いている行：左に若草の線（偶数行の面と混ざらないよう、面ではなく線で示す） */
tbody tr.is-seeding td:first-child { box-shadow: inset 5px 0 0 var(--accent); }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.maker { color: var(--ink-weak); white-space: nowrap; }
.model { font-weight: 700; }
.tagline { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.tag { font-size: 11px; padding: 0 6px; border-radius: 3px; background: var(--bg); border: 1px solid var(--line); color: var(--ink-weak); }
.dash { color: var(--ink-weak); }
td.src a { font-size: 13px; white-space: nowrap; }

/* 狭い画面では見出し行を消し、1機ぶんをカードとして縦に積む（一覧の表だけ。説明ページの小さな表はそのまま） */
@media (max-width: 700px) {
  .table-scroll { border: none; background: transparent; }
  .table-scroll table, .table-scroll thead, .table-scroll tbody, .table-scroll tr, .table-scroll td { display: block; width: 100%; }
  .table-scroll thead { display: none; }
  .table-scroll tbody tr {
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 4px solid var(--main);
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 4px 2px;
  }
  .table-scroll tbody tr.is-seeding { border-top-color: var(--accent); }
  .table-scroll tbody tr.is-seeding td:first-child { box-shadow: none; }
  .table-scroll td { border-bottom: none; padding: 4px 12px; display: flex; gap: 12px; justify-content: space-between; }
  .table-scroll td::before { content: attr(data-label); color: var(--ink-weak); font-size: 12px; flex: 0 0 auto; }
  .table-scroll td.model-cell { display: block; padding-top: 8px; }
  .table-scroll td.model-cell::before { display: none; }
  .table-scroll td.maker { padding-top: 8px; }
  .table-scroll td.num { text-align: right; }
}

/* ---------- 画面の色 ---------- */
.theme-switch { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin: 30px 0 0; }
.theme-switch .ts-label { font-size: 12px; color: var(--ink-weak); margin-right: 4px; }
.theme-switch button {
  font: inherit; font-size: 12px; padding: 3px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--ink-weak); cursor: pointer;
}
.theme-switch button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }

footer { margin-top: 34px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; }
.brand-line { color: var(--ink-weak); text-decoration: none; }
.brand-line:hover { text-decoration: underline; }

/* 説明ページ用 */
.prose { font-size: 15px; }
.prose h2 { margin-top: 30px; }
.prose p { margin: 12px 0; }
.prose table { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; margin: 14px 0; }
.prose th { background: var(--main); color: var(--on-main); font-size: 13px; font-weight: 700; border-bottom-color: var(--main); }
@media (max-width: 700px) { .prose table { display: block; overflow-x: auto; } .prose th, .prose td { padding: 7px 9px; } }

/* 型式そのものが公式ページへのリンク（出典の列は置かない） */
a.model { font-weight: 700; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
a.model:hover { border-bottom: 2px solid var(--accent); }

/* パンくず・ページ間のリンク */
.crumbs { font-size: 13px; color: var(--ink-weak); margin-bottom: 18px; }
.crumbs a { color: var(--ink-weak); }
.siblings { margin-top: 34px; }
.terms-link { font-size: 15px; margin: 18px 0; }

/* ===== 補助金のページ（hojokin / hojokin-chui）===== */
/* 字を読ませずに分からせる：結論の箱・番号つきの手順・自分はどれ？のカード・確かめる項目 */
.checked { font-size: 13px; color: var(--ink-weak); margin: 0 0 16px; }
.summary {
  background: var(--soft);
  border-radius: 6px;
  padding: 14px 18px;
  margin: 0 0 8px;
}
.summary-title { font-family: var(--f-head); font-weight: 900; margin: 0 0 6px; font-size: 16px; }
.summary ul { margin: 0; padding-left: 1.2em; }
.summary li { margin: 4px 0; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px 12px 58px;
  margin: 0 0 10px;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--main); color: var(--on-main);
  font: 900 17px/32px var(--f-head); text-align: center;
}
.steps b { display: block; font-family: var(--f-head); font-size: 16px; }
.steps span { display: block; font-size: 14px; color: var(--ink-weak); }
.steps li.stop { border: 2px solid var(--main); background: var(--soft); }
.steps li.stop span { color: var(--ink); }
:root[data-theme="dark"] .steps li.stop { border-color: var(--accent); }

.who { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.who .card { display: flex; flex-direction: column; }
.who h3 { margin: 0 0 6px; font-size: 16px; font-family: var(--f-head); }
.who p { margin: 0 0 10px; font-size: 14px; flex: 1; }
.who a { font-size: 14px; font-weight: 700; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative;
  padding: 12px 4px 12px 38px;
  border-bottom: 1px solid var(--line);
}
.checklist li::before {
  content: ""; position: absolute; left: 6px; top: 15px;
  width: 18px; height: 18px; border: 2px solid var(--main); border-radius: 3px;
}
:root[data-theme="dark"] .checklist li::before { border-color: var(--accent); }
.checklist span { display: block; font-size: 14px; color: var(--ink-weak); }
.more { margin: 12px 0 0; font-weight: 700; }

/* まとめてくらべて 農業（ハブ）への案内：全ページの本文の終わりに置く */
.agri-cta { margin: 32px 0 8px; }
.agri-cta a { display: block; padding: 16px 20px; border-radius: 10px; background: var(--main); color: var(--on-main); text-decoration: none; border-left: 6px solid var(--accent); }
.agri-cta a:hover, .agri-cta a:focus-visible { filter: brightness(1.12); }
.agri-cta-sub { display: block; font-size: 13px; opacity: .85; }
.agri-cta-main { display: block; font-family: var(--f-head); font-weight: 900; font-size: 17px; margin-top: 2px; }

/* ページの先頭へ戻る「↑」：右下に固定。JS が動いたら少しスクロールしてから出す（JS 無しでは常に出して href="#" で戻る） */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--main); color: var(--on-main); border: 2px solid var(--accent);
  font: 900 20px/1 var(--f-head); text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  transition: opacity .2s, visibility .2s;
}
.to-top:hover, .to-top:focus-visible { filter: brightness(1.12); }
.js-to-top .to-top:not(.is-shown) { opacity: 0; visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
@media print { .to-top { display: none; } }
