/*
 * AWP Print Stylesheet
 *
 * Transforms any AWP app or content page into a clean, patient-friendly
 * printable document when the user prints or saves to PDF.
 *
 * Rules:
 *  - Hide site chrome (nav, footer, floating widgets, interactive controls)
 *  - Show only the main content area and any result containers
 *  - Use high-contrast black-on-white typography
 *  - Preserve headings, paragraphs, lists, tables
 *  - Add a short AWP print header with source URL for credibility
 */

@media print {
  /* ---- Page setup ---- */
  @page {
    margin: 0.75in 0.6in;
    size: letter;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 11.5pt !important;
    line-height: 1.45 !important;
    font-family: Georgia, "Times New Roman", serif !important;
  }

  /* ---- Hide site chrome ---- */
  .awp-nav,
  #awp-nav,
  .awp-mobile-menu,
  #awp-mobile-menu,
  nav,
  header,
  footer,
  .site-footer,
  .site-header,
  .awp-footer,
  .awp-header,
  .awp-font-ctl,
  .awp-print-ctl,
  .awp-crisis-footer,
  .cookie-consent,
  .feedback-widget,
  #awpFeedback,
  #feedbackButtons,
  #feedbackPrompt,
  #feedbackThanks,
  .beta-gate,
  .coming-soon-overlay,
  .report-issue,
  .skip-link,
  .hero-cta,
  .social-share,
  .language-toggle,
  button,
  .btn,
  input[type="submit"],
  input[type="button"],
  [role="button"],
  video,
  iframe,
  .ad,
  noscript {
    display: none !important;
  }

  /* Keep key action buttons that appear inside results visible only if marked */
  .print-keep,
  [data-print="keep"] {
    display: inline-block !important;
  }

  /* ---- Show main content cleanly ---- */
  main, #main-content, #app, #root, article, section {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
  }

  /* Headings */
  h1, h2, h3, h4, h5, h6 {
    color: #000000 !important;
    font-family: Georgia, "Times New Roman", serif !important;
    page-break-after: avoid;
  }
  h1 { font-size: 20pt !important; margin-top: 0 !important; }
  h2 { font-size: 15pt !important; }
  h3 { font-size: 13pt !important; }

  p, li { color: #000000 !important; }

  a, a:link, a:visited {
    color: #000000 !important;
    text-decoration: underline !important;
  }
  /* Expand URLs for paper readers */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9.5pt;
    color: #333333;
  }

  /* Lists */
  ul, ol { margin-left: 0.25in !important; }

  /* Tables */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }
  th, td {
    border: 1px solid #000000 !important;
    padding: 6pt 8pt !important;
    color: #000000 !important;
    background: #FFFFFF !important;
    text-align: left !important;
  }
  thead { background: #EEEEEE !important; }

  /* Keep result / letter / output containers intact on page */
  #letterDoc,
  #reportContent,
  #reportGenerationArea,
  #summaryPreview,
  .result-container,
  .output-container,
  .analysis,
  .letter-body {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Hide decorative-only images; keep infographics/diagrams */
  img[role="presentation"],
  img.decorative,
  img[alt=""] {
    display: none !important;
  }
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Print-only header and footer inserted by stylesheet */
  body::before {
    content: "AnchorWellPress \00B7 anchorwellpress.com \00B7 Educational use only";
    display: block;
    font-family: Georgia, serif;
    font-size: 9pt;
    color: #555555;
    border-bottom: 1px solid #CCCCCC;
    padding-bottom: 6pt;
    margin-bottom: 14pt;
  }

  body::after {
    content: "This document is for informational purposes only and does not constitute medical advice, diagnosis, or treatment. Always consult your healthcare provider.";
    display: block;
    font-family: Georgia, serif;
    font-size: 8.5pt;
    font-style: italic;
    color: #555555;
    border-top: 1px solid #CCCCCC;
    padding-top: 6pt;
    margin-top: 20pt;
  }
}
