/* =============================================================
   print.css — Clean Print Layout for Writeups
   ============================================================= */

@media print {
  /* Hide non-essential elements */
  .header,
  .footer,
  .back-to-top,
  .top-link,
  #matrix-bg,
  .hero-terminal,
  .stats-dashboard,
  .timeline-section,
  .filter-bar,
  .filter-no-results,
  .share-bar,
  .copy-link-btn,
  .writeup-nav,
  .post-nav-links,
  .reading-progress-container,
  .breadcrumbs,
  .toc,
  .post-tags,
  .room-info,
  .techniques-section,
  .card-badges,
  .card-tags,
  .last-solved,
  .search-hint,
  #searchInput,
  .social-icons,
  nav,
  .menu,
  #menu,
  canvas {
    display: none !important;
  }

  /* Reset background and colours */
  body,
  .main,
  .post-single,
  .post-content,
  .highlight,
  .highlight pre,
  .post-entry {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    border: none !important;
  }

  /* Typography */
  body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.6;
  }

  .post-title,
  .post-header .post-title {
    color: #000 !important;
    font-size: 18pt;
    border-bottom: 2px solid #000;
    padding-bottom: 0.3em;
  }

  .post-content h1,
  .post-content h2,
  .post-content h3,
  .post-content h4,
  .post-content h5,
  .post-content h6 {
    color: #000 !important;
    page-break-after: avoid;
  }

  .post-content h2 {
    border-bottom: 1px solid #999;
  }

  /* Links — show URL after */
  .post-content a {
    color: #000 !important;
    text-decoration: underline;
    border-bottom: none !important;
    background: none !important;
    box-shadow: none !important;
  }

  .post-content a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
    word-break: break-all;
  }

  /* Don't show URL for internal fragment links */
  .post-content a[href^="#"]::after {
    content: none;
  }

  /* Code blocks — expand fully, no scrolling */
  .highlight,
  .highlight pre,
  pre {
    overflow: visible !important;
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    max-height: none !important;
    border: 1px solid #ccc !important;
    background: #f5f5f5 !important;
    page-break-inside: avoid;
  }

  pre code {
    color: #000 !important;
    font-size: 9pt;
  }

  .code-titlebar {
    display: none !important;
  }

  /* Inline code */
  .post-content code:not(pre code) {
    background: #f0f0f0 !important;
    color: #000 !important;
    border: 1px solid #ccc !important;
    padding: 1px 4px;
  }

  /* Images */
  .post-content img {
    max-width: 100% !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
  }

  /* Blockquotes */
  .post-content blockquote {
    border-left: 3px solid #000 !important;
    background: #f9f9f9 !important;
    color: #333 !important;
    box-shadow: none !important;
    padding: 0.5em 1em;
    page-break-inside: avoid;
  }

  /* Tables */
  .post-content table {
    border-collapse: collapse;
  }

  .post-content th,
  .post-content td {
    border: 1px solid #333 !important;
    color: #000 !important;
    background: #fff !important;
  }

  .post-content th {
    background: #eee !important;
  }

  .post-content tr:hover {
    background: transparent !important;
  }

  /* Related writeups section */
  .related-writeups {
    display: none !important;
  }

  /* Disable animations */
  * {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }

  /* Post meta */
  .post-meta {
    color: #666 !important;
    font-family: Georgia, serif;
  }

  /* Page breaks */
  .post-content h2,
  .post-content h3 {
    page-break-after: avoid;
  }

  .post-content p,
  .post-content li {
    orphans: 3;
    widows: 3;
  }

  /* Remove max-width constraint for print */
  .main {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Ensure description is visible */
  .post-description {
    color: #333 !important;
    font-style: italic;
  }
}
