@media print {


  /* Imposta un font leggibile per la stampa */
  body {
    font-family: sans-serif;
    color: black !important;
    background: white !important;
    margin: 1cm!important;;
    font-size: 10pt!important;
    line-height: 1.4;
    padding:0!important;

  }

  main  {margin:0!important;}

  /* Impedisce che si spezzi tra pagine */
  .notices, 
  .custom-alert {
    page-break-inside: avoid;
    background: none !important;
    color: black !important;
  }


  .kicker {
font-size: 10pt!important;
  }
  
  /* Titoli più evidenti */
  h1, h2, h3, h4 {
    color: black !important;
    page-break-after: avoid;
  }

  /* Evita rotture nelle tabelle */
  table {
    page-break-inside: avoid;
    border-collapse: collapse;
    width: 100%;
  }

  th, td {
    border: 1px solid #ccc;
    padding: 4px;
  }

  /* 
  a:not([aria-hidden="true"])::after {
  content: " (" attr(href) ")";
}
  */

  /* Evita immagini troppo grandi */
  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }

  /* Codice leggibile */
  pre, code {
    font-family: monospace;
    white-space: pre-wrap;
    background: #f0f0f0 !important;
    color: black !important;
    padding: 1px;
    border: 1px dotted #ccc !important;
  }



pre code {
  max-height: inherit !important;

}



/* Common font and reset for all headings */
h1, h2, h3, h4, h5, h6 {
margin:1em!important;
padding:0.5em!important;
border:0;
page-break-inside: avoid;
}

h2::after {
    content: "";
    display: block;
    height: 100px;
    margin-bottom: -100px;
}





  #toc,
  #footer,
  #skiplinks,
  #btn-back-to-top,
  #controls,
  #btools,
  #toc-toggle,
  .copy-button,
  .collapse-button,
  #exportWord,
  #pdf-print-btn,
  .modal,
  .anchor-link,
  .btn-mermaid, 
  #bottomnav,
  summary,
  button {
    display: none !important;
    visibility:hidden !important;
  }

}