/* Print styles for HCV Guidance content
   - Hides global chrome (headers/nav/footers/sidebars, cookie banners, search, share)
   - Improves legibility for body, headings, lists
   - Keeps tables/images/code blocks intact across pages
   - Appends URLs to links (except anchors, mailto, tel, javascript)
*/

@media print {

  /* Page and base */
  @page {
    margin: 16mm 14mm 18mm 14mm; /* printers differ; this is a safe default */
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
  }

  h1, h2, h3, h4, h5, h6 {
	color: #000 !important;
	font-weight: 700 !important;
  }

  body * {
	color: #000 !important;
  }

  body {
    letter-spacing: 0;
    -webkit-print-color-adjust: exact;
            print-color-adjust: exact;
  }

  /* Hide site chrome & non-essential UI */
  header, footer, nav,
  .site-header, .site-footer, .site-branding,
  .primary-navigation, .secondary-navigation,
  .mobile-nav, .menu, .submenu, .breadcrumb, .breadcrumbs,
  .sidebar, .widget-area, aside,
  .cookie, .cookie-banner, .cookie-notice, [aria-live="polite"][role="dialog"],
  .search, form.search-form, .site-search,
  .share, .social-share, .social, .newsletter,
  .modal, .banner, .announcement,
  .skip-link, .screen-reader-text,
  .ad, .advert, .advertisement,
  .pagination, .wp-block-query-pagination,
  .wp-block-buttons, .button, .btn,
  .sticky, .offcanvas,
  .toc-toggle, .toc-controls /* if a ToC control exists */,
  .seopress-user-consent,
  .wp-container-core-group-is-layout-c0c79701  {
    display: none !important;
  }

  /* Try to keep main/article content only */
  main, article, .entry-content, .content, .wp-block-post-content, .resource-content {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
  }

  /* Headings & text */
  h1 { font-size: 20pt; margin: 0 0 10pt; }
  h2 { font-size: 16pt; margin: 16pt 0 8pt; }
  h3 { font-size: 13.5pt; margin: 14pt 0 6pt; }
  h4, h5, h6 { font-size: 12pt; margin: 12pt 0 6pt; }
  p, ul, ol, dl, blockquote { font-size: 12pt; margin: 0 0 10pt; }
  li { margin: 0 0 4pt 0; }
  strong, b { font-weight: 700; }
  em, i { font-style: italic; }

  /* Avoid awkward breaks */
  h2, h3, h4 { break-after: avoid; break-inside: avoid; page-break-after: avoid; }
  p, ul, ol, dl, blockquote, table, pre, figure { break-inside: avoid; }
  /* Improve paragraph flow on page breaks */
  p { orphans: 3; widows: 3; }

  /* Links: append URL for clarity (except anchors, mailto, tel, javascript) */
  a[href] {
    color: inherit !important;
    text-decoration: none;
  }
  a[href^="#"]::after,
  a[href^="mailto:"]::after,
  a[href^="tel:"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }
  a[href]:not([href^="#"]):not([href^="mailto:"]):not([href^="tel:"]):not([href^="javascript:"])::after {
    content: " (" attr(href) ")";
    font-weight: normal;
    word-break: break-all;
  }

  /* Images & figures */
  img, svg, video, canvas {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }
  figure {
    margin: 0 0 10pt;
  }
  figcaption {
    font-size: 10pt;
    color: #333;
    margin-top: 4pt;
  }

  /* Tables (WP core + block styles) */
  table, .wp-block-table table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: auto;
    page-break-inside: avoid;
  }
  thead { display: table-header-group; } /* repeat headers on each page */
  tfoot { display: table-footer-group; }
  tr { break-inside: avoid; }
  th, td {
    border: 1pt solid #000;
    padding: 6pt 8pt;
    vertical-align: top;
    word-wrap: break-word;
  }
  th {
    font-weight: 700;
    text-align: left;
    background: #f2f2f2 !important; /* light contrast in print */
  }
  /* If the live site uses zebra striping with backgrounds, keep it subtle */
  tr:nth-child(even) td {
    background: #fafafa !important;
  }

  /* Code/preformatted blocks */
  pre, code, kbd, samp {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  }
  pre, .wp-block-code {
    border: 1pt solid #000;
    padding: 8pt;
    white-space: pre-wrap;      /* wrap long lines */
    word-wrap: break-word;
    overflow: visible !important;
    background: #f7f7f7 !important;
  }

  /* Blockquotes */
  blockquote {
    border-left: 3pt solid #000;
    padding-left: 10pt;
    color: #111;
  }

  /* Definition lists often appear in guidance */
  dt { font-weight: 700; }
  dd { margin: 0 0 8pt 0; }

  /* Utility: allow authors to mark “don’t print” areas */
  .no-print, .screen-only { display: none !important; }

  /* Utility: optional title & meta block visible only in print
     Add a small block near the top of main/article with class .print-meta if desired. */
  .print-meta {
    display: block !important;
    font-size: 10pt;
    color: #333 !important;
    margin: 0 0 12pt;
  }
  .print-meta .label { font-weight: 700; }

  /* Expand <details> elements even if not "open" */
	details > *:not(summary) { display: block !important; }
	details { overflow: visible !important; height: auto !important; }
	details[open] > summary,
	details > summary { break-after: avoid; }


	/* Keep panel headings with their content */
	.accordion,
	.accordion-item,
	.accordion-header,
	.accordion-title,
	.wp-block-aasld-accordion__header,
	[role="tab"] {
	break-after: avoid;
	page-break-after: avoid;
	}

}

