/*
 * Sweetgrass Press — Print Styles
 *
 * When someone prints a page, it should look like a document,
 * not a screenshot of a website.
 */

@media print {
  body {
    font-size: 11pt;
    line-height: 1.5;
    color: black;
    background: white;
  }

  /* Hide navigation and source link when printing */
  header, footer .source {
    display: none;
  }

  main {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  /* Show link destinations */
  a { color: black; text-decoration: underline; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }
  a[href^="#"]::after { content: ""; }

  /* Keep code blocks together */
  pre {
    white-space: pre-wrap;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  /* Don't break after headings */
  h1, h2, h3 { page-break-after: avoid; }

  /* Keep images on one page */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  blockquote {
    border-left: 2px solid #999;
    color: #333;
  }

  footer {
    border-top: 1px solid #ccc;
  }
}
