Income Taxes (Tables)
   | 
12 Months Ended | 
Dec. 31, 2022  | 
| Income Tax Disclosure [Abstract] | 
 
 | 
| Schedule of provision for income taxes | 
  
    |   | 
  | 
    Years Ended December 31, | 
  | 
 
  
    |   | 
  | 
    2022 | 
  | 
  | 
    2021 | 
  | 
  | 
    2020 | 
  | 
 
  
    | Current provision (benefit) | 
  | 
    $ | 
1,925 | 
  | 
  | 
    $ | 
1,469 | 
  | 
  | 
    $ | 
—  | 
  | 
 
  
    | Deferred provision (benefit) | 
  | 
      | 
—  | 
  | 
  | 
      | 
—  | 
  | 
  | 
      | 
(17 | 
) | 
 
  
    | Total | 
  | 
    $ | 
1,925 | 
  | 
  | 
    $ | 
1,469 | 
  | 
  | 
    $ | 
(17 | 
) | 
 
   
  
 | 
| Schedule of reconciliation of effective tax rate | 
  
    |   | 
  | 
    Years Ended December 31, | 
  | 
 
  
    |   | 
  | 
    2022 | 
  | 
  | 
    2021 | 
  | 
  | 
    2020 | 
  | 
 
  
    | Statutory rate | 
  | 
      | 
21.0 | 
% | 
  | 
      | 
21.0 | 
% | 
  | 
      | 
21.0 | 
% | 
 
  
    | State income taxes, net of federal benefit | 
  | 
      | 
5.8 | 
  | 
  | 
      | 
6.0 | 
  | 
  | 
      | 
5.7 | 
  | 
 
  
    | Change in valuation allowance | 
  | 
      | 
(33.9 | 
) | 
  | 
      | 
(18.8 | 
) | 
  | 
      | 
(9.4 | 
) | 
 
  
    | Stock-based compensation | 
  | 
      | 
3.1 | 
  | 
  | 
      | 
—  | 
  | 
  | 
      | 
—  | 
  | 
 
  
    | Non-deductible items | 
  | 
      | 
(1.6 | 
) | 
  | 
      | 
0.4 | 
  | 
  | 
      | 
(0.4 | 
) | 
 
  
    | Income from loan forgiveness | 
  | 
      | 
—  | 
  | 
  | 
      | 
(5.5 | 
) | 
  | 
      | 
—  | 
  | 
 
  
    | Fair value adjustments | 
  | 
      | 
—  | 
  | 
  | 
      | 
—  | 
  | 
  | 
      | 
(12.7 | 
) | 
 
  
    | Noncontrolling interest | 
  | 
      | 
—  | 
  | 
  | 
      | 
—  | 
  | 
  | 
      | 
(3.4 | 
) | 
 
  
    | Other | 
  | 
      | 
0.6 | 
  | 
  | 
      | 
(0.1 | 
) | 
  | 
      | 
(0.8 | 
) | 
 
  
    | Effective rate | 
  | 
      | 
(5.0 | 
)% | 
  | 
      | 
3.0 | 
% | 
  | 
      | 
(0.0 | 
)% | 
 
   
  
 | 
| Schedule of components of deferred income taxes | 
  
    |   | 
  | 
    December 31, | 
  | 
 
  
    |   | 
  | 
    2022 | 
  | 
  | 
    2021 | 
  | 
 
  
    | Deferred tax assets: | 
  | 
      | 
  | 
  | 
      | 
  | 
 
  
    |   Net operating loss carryforwards | 
  | 
    $ | 
58,131 | 
  | 
  | 
    $ | 
46,159 | 
  | 
 
  
    |   Capital loss | 
  | 
      | 
26,043 | 
  | 
  | 
      | 
28,640 | 
  | 
 
  
    |   Disallowed interest | 
  | 
      | 
2,395 | 
  | 
  | 
      | 
1,059 | 
  | 
 
  
    |   R&D, Energy and AMT credits | 
  | 
      | 
3,742 | 
  | 
  | 
      | 
3,742 | 
  | 
 
  
    | Pension liability | 
  | 
      | 
1,354 | 
  | 
  | 
      | 
2,189 | 
  | 
 
  
    |   Railcar contracts | 
  | 
      | 
786 | 
  | 
  | 
      | 
618 | 
  | 
 
  
    | Stock-based compensation | 
  | 
      | 
634 | 
  | 
  | 
      | 
479 | 
  | 
 
  
    |   Derivatives | 
  | 
      | 
460 | 
  | 
  | 
      | 
—  | 
  | 
 
  
    |   Allowance for credit losses and other assets | 
  | 
      | 
311 | 
  | 
  | 
      | 
367 | 
  | 
 
  
    |   Intangibles | 
  | 
      | 
89 | 
  | 
  | 
      | 
—  | 
  | 
 
  
    | Other | 
  | 
      | 
3,208 | 
  | 
  | 
      | 
2,646 | 
  | 
 
  
    | Total gross deferred tax assets | 
  | 
      | 
97,153 | 
  | 
  | 
      | 
85,899 | 
  | 
 
  
    | Less: valuation allowance | 
  | 
      | 
(87,949 | 
) | 
  | 
      | 
(75,584 | 
) | 
 
  
    | Total deferred tax assets, net of valuation allowance | 
  | 
      | 
9,204 | 
  | 
  | 
      | 
10,315 | 
  | 
 
  
    |   | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
  
    | Deferred tax liabilities: | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
  
    | Property and equipment | 
  | 
      | 
(9,125 | 
) | 
  | 
      | 
(8,896 | 
) | 
 
  
    | Intangibles | 
  | 
      | 
—  | 
  | 
  | 
      | 
(749 | 
) | 
 
  
    |    Derivatives | 
  | 
      | 
—  | 
  | 
  | 
      | 
(606 | 
) | 
 
  
    | Other | 
  | 
      | 
(315 | 
) | 
  | 
      | 
(300 | 
) | 
 
  
    | Total deferred tax liabilities | 
  | 
      | 
(9,440 | 
) | 
  | 
      | 
(10,551 | 
) | 
 
  
    |   | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
  
    | Net deferred tax liabilities, included in other liabilities | 
  | 
    $ | 
(236 | 
) | 
  | 
    $ | 
(236 | 
) | 
 
   
  
 | 
| Schedule of net operating loss carryforwards | 
  
    | Tax Years | 
  | 
    Federal | 
  | 
  | 
    State | 
  | 
 
  
    | 2023–2027 | 
  | 
    $ | 
—  | 
  | 
  | 
    $ | 
47,896 | 
  | 
 
  
    | 2028–2032 | 
  | 
      | 
15,245 | 
  | 
  | 
      | 
72,150 | 
  | 
 
  
    | 2033–2037 | 
  | 
      | 
83,771 | 
  | 
  | 
      | 
33,449 | 
  | 
 
  
    | 2038 and after* | 
  | 
      | 
108,086 | 
  | 
  | 
      | 
79,675 | 
  | 
 
  
    | Total NOLs | 
  | 
    $ | 
207,102 | 
  | 
  | 
    $ | 
233,170 | 
  | 
 
   
  
 | 
| Schedule of balance of gross unrecognized tax benefits, before interest and penalties | 
  
    |   | 
  | 
    December 31, | 
  | 
 
  
    |   | 
  | 
    2022 | 
  | 
  | 
    2021 | 
  | 
 
  
    | Unrecognized tax benefits at beginning of year | 
  | 
    $ | 
— | 
  | 
  | 
    $ | 
—  | 
  | 
 
  
    | Increases related to current year tax positions | 
  | 
      | 
—  | 
  | 
  | 
      | 
—  | 
  | 
 
  
    | Decreases related to current year tax positions | 
  | 
      | 
—  | 
  | 
  | 
      | 
—  | 
  | 
 
  
    | Increases related to prior year tax positions | 
  | 
      | 
739 | 
  | 
  | 
      | 
—  | 
  | 
 
  
    | Decreases related to prior year tax positions | 
  | 
      | 
—  | 
  | 
  | 
      | 
—  | 
  | 
 
  
    | Decreases related to expiration of prior year tax positions | 
  | 
      | 
—  | 
  | 
  | 
      | 
—  | 
  | 
 
  
    | Decreases related to settlements of prior year tax positions | 
  | 
      | 
  | 
  | 
  | 
      | 
  | 
  | 
 
  
    | Unrecognized tax benefits at end of year | 
  | 
    $ | 
739 | 
  | 
  | 
    $ | 
— | 
  | 
 
   
  
 | 
| Schedule of income tax in the United States jurisdiction and various state jurisdictions | 
  
    | Jurisdiction | 
      | 
    Tax
    Years | 
 
  
    |   | 
      | 
      | 
 
  
    | Federal | 
      | 
    2019 – 2021 | 
 
  
    | Alabama | 
      | 
    2019 – 2021 | 
 
  
    | Arizona | 
      | 
    2018 – 2021 | 
 
  
    | Arkansas | 
      | 
    2019 – 2021 | 
 
  
    | California | 
      | 
    2018 – 2021 | 
 
  
    | Colorado | 
      | 
    2018 – 2021 | 
 
  
    | Connecticut | 
      | 
    2019 – 2021 | 
 
  
    | Georgia | 
      | 
    2019 – 2021 | 
 
  
    | Idaho | 
      | 
    2019 – 2021 | 
 
  
    | Illinois | 
      | 
    2019 – 2021 | 
 
  
    | Indiana | 
      | 
    2019 – 2021 | 
 
  
    | Iowa | 
      | 
    2019 – 2021 | 
 
  
    | Kansas | 
      | 
    2019 – 2021 | 
 
  
    | Louisiana | 
      | 
    2019 – 2021 | 
 
  
    | Michigan | 
      | 
    2019 – 2021 | 
 
  
    | Minnesota | 
      | 
    2019 – 2021 | 
 
  
    | Mississippi | 
      | 
    2019 – 2021 | 
 
  
    | Missouri | 
      | 
    2019 – 2021 | 
 
  
    | Nebraska | 
      | 
    2019 – 2021 | 
 
  
    | New Mexico | 
      | 
    2019 – 2021 | 
 
  
    | Oklahoma | 
      | 
    2019 – 2021 | 
 
  
    | Oregon | 
      | 
    2019 – 2021 | 
 
  
    | Pennsylvania | 
      | 
    2019 – 2021 | 
 
  
    | Rhode Island | 
      | 
    2019 – 2021 | 
 
  
    | South Carolina | 
      | 
    2019 – 2021 | 
 
  
    | Tennessee | 
      | 
    2019 – 2021 | 
 
  
    | Texas | 
      | 
    2018 – 2021 | 
 
   
  
 |