/* Print stylesheet – hide non-essential elements and optimize typography */

* {
  background: transparent !important;
  color: #000 !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

/* Hide navigation, header, footer, TOC, forms, etc. */
header, nav, .toc, .skip-link, .copy-button, form, .subscribe, .footer, .topics-grid, .hero, footer {
  display: none !important;
}

/* Show link URLs */
a[href]:after {
  content: " (" attr(href) ")";
  font-size: 0.8em;
  color: #666 !important;
}

/* Don't show fragments or javascript: */
a[href^="#"]:after,
a[href^="javascript:"]:after {
  content: "";
}

/* Ensure good spacing and avoid orphaned headings */
p {
  orphans: 3;
  widows: 3;
}

/* Avoid page breaks inside paragraphs, lists, pre, etc. */
p, li, pre, blockquote, table, figure {
  page-break-inside: avoid;
}

/* Add some margin for headings */
h1, h2, h3, h4, h5, h6 {
  page-break-after: avoid;
  margin-top: 1em;
}

/* Reset any fixed positions */
* {
  position: static !important;
}

/* Force backgrounds to white for paper */
html, body, main, article {
  background: #fff !important;
  color: #000 !important;
}

/* Ensure the main content uses the full width */
.container {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Show code blocks with monospace font */
pre, code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.8em;
  white-space: pre-wrap;
}

/* Add a simple border to images to make them stand out */
img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ccc;
  page-break-inside: avoid;
}
