Investments | (4) Investments Debt and equity securities are classified as AFS and are carried at fair value. The Company evaluates whether AFS securities are other-than-temporarily impaired (OTTI) based on criteria that include the extent to which cost exceeds market value, the duration of the market value decline, the credit rating of the issuer or security, the failure of the issuer to make scheduled principal or interest payments and the financial health and prospects of the issuer or security. Declines in the value of AFS securities determined to be OTTI are recognized in earnings and reported as OTTI losses. Debt securities with unrealized losses are considered OTTI if the Company intends to sell the debt security or if the Company will be required to sell the debt security prior to any anticipated recovery. If the Company determines that a debt security is OTTI under these circumstances, the impairment recognized in earnings is measured as the difference between the amortized cost and the current fair value. A debt security is also determined to be OTTI if the Company does not expect to recover the amortized cost of the debt security. However, in this circumstance, if the Company does not intend to sell the debt security and will not be required to sell the debt security, the impairment recognized in earnings equals the estimated credit loss as measured by the difference between the present value of expected cash flows and the amortized cost of the debt security. Expected cash flows are discounted using the debt security’s effective interest rate. An equity security is determined to be OTTI if the Company does not expect to recover the cost of the equity security. Declines in the value of AFS securities determined to be temporary are reported net of income taxes as other comprehensive losses and included as a component of stockholders’ equity. Interest and dividend income, amortization of premiums, accretion of discounts and realized gains and losses on AFS securities are included in investment income. Interest income is accrued as earned. Dividend income is recognized as income on the ex-dividend date of the security. The cost of AFS securities sold is based on the first-in, first-out method. Following is a summary of AFS securities as of September 30, 2017 and December 31, 2016 : Amortized Cost Gross Unrealized Gains Gross Unrealized Losses Fair Value (Amounts are in thousands) September 30, 2017 Tax exempt bonds $ 2,054,341 5,308 2,841 2,056,808 Taxable bonds 2,185,377 3,639 14,000 2,175,016 Restricted investments 164,548 463 — 165,011 Equity securities 1,971,825 134,123 2,242 2,103,706 $ 6,376,091 143,533 19,083 6,500,541 December 31, 2016 Tax exempt bonds $ 3,036,060 2,211 24,649 3,013,622 Taxable bonds 2,469,192 1,359 33,903 2,436,648 Restricted investments 164,548 — 463 164,085 Equity securities 1,021,340 110,879 7,956 1,124,263 $ 6,691,140 114,449 66,971 6,738,618 Realized gains on sales of AFS securities totaled $11,179,000 and $109,815,000 for the three and nine months ended September 30, 2017 , respectively. Realized losses on sales of AFS securities totaled $856,000 and $4,934,000 for the three and nine months ended September 30, 2017 , respectively. Realized gains on sales of AFS securities totaled $7,012,000 and $18,896,000 for the three and nine months ended September 24, 2016, respectively. Realized losses on sales of AFS securities totaled $941,000 and $5,938,000 for the three and nine months ended September 24, 2016 , respectively. The amortized cost and fair value of AFS securities by expected maturity as of September 30, 2017 and December 31, 2016 are as follows: September 30, 2017 December 31, 2016 Amortized Cost Fair Value Amortized Cost Fair Value (Amounts are in thousands) Due in one year or less $ 1,256,912 1,256,724 1,592,144 1,591,740 Due after one year through five years 2,583,254 2,577,163 3,218,371 3,187,739 Due after five years through ten years 389,425 387,386 680,641 656,162 Due after ten years 10,127 10,551 14,096 14,629 4,239,718 4,231,824 5,505,252 5,450,270 Restricted investments 164,548 165,011 164,548 164,085 Equity securities 1,971,825 2,103,706 1,021,340 1,124,263 $ 6,376,091 6,500,541 6,691,140 6,738,618 Following is a summary of temporarily impaired AFS securities by the time period impaired as of September 30, 2017 and December 31, 2016 : Less Than 12 Months 12 Months or Longer Total Fair Value Unrealized Losses Fair Value Unrealized Losses Fair Value Unrealized Losses (Amounts are in thousands) September 30, 2017 Tax exempt bonds $ 510,790 1,699 232,906 1,142 743,696 2,841 Taxable bonds 964,755 5,332 643,454 8,668 1,608,209 14,000 Equity securities 62,700 1,239 3,526 1,003 66,226 2,242 $ 1,538,245 8,270 879,886 10,813 2,418,131 19,083 December 31, 2016 Tax exempt bonds $ 2,360,143 24,416 6,099 233 2,366,242 24,649 Taxable bonds 1,921,367 33,354 51,769 549 1,973,136 33,903 Restricted investments 164,085 463 — — 164,085 463 Equity securities 61,625 3,924 38,141 4,032 99,766 7,956 $ 4,507,220 62,157 96,009 4,814 4,603,229 66,971 There are 282 AFS securities contributing to the total unrealized loss of $19,083,000 as of September 30, 2017 . Unrealized losses related to debt securities are primarily due to interest rate volatility impacting the market value of certain bonds. The Company continues to receive scheduled principal and interest payments on these debt securities. Unrealized losses related to equity securities are primarily due to temporary equity market fluctuations that are expected to recover. |