/* Print Stylesheet for Signal Pilot Docs */
/* Optimized for offline documentation printing */

@media print {
  /* Hide navigation elements */
  .md-header,
  .md-sidebar,
  .md-footer,
  .md-nav,
  .md-search,
  .md-tabs,
  .sp-topnav,
  .md-content-meta,
  .md-source,
  button,
  .md-top {
    display: none !important;
  }

  /* Hide custom bottom sheet navigation (mobile menu) */
  .custom-nav-button,
  .custom-nav-overlay,
  .custom-bottom-sheet {
    display: none !important;
  }

  /* Hide feedback widget */
  .md-feedback,
  form {
    display: none !important;
  }

  /* Reset page margins for better printing */
  @page {
    margin: 2cm;
    size: A4;
  }

  /* Main content adjustments */
  body {
    background: white !important;
    color: black !important;
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Remove aurora and background effects */
  .sp-aurora,
  body::before {
    display: none !important;
  }

  .md-main {
    background: white !important;
  }

  .md-content {
    max-width: 100% !important;
    margin: 0 !important;
  }

  /* Typography for print */
  h1 {
    font-size: 24pt;
    page-break-after: avoid;
    margin-top: 0;
    color: #000 !important;
    background: none !important;
    -webkit-text-fill-color: initial !important;
  }

  h2 {
    font-size: 18pt;
    page-break-after: avoid;
    margin-top: 1.5em;
    color: #000 !important;
    border-bottom: 2px solid #333;
  }

  h3 {
    font-size: 14pt;
    page-break-after: avoid;
    color: #000 !important;
  }

  h4, h5, h6 {
    font-size: 12pt;
    page-break-after: avoid;
    color: #000 !important;
  }

  p, li, td, th {
    color: #000 !important;
    orphans: 3;
    widows: 3;
  }

  /* Avoid page breaks inside these elements */
  pre, blockquote, table, figure, .admonition {
    page-break-inside: avoid;
  }

  /* Code blocks */
  pre, code {
    background: #f5f5f5 !important;
    border: 1px solid #ddd !important;
    color: #000 !important;
    font-size: 10pt;
    padding: 0.5em;
  }

  code {
    padding: 0.2em 0.4em;
  }

  /* Links - show URL after link text */
  a {
    color: #000 !important;
    text-decoration: underline;
  }

  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    font-weight: normal;
  }

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

  /* Tables */
  table {
    border-collapse: collapse;
    width: 100%;
    background: white !important;
  }

  th, td {
    border: 1px solid #333 !important;
    padding: 0.5em;
    background: white !important;
  }

  th {
    background: #f0f0f0 !important;
    font-weight: bold;
  }

  /* Admonitions / callouts */
  .admonition {
    border: 2px solid #333;
    padding: 1em;
    margin: 1em 0;
    background: #f9f9f9 !important;
    page-break-inside: avoid;
  }

  .admonition-title {
    font-weight: bold;
    margin-bottom: 0.5em;
    color: #000 !important;
  }

  /* Cards - convert to simple blocks */
  .grid.cards {
    display: block !important;
  }

  .grid.cards > * {
    border: 1px solid #ddd;
    padding: 1em;
    margin-bottom: 1em;
    page-break-inside: avoid;
    background: white !important;
  }

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

  /* Add document header */
  .md-content::before {
    content: "Signal Pilot Documentation";
    display: block;
    font-size: 10pt;
    color: #666;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5em;
    margin-bottom: 2em;
  }

  /* Page numbers */
  @page {
    @bottom-right {
      content: "Page " counter(page) " of " counter(pages);
    }
  }
}
