/* ==========================================================================
   StudyDump - Print Stylesheet
   Produces clean, high-contrast academic printouts & PDF saves
   ========================================================================== */

@media print {
  /* Hide interactive chrome and UI navigation */
  .site-header,
  .search-dialog,
  .bookmarks-dialog,
  .header-bookmarks-btn,
  .header-share-btn,
  .pwa-update-toast,
  .share-success-toast,
  .offline-status-indicator,
  .skip-link,
  .theme-toggle,
  .print-btn,
  .toc-sidebar,
  .mobile-toc,
  .note-nav-footer,
  .site-footer,
  .heading-anchor,
  .heading-copy-btn,
  .copy-code-btn,
  .run-preview-btn,
  .live-preview-container,
  .studydump-toast-container,
  .nav-card-key-hint,
  .quick-jump-bar,
  .search-trigger,
  .mcq-practice-bar,
  .mcq-reveal-btn {
    display: none !important;
  }

  .mcq-solution-body {
    display: block !important;
  }

  /* Page setup */
  @page {
    margin: 1.8cm 1.5cm;
    size: A4 portrait;
  }

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

  body {
    background-color: #fff !important;
    color: #111 !important;
    font-size: 11pt;
    line-height: 1.5;
  }

  .page-container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .reading-layout {
    display: block !important;
  }

  .note-content {
    max-width: 100% !important;
    font-size: 11pt !important;
    line-height: 1.55 !important;
  }

  /* Keep headings with their following content */
  h1, h2, h3, h4 {
    page-break-after: avoid;
    break-after: avoid;
    color: #000 !important;
  }

  .note-title {
    font-size: 24pt !important;
    margin-bottom: 0.5cm !important;
  }

  .note-meta-top {
    font-size: 9pt !important;
    color: #444 !important;
  }

  .note-header {
    border-bottom: 2pt solid #000 !important;
    margin-bottom: 0.8cm !important;
    padding-bottom: 0.4cm !important;
  }

  /* Avoid awkward breaks inside components */
  p, blockquote, pre, table, figure, .academic-callout, .code-block-wrapper {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .academic-callout {
    border-left: 3pt solid #333 !important;
    background-color: #f9f9f9 !important;
    padding: 0.3cm 0.4cm !important;
    margin: 0.5cm 0 !important;
  }

  .callout-tag {
    font-size: 8pt !important;
    font-weight: bold !important;
    color: #000 !important;
  }

  /* Tables */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
    font-size: 9.5pt !important;
  }

  th, td {
    border: 0.5pt solid #666 !important;
    padding: 4pt 6pt !important;
  }

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

  /* Code blocks */
  .code-block-wrapper {
    border: 0.5pt solid #777 !important;
    background-color: #f8f8f8 !important;
    margin: 0.4cm 0 !important;
  }

  .code-block-header {
    border-bottom: 0.5pt solid #aaa !important;
    background-color: #eee !important;
    padding: 2pt 6pt !important;
    font-size: 8pt !important;
  }

  pre {
    padding: 6pt !important;
    font-size: 9pt !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
  }

  /* Links */
  a {
    text-decoration: underline !important;
    color: #111 !important;
  }
}
