/**
 * Print Stylesheet for AI Home Building articles
 * Makes articles look clean and readable when printed or saved as PDF.
 */
@media print {
  /* Hide non-content elements */
  .site-nav,
  .hamburger-btn,
  .mobile-drawer,
  .drawer-backdrop,
  .theme-toggle,
  .stats-ticker,
  .share-bar,
  .article-toc,
  .toc-sidebar,
  .related-articles,
  .newsletter-banner,
  .back-to-top,
  .reading-progress,
  .reading-bookmark-toast,
  footer,
  nav,
  .dark-mode-toggle,
  .badge-back,
  script {
    display: none !important;
  }

  /* Reset backgrounds and colors */
  html, body {
    background: white !important;
    color: #111 !important;
    font-size: 11pt !important;
    line-height: 1.6 !important;
  }

  /* Reset article container */
  .article-body,
  .article-content,
  article .content {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Hero image — keep but constrain */
  .article-hero,
  .hero-image {
    max-height: 300px !important;
    overflow: hidden;
    page-break-after: avoid;
  }

  .article-hero img,
  .hero-image img {
    width: 100% !important;
    height: auto !important;
    max-height: 280px !important;
    object-fit: cover;
  }

  /* Headlines */
  h1 {
    font-size: 22pt !important;
    line-height: 1.2 !important;
    margin-bottom: 8pt !important;
    color: #111 !important;
    page-break-after: avoid;
  }

  h2 {
    font-size: 16pt !important;
    margin-top: 18pt !important;
    margin-bottom: 6pt !important;
    color: #222 !important;
    page-break-after: avoid;
  }

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

  /* Body text */
  p {
    font-size: 11pt !important;
    line-height: 1.6 !important;
    margin-bottom: 8pt !important;
    orphans: 3;
    widows: 3;
  }

  /* Pull stats */
  .pull-stat {
    font-size: 14pt !important;
    font-weight: 700 !important;
    color: #333 !important;
    text-align: center;
    border-top: 1px solid #ccc !important;
    border-bottom: 1px solid #ccc !important;
    padding: 8pt 0 !important;
    margin: 12pt 0 !important;
    page-break-inside: avoid;
  }

  /* Byline */
  .byline, .article-meta {
    font-size: 9pt !important;
    color: #666 !important;
    margin-bottom: 12pt !important;
  }

  /* Badge */
  .badge {
    font-size: 8pt !important;
    color: #FF6B35 !important;
    background: none !important;
    padding: 0 !important;
    border: 1px solid #FF6B35 !important;
    border-radius: 3pt !important;
    display: inline-block;
    padding: 1pt 4pt !important;
  }

  /* Links — show URL in print */
  a[href]:not(.badge):not(.share-button)::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #888;
    font-weight: 400;
  }

  /* But not for internal/anchor links */
  a[href^="#"]::after,
  a[href^="javascript"]::after,
  a[href^="../"]::after {
    content: none !important;
  }

  /* Tables */
  table {
    border-collapse: collapse !important;
    page-break-inside: avoid;
  }

  th, td {
    border: 1px solid #ccc !important;
    padding: 4pt 8pt !important;
    font-size: 9pt !important;
  }

  th {
    background: #f5f5f5 !important;
    font-weight: 700 !important;
  }

  /* Blockquotes */
  blockquote {
    border-left: 3pt solid #FF6B35 !important;
    padding-left: 10pt !important;
    margin-left: 0 !important;
    color: #444 !important;
    font-style: italic;
    page-break-inside: avoid;
  }

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

  /* Footer attribution */
  body::after {
    content: "AI Home Building — aihomebuilding.pages.dev";
    display: block;
    text-align: center;
    font-size: 8pt;
    color: #999;
    margin-top: 24pt;
    padding-top: 8pt;
    border-top: 0.5pt solid #ddd;
  }

  /* Page margins */
  @page {
    margin: 0.75in;
  }
}
