/* =========================================================================
   Print stylesheet
   Optimised for patients who print cancer-type pages, second-opinion notes,
   and screening-planner outputs to take to a consultation.
   ========================================================================= */
@media print {

  /* Force a clean black-on-white page; no background images, no decorative tints. */
  html, body {
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 11pt;
    line-height: 1.45;
  }

  /* Strip non-essential UI: header, footer, nav, sidebars, scroll-progress
     bar, custom cursor, modals, social rails, CTAs, comment widgets. */
  .header, header, .header-nav, .header-mobile-toggle,
  #header-container, #footer-container, footer, .main-footer,
  .scroll-progress, .custom-cursor, .back-to-top,
  .skip-link, .modal, .modal-overlay,
  .header-btn, .button, .button-primary, .button-secondary, .button-ghost,
  .cancer-jump-nav, .cancer-tile__cta, .smart-card__cta,
  .blog-editorial-list__meta::after,
  .social-list, .social-rail, .share-rail,
  iframe, video, audio,
  .smart-hero, .topic-hero__media svg,
  [aria-hidden="true"]:not(.last-reviewed):not(.blog-article__meta) {
    display: none !important;
  }

  /* Lift main content out of column constraints */
  main, .main-content, .container, section, article {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }

  section {
    padding: 0.6cm 0 !important;
    page-break-inside: avoid;
  }

  /* Headlines in clean black serif — keeps editorial feel without colour */
  h1, h2, h3, h4 {
    color: #000 !important;
    font-family: 'Cormorant Garamond', Georgia, serif;
    page-break-after: avoid;
  }
  h1 { font-size: 22pt; margin: 0 0 0.4cm 0; }
  h2 { font-size: 16pt; margin: 0.6cm 0 0.2cm 0; }
  h3 { font-size: 13pt; margin: 0.4cm 0 0.15cm 0; }

  p, li {
    orphans: 3;
    widows: 3;
  }

  /* Show URLs after links so the printed page is self-contained */
  a, a:visited {
    color: #000 !important;
    text-decoration: underline;
  }
  a[href^="http"]::after,
  a[href^="/"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
  }
  /* but not for in-page anchors or mailto/tel */
  a[href^="#"]::after,
  a[href^="mailto:"]::after,
  a[href^="tel:"]::after {
    content: "";
  }

  /* Tile galleries collapse to a simple single-column reading flow */
  .cancer-tile-grid, .smart-card-grid, .grid-layout {
    display: block !important;
  }
  .cancer-tile, .smart-card {
    display: block !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.3cm 0 !important;
    page-break-inside: avoid;
    border-bottom: 0.5pt solid #ccc !important;
  }
  .cancer-tile__visual, picture {
    display: none !important;  /* skip the editorial illustrations on paper */
  }

  /* Editorial blog list — keep the typographic rhythm */
  .blog-editorial-list__item {
    display: block !important;
    padding: 0.2cm 0 !important;
    page-break-inside: avoid;
  }
  .blog-editorial-list__mark {
    display: none !important;
  }

  /* Schema script tags should never print */
  script[type="application/ld+json"] {
    display: none !important;
  }

  /* Page breaks: before each major section for the long cancer-type pages */
  .topic-hero, .topic-faq, .topic-resources {
    page-break-before: auto;
  }
  details, summary {
    page-break-inside: avoid;
  }
  details {
    margin-bottom: 0.3cm;
  }
  details > summary {
    font-weight: 600;
  }

  /* "Print view: drmadhavdanthala.com" footer on every page */
  @page {
    margin: 1.4cm 1.4cm 2cm 1.4cm;
    @bottom-center {
      content: "drmadhavdanthala.com — printed " counter(page) " of " counter(pages);
      font-family: Inter, sans-serif;
      font-size: 9pt;
      color: #666;
    }
  }
}
