/* Save Our Family Farms — campaign data.
   ⚠ Per-state bankruptcy figures are ILLUSTRATIVE PLACEHOLDERS pending
   real PACER / Courtlistener + Federal Reserve farm-credit data.
   National figures are from the campaign plan (2025–26). */

// US state tile-grid layout (col x 0–10, row y 0–7) — a cartogram, not geography.
// Roughly west→east, north→south. 50 states.
const TILE = {
  AK:[0,0], ME:[10,0],
  VT:[9,1], NH:[10,1],
  WA:[0,2], ID:[1,2], MT:[2,2], ND:[3,2], MN:[4,2], WI:[5,2], MI:[6,2], NY:[8,2], MA:[9,2], RI:[10,2],
  OR:[0,3], NV:[1,3], WY:[2,3], SD:[3,3], IA:[4,3], IL:[5,3], IN:[6,3], OH:[7,3], PA:[8,3], NJ:[9,3], CT:[10,3],
  CA:[0,4], UT:[1,4], CO:[2,4], NE:[3,4], MO:[4,4], KY:[5,4], WV:[6,4], VA:[7,4], MD:[8,4], DE:[9,4],
            AZ:[1,5], NM:[2,5], KS:[3,5], AR:[4,5], TN:[5,5], NC:[6,5], SC:[7,5],
  HI:[0,6],                     OK:[3,6], LA:[4,6], MS:[5,6], AL:[6,6], GA:[7,6],
                                TX:[3,7],                               FL:[7,7],
};

// Full state names (for labels)
const NAME = {
  AK:"Alaska", AL:"Alabama", AR:"Arkansas", AZ:"Arizona", CA:"California", CO:"Colorado",
  CT:"Connecticut", DE:"Delaware", FL:"Florida", GA:"Georgia", HI:"Hawaii", IA:"Iowa",
  ID:"Idaho", IL:"Illinois", IN:"Indiana", KS:"Kansas", KY:"Kentucky", LA:"Louisiana",
  MA:"Massachusetts", MD:"Maryland", ME:"Maine", MI:"Michigan", MN:"Minnesota", MO:"Missouri",
  MS:"Mississippi", MT:"Montana", NC:"North Carolina", ND:"North Dakota", NE:"Nebraska",
  NH:"New Hampshire", NJ:"New Jersey", NM:"New Mexico", NV:"Nevada", NY:"New York",
  OH:"Ohio", OK:"Oklahoma", OR:"Oregon", PA:"Pennsylvania", RI:"Rhode Island",
  SC:"South Carolina", SD:"South Dakota", TN:"Tennessee", TX:"Texas", UT:"Utah",
  VA:"Virginia", VT:"Vermont", WA:"Washington", WI:"Wisconsin", WV:"West Virginia",
  WY:"Wyoming",
};

// The 9 target states + their senators. `bk` = year-over-year change in
// bankruptcies. `metric`: "farm" = farm-specific Chapter 12 filings (AFBF /
// U.S. Courts, 2024→2025); "total" = all bankruptcy filings for the state
// (2024→2025, from state_bankruptcy_increase_2020-2026.xlsx). Two different
// measures — labeled distinctly in the UI so they're never conflated.
const TARGETS = {
  SD:{ bk:200, metric:"farm", senators:[{ name:"John Thune", party:"R", note:"Senate Majority Leader; introduced the Fertilizer Transparency Act." }],
       hook:"Chapter 12 farm filings tripled in 2025 — soybean country, after three straight years of losses since China stopped buying.",
       points:[
         "I'm a constituent from South Dakota, and I'm asking Senator Thune to fight for family-farm relief in the Farm Bill.",
         "Chapter 12 farm bankruptcies in South Dakota tripled in 2025 — our soybean growers are on their third straight year of losses.",
         "As Majority Leader, Senator Thune controls the Senate floor — he can bring tariff-relief measures up for a vote.",
         "Please make farmers whole for tariff-driven losses we did not cause.",
         "The Fertilizer Transparency Act is a good start, but growers need relief that reaches them this season.",
         "South Dakota's farm economy can't survive another year of selling below the cost of production."] },
  IA:{ bk:220, metric:"farm", senators:[{ name:"Chuck Grassley", party:"R", note:"Pushed to exempt potash from tariffs; member, Senate Agriculture Committee." }],
       hook:"Chapter 12 farm filings tripled to 18 in 2025 — corn and soybeans now cost more to grow than they sell for.",
       points:[
         "I'm a constituent from Iowa, calling to ask Senator Grassley to stand up for family farms in the Farm Bill.",
         "Iowa's Chapter 12 farm bankruptcies jumped to 18 in 2025 — corn and soybeans now cost more to grow than they sell for.",
         "Senator Grassley sits on the Agriculture Committee — he is writing this bill right now.",
         "Thank him for pushing to exempt potash from tariffs, and ask him to finish the job on all farm inputs.",
         "Please require USDA to account for tariff-driven losses when it calculates relief.",
         "Iowa families need help before spring planting — not after another year in the red."] },
  ND:{ bk:9.3, metric:"total", senators:[{ name:"John Hoeven", party:"R", note:"Leads the Senate Appropriations USDA subcommittee." }],
       hook:"Input costs outran commodity prices for a second straight season.",
       points:[
         "I'm a constituent from North Dakota, asking Senator Hoeven to protect family farms in the Farm Bill.",
         "Bankruptcies in North Dakota rose more than 9% last year as input costs outran commodity prices.",
         "Senator Hoeven leads the USDA appropriations subcommittee — he controls the funding that delivers relief.",
         "Please fully fund farm assistance that makes growers whole for tariff losses.",
         "A second straight season of losses is pushing multi-generation farms toward foreclosure.",
         "North Dakota needs relief that arrives in time for the next crop year."] },
  NC:{ bk:14.3, metric:"total", senators:[{ name:"Thom Tillis", party:"R", note:"Said farmers are \u201cone crop away from bankruptcy.\u201d" }],
       hook:"Helene recovery stalled — families can\u2019t rebuild while fuel and fertilizer climb.",
       points:[
         "I'm a constituent from North Carolina, urging Senator Tillis to back farm relief in the Farm Bill.",
         "Bankruptcies here rose more than 14% last year — and Helene recovery has stalled while fuel and fertilizer climb.",
         "Senator Tillis said farmers are 'one crop away from bankruptcy' — now is the time to act on that.",
         "Please support disaster aid plus tariff-loss relief for North Carolina farms.",
         "Families still rebuilding from the storm can't absorb another cost shock.",
         "Please vote yes on making growers whole for losses they did not cause."] },
  KY:{ bk:5.9, metric:"total", senators:[{ name:"Rand Paul", party:"R", note:"Warned tariffs could \u201cdecimate\u201d the GOP." }, { name:"Mitch McConnell", party:"R", note:"Opposed tariffs in Senate votes; Senate Appropriations." }],
       hook:"Small towns watching young people leave as farms and businesses close.",
       points:[
         "I'm a constituent from Kentucky, asking Senators Paul and McConnell to defend family farms in the Farm Bill.",
         "Bankruptcies in Kentucky rose nearly 6% last year as small towns watch farms and businesses close.",
         "Senator Paul warned tariffs could 'decimate' the rural economy — please back relief now.",
         "Senator McConnell has opposed these tariffs in Senate votes — please deliver relief for Kentucky growers.",
         "Please support making farmers whole for tariff-driven losses.",
         "Kentucky's rural communities are losing the next generation — relief can't wait."] },
  TX:{ bk:22.7, metric:"total", senators:[{ name:"Ted Cruz", party:"R", note:"Called tariffs \u201ca tax on consumers.\u201d" }],
       hook:"The steepest jump of any target state — fuel, feed, equipment and fertilizer costs are all up.",
       points:[
         "I'm a constituent from Texas, asking Senator Cruz to stand up for family farms and ranches.",
         "Bankruptcies in Texas jumped nearly 23% last year — the steepest rise of any of our target states.",
         "Senator Cruz called tariffs 'a tax on consumers' — those same tariffs are taxing our farmers.",
         "Please support tariff-loss relief and lower input costs for Texas producers.",
         "Fuel, feed, equipment, and fertilizer are all up — ranchers can't pay their bills.",
         "Please vote for relief that reaches Texas farms this year."] },
  AR:{ bk:106, metric:"farm", senators:[{ name:"John Boozman", party:"R", note:"Chair, Senate Agriculture Committee; Senate Appropriations." }],
       hook:"The nation\u2019s top rice state led the country in farm bankruptcies — 33 Chapter 12 filings, more than double 2024.",
       points:[
         "I'm a constituent from Arkansas, urging Senator Boozman to protect family farms in the Farm Bill.",
         "Arkansas led the nation in farm bankruptcies — 33 Chapter 12 filings in 2025, more than double the year before.",
         "Senator Boozman chairs the Agriculture Committee — he holds the pen on this bill.",
         "Please make tariff-loss relief a centerpiece of the Farm Bill.",
         "Rice and poultry producers are squeezed from both sides — prices down, costs up.",
         "Arkansas can't lead the nation in farm bankruptcies two years running."] },
  ME:{ bk:20.9, metric:"total", senators:[{ name:"Susan Collins", party:"R", note:"Sided with Democrats on tariffs; Chair, Senate Appropriations." }],
       hook:"Farm families fall deeper into debt in an already-strained rural economy.",
       points:[
         "I'm a constituent from Maine, asking Senator Collins to fight for family farms in the Farm Bill.",
         "Bankruptcies in Maine rose nearly 21% last year as farm families fall deeper into debt.",
         "Senator Collins chairs the Appropriations Committee — she controls the funding for farm relief.",
         "Thank her for siding with farmers against these tariffs, and ask her to fund relief that reaches them.",
         "Maine's small farms run on thin margins that this cost spike has erased.",
         "Please make growers whole for losses they did not cause."] },
};

// National headline stats. Verified against USDA ERS, AFBF / U.S. Courts, and
// Federal Reserve Bank of Kansas City data (June 2026).
const NATIONAL = {
  cropLosses: "$34.6B",            // AFBF / USDA Commodity Costs & Returns — nine principal crops, 2025/26 net of total cost
  bankruptcySurge: "46%",          // AFBF / U.S. Courts — 315 filings, up from 216
  farmDebt: "$624.7B",             // USDA ERS — record total farm debt, 2026
  interestExpense: "$33B",         // USDA ERS — record sector interest expense, 2026
  operatingLoanSize: "30%",        // KC Fed — larger average operating loan vs. 2024
  newOperatingLoans: "40%",        // KC Fed — more new operating loans, late 2025
};

window.SOFF_DATA = { TILE, NAME, TARGETS, NATIONAL };
