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 July 1, 2017 and December 31, 2016 : Amortized Cost Gross Unrealized Gains Gross Unrealized Losses Fair Value (Amounts are in thousands) July 1, 2017 Tax exempt bonds $ 2,677,257 5,775 5,249 2,677,783 Taxable bonds 2,438,718 3,163 17,501 2,424,380 Restricted investments 164,548 309 — 164,857 Equity securities 1,655,508 74,794 6,445 1,723,857 $ 6,936,031 84,041 29,195 6,990,877 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 $64,014,000 and 98,636,000 for the three and six months ended July 1, 2017 , respectively. Realized losses on sales of AFS securities totaled $725,000 and 4,078,000 for the three and six months ended July 1, 2017 , respectively. Realized gains on sales of AFS securities totaled $2,633,000 and 11,884,000 for the three and six months ended June 25, 2016 , respectively. Realized losses on sales of AFS securities totaled $1,442,000 and 4,997,000 for the three and six months ended June 25, 2016 , respectively. The amortized cost and fair value of AFS securities by expected maturity as of July 1, 2017 and December 31, 2016 are as follows: July 1, 2017 December 31, 2016 Amortized Cost Fair Value Amortized Cost Fair Value (Amounts are in thousands) Due in one year or less $ 1,713,943 1,712,555 1,592,144 1,591,740 Due after one year through five years 2,779,662 2,771,698 3,218,371 3,187,739 Due after five years through ten years 611,150 606,230 680,641 656,162 Due after ten years 11,220 11,680 14,096 14,629 5,115,975 5,102,163 5,505,252 5,450,270 Restricted investments 164,548 164,857 164,548 164,085 Equity securities 1,655,508 1,723,857 1,021,340 1,124,263 $ 6,936,031 6,990,877 6,691,140 6,738,618 Following is a summary of temporarily impaired AFS securities by the time period impaired as of July 1, 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) July 1, 2017 Tax exempt bonds $ 1,010,766 3,948 30,181 1,301 1,040,947 5,249 Taxable bonds 1,692,249 16,737 83,956 764 1,776,205 17,501 Equity securities 103,758 4,593 4,378 1,852 108,136 6,445 $ 2,806,773 25,278 118,515 3,917 2,925,288 29,195 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 362 AFS securities contributing to the total unrealized loss of $29,195,000 as of July 1, 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. |