/* Print styles - optimized for printing blog posts/guides */
@media print {
  /* Hide non-essential elements */
  nav,
  footer,
  .social-share,
  .related-posts,
  .comments,
  .back-to-top,
  .reading-progress,
  .post-tags {
    display: none !important;
  }

  /* Reset colors for printing */
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }

  /* Optimize typography */
  body {
    font-size: 12pt;
    line-height: 1.5;
    max-width: 100%;
    margin: 0;
    padding: 1cm;
  }

  h1 {
    font-size: 20pt;
    page-break-after: avoid;
  }

  h2, h3, h4 {
    font-size: 14pt;
    page-break-after: avoid;
    margin-top: 12pt;
  }

  /* Avoid breaks inside elements */
  p, blockquote, pre {
    page-break-inside: avoid;
  }

  /* Code blocks */
  pre, code {
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
    font-size: 10pt;
    background: #f5f5f5 !important;
  }

  /* Links - show URLs */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666 !important;
  }

  /* Don't show URLs for anchor links */
  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }

  /* Images */
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  /* Tables */
  table {
    border-collapse: collapse;
    width: 100%;
  }

  table, th, td {
    border: 1px solid #ccc !important;
  }

  th, td {
    padding: 8pt;
  }

  /* Page breaks */
  article {
    page-break-before: always;
  }

  /* Print URL at the top */
  @page {
    margin: 2cm;
  }
}
