/* Scale and colour things properly for printing. */
@media print {

    /* Hide some unnecessary things */
    header,
    aside,
    footer em,
    footer li {
        display: none !important;
    }

    /* Standardise style for displayed parts */
    body,
    #page-container,
    #primary-content,
    footer {
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: #fff !important;
        overflow: visible !important;
    }

    /* Content areas should have reasonable lr margins. */
    main, header, footer {
        margin: 0em 2em !important;
        width: auto !important;
        padding-bottom: 0em !important;
    }

    /* Make blog entries look ok */
    article {
        background: #fff !important;
        border: none !important;
        overflow: visible !important;
    }

    article h1 {
        background: #fff !important;
        display: block !important;
        margin: 0px !important;
        padding: 0px !important;
        padding-top: 10px !important;
    }

    article h1 a {
        color: #000 !important;
    }

    article h3 {
        color: #000 !important;
    }

    .additional-content h2 {
        color: #000 !important;
    }

    /* Show the date properly */
    article time {
        border: none !important;
        width: auto !important;
        text-align: left !important;
        display: block !important;
        margin: 0px !important;
        padding-right: 1em !important;
    }

    article time span {
        display: inline !important;
        font-size: 14px !important;
    }

    article time span.month:after {
        content: ",";
    }

    article .old-post-warning {
        color: #888;
        width: auto;
        text-indent: 0px;
    }

    article .tag-list {
        display: none !important; /* Not really useful to show any more */
    }

    /* Code blocks should get a nice border. */
    article pre {
        border: 1px solid #000;
    }

    /* Footer gets some changes when printing */
    footer {
        position: relative !important;
        width: 100%;
        margin-left: 0px;
        left: 4px !important;
        border-top: 1px solid #aaa !important;
    }

    footer ul#copyright-info {
        left: 0%;
        position: absolute;
        bottom: 0.6em;
        width: 100%;
        margin-left: 0px;
    }

    /* Show copyright info. */
    footer li#copyright {
        display: block !important;
    }

    footer li#copyright a {
        text-decoration: none;
    }

    /* Show URLs for links */
    #primary-content a[href]:after,
    footer a[href]:after {
        content: " (" attr(href) ") ";
        font-size: 0.9em;
        text-decoration: none;
    }

    /* But not for content links, title, or additional link */
    /* Content links are already in references section. */
    #primary-content article a[href]:after,
    #primary-content article h1 a[href]:after,
    #primary-content #sources.additional-content ul li a[href]:after,
    #primary-content article h3,
    #archive-content ul li a.article-link[href]:after,
    #page-not-found a[href]:after {
        content: "";
    }

    /* Intro */
    #intro {
        color: #555;
    }

    /* Archive */
    #archive-content ul li span.date {
      display: block;
      width: 100%;
      float: none;
      text-align: left;
      padding: 0em;
      margin: 0em;
    }

    #archive-content ul li a.article-link {
      margin-left: 0em;
      color: #000;
    }

    #archive-content ul li a.article-link:before {
      content: '';
    }

    #archive-content p.description {
        margin-left: 0em;
    }

    /* Fix about the author section. */
    #about-the-author #headshot {
        margin-top: 0em;
    }

    #about-the-author #headshot img {
        border: 2px solid #000;
    }

    #about-the-author p {
      	background: #fff;
      	color: #000;
      	border: 2px solid #000;
    }

    #about-the-author p a {
        color: #0645ad;
    }

    #about-the-author p:after {
        border: .6em solid transparent;
        border-right-color: #000;
        border-left: 0;
        top: 3em;
    }

    /* I can't imagine anyone would want to print the 404 page, but here we are... */
    #page-not-found main {
        margin-top: 1em !important;
    }

    #page-not-found main h2,
    #page-not-found main p {
        display: block;
        font-size: 1.2em;
        color: #000;
        font-style: normal;
        text-align: center;
    }

    #page-not-found main p.footnote {
        position: relative;
        text-align: center;
        padding-top: 3em;
    }
} /* end of @media print */
