INVESTMENTS |  4. INVESTMENTS  Unrealized Gains and Losses  The following table details the difference between amortized cost or cost and estimated fair value, by major investment category, at June 30, 2017 and at December 31, 2016 :      Amortized Gross Gross  Cost Unrealized Unrealized  or Cost Gains Losses Fair Value  (in thousands)  June 30, 2017  Debt securities - available-for-sale:  United States government obligations and authorities $ 85,643 $ 462 $ 484 $ 85,621  Obligations of states and political subdivisions 86,295 852 228 86,919  Corporate 194,484 2,577 328 196,733  International 14,483 164 10 14,637  380,905 4,055 1,050 383,910   Debt securities - held-to-maturity:  United States government obligations and authorities 4,165 21 109 4,077  Corporate 1,190 27 — 1,217  International 66 1 — 67  5,421 49 109 5,361  Equity securities 40,202 5,966 723 45,445  Total investments $ 426,528 $ 10,070 $ 1,882 $ 434,716      Amortized Gross Gross  Cost Unrealized Unrealized  or Cost Gains Losses Fair Value  (in thousands)  December 31, 2016  Debt securities - available-for-sale:  United States government obligations and authorities $ 62,881 $ 177 $ 853 $ 62,205  Obligations of states and political subdivisions 152,823 427 2,067 151,183  Corporate 149,053 1,347 895 149,505  International 11,887 95 119 11,863  376,644 2,046 3,934 374,756   Debt securities - held-to-maturity:  United States government obligations and authorities 4,163 22 118 4,067  Corporate 1,317 20 2 1,335  International 71 — — 71  5,551 42 120 5,473  Equity securities 24,163 5,500 288 29,375  Total investments $ 406,358 $ 7,588 $ 4,342 $ 409,604  Net Realized Gains and Losses  The Company calculates the gain or loss realized on the sale of investments by comparing the sales price (fair value) to the cost or amortized cost of the security sold. Net realized gains and losses on investments are determined in accordance with the specific identification method. The following tables detail the Company’s net realized gains (losses) by major investment category for the three and six months ended June 30, 2017 and 2016 :      Three Months Ended Six Months Ended  June 30, June 30,  2017 2016 2017 2016  (in thousands) (in thousands)  Gross realized gains:  Debt securities $ 304 $ 624 $ 873 $ 1,927  Equity securities 2,735 417 3,290 1,155  Total gross realized gains 3,039 1,041 4,163 3,082   Gross realized losses:  Debt securities (118) (55) (1,209) (595)  Equity securities (273) (979) (411) (1,553)  Total gross realized losses (391) (1,034) (1,620) (2,148)  Net realized gains on investments $ 2,648 $ 7 $ 2,543 $ 934  During the three months ended June 30, 2017 and 2016 , the proceeds from sales of available-for-sale investment securities were $27.3 million and $36.9 million, respectively. During the six months ended June 30, 2017 and 2016 , the proceeds from sales of available-for-sale investment securities were $138.9 million and $99.4 million, respectively.  Contractual Maturity  The amortized cost and estimated fair value of debt securities as of June 30, 2017 and December 31, 2016 by contractual maturity are shown below. Expected maturities may differ from contractual maturities as borrowers may have the right to call or prepay obligations with or without call or prepayment penalties.      June 30, 2017 December 31, 2016  Amortized Amortized  Cost Fair Value Cost Fair Value  Securities with maturity dates: (in thousands)  Debt securities, available-for-sale:  One year or less $ 38,343 $ 38,399 $ 46,189 $ 46,231  Over one through five years 181,014 182,264 177,982 177,899  Over five through ten years 160,332 162,048 150,557 148,783  Over ten years 1,216 1,199 1,916 1,843  380,905 383,910 376,644 374,756  Debt securities, held-to-maturity:  One year or less 135 135 170 170  Over one through five years 1,858 1,892 1,719 1,750  Over five through ten years 3,428 3,334 3,662 3,553  5,421 5,361 5,551 5,473  Total $ 386,326 $ 389,271 $ 382,195 $ 380,229  Net Investment Income  The following table provides a detail of the Company’s net investment income for the three and six months ended June 30, 2017 and 2016 :      Three Months Ended Six Months Ended  June 30, June 30,  2017 2016 2017 2016  (in thousands)  Interest income $ 2,411 $ 1,984 $ 4,581 $ 3,837  Dividends income 149 210 297 397  Net investment income $ 2,560 $ 2,194 $ 4,878 $ 4,234  Aging of Gross Unrealized Losses  As of June 30, 2017 and December 31, 2016 , gross unrealized losses and related fair values for available-for-sale debt securities and equity securities, grouped by duration of time in a continuous unrealized loss position, were as follows:      Less than 12 months 12 months or longer Total  Gross Gross Gross  Fair Unrealized Fair Unrealized Fair Unrealized  Value Losses Value Losses Value Losses  June 30, 2017 (in thousands)  Debt securities - available-for-sale:  United States government obligations  and authorities $ 48,333 $ 479 $ 98 $ 5 $ 48,431 $ 484  Obligations of states and political subdivisions 24,012 228 — — 24,012 228  Corporate 43,646 320 930 8 44,576 328  International 1,774 10 — — 1,774 10  117,765 1,037 1,028 13 118,793 1,050   Equity securities 9,010 631 696 92 9,706 723   Total investments $ 126,775 $ 1,668 $ 1,724 $ 105 $ 128,499 $ 1,773      Less than 12 months 12 months or longer Total  Gross Gross Gross  Fair Unrealized Fair Unrealized Fair Unrealized  Value Losses Value Losses Value Losses  December 31, 2016 (in thousands)  Debt securities - available-for-sale:  United States government obligations  and authorities $ 45,255 $ 850 $ 111 $ 3 $ 45,366 $ 853  Obligations of states and political subdivisions 103,724 2,066 1,007 1 104,731 2,067  Corporate 59,970 864 2,427 31 62,397 895  International 5,925 119 5 — 5,930 119  214,874 3,899 3,550 35 218,424 3,934   Equity securities 4,701 253 434 35 5,135 288   Total investments $ 219,575 $ 4,152 $ 3,984 $ 70 $ 223,559 $ 4,222  As of June 30, 2017 , the Company held a total of 518 d ebt and equity securities that were in an unrealized loss position, of which 19 securities were in an unrealized loss position con tinuously for 12 months or more. As of December 31, 2016 , the Company held a total of 1,132 debt and equity securities that were in an unrealized loss position, of which 36 securities were in an unrealized loss position continuously for 12 months or more. The unrealized losses associated with these securities consisted primarily of losses related to corporate securities.  The Company holds its equity securities and some of its debt securities as available-for-sale and as such, these securities are recorded at fair value. The Company continually monitors the difference between cost and the estimated fair value of its investments, which involves uncertainty as to whether declines in value are temporary in nature. If the decline of a particular investment is deemed temporary, the Company records the decline as an unrealized loss in shareholders’ equity. If the decline is deemed to be other than temporary, the Company will write the security’s cost-basis or amortized cost-basis down to the fair value of the investment and recognizes an other than temporary impairment (“OTTI”) loss in our consolidated statement of operations. Additionally, any portion of such decline related to debt securities that is believed to arise from factors other than credit will be recorded as a component of other comprehensive income rather than charged against income.  The Company’s assessment of equity securities initially involves an evaluation of all securities that are in an unrealized loss position, regardless of the duration or severity of the loss, as of the applicable balance sheet date. Such initial review consists primarily of assessing whether: (i) there has been a negative credit or news event with respect to the issuer that could indicate the existence of an OTTI; and (ii) the Company has the ability and intent to hold an equity security for a period of time sufficient to allow for an anticipated recovery (generally considered to be one year from the balance sheet date).  To the extent that an equity security in an unrealized loss position is not impaired based on the initial review described above, the Company then evaluates such equity security by considering qualitative and quantitative factors. These factors include but are not limited to facts and circumstances specific to individual securities, asset classes, the financial condition of the issuer, changes in dividend payment, the length of time fair value had been less than cost, the severity of the decline in fair value below cost, industry outlook and our ability and intent to hold each position until its forecasted recovery.  If the Company intends to sell, or it is more likely than not that, the Company will sell, a debt security before recovery of its amortized cost basis, the total amount of the unrealized loss position is recognized as an OTTI loss in our consolidated statement of operations. To the extent a debt security in an unrealized loss position is not impaired based on the preceding, the Company will consider that security to be impaired when it believes collection of the amortized cost is not probable.  During the Company’s quarterly evaluation of its securities for impairment, there were no material OTTI losses identified in our investments in debt and equity securities during the three and six months ended June 30, 2017 and 2016 .  Collateral Deposits  As of June 30, 2017 , investments with fair values of approximately $12.8 million, the majority of which were debt securities, were deposited with governmental authorities and into custodial bank accounts as required by law or contractual obligations. |