/*
 * MENNER Tiefbau – erste Druckformatierung
 * Fuer Papierausdruck und "Als PDF speichern" im Browser.
 * Einbindung im TypoScript:
 * page.includeCSS.print = fileadmin/config/script/css/print.css
 * page.includeCSS.print.media = print
 *
 * Grundlage: vorhandene HTML-Struktur der Startseite.
 * Unterseiten, Galerien und Formulare bitte in der Druckvorschau pruefen.
 * Die Bildschirm-CSS wird derzeit mit media="screen" geladen;
 * deshalb definiert diese Datei die grundlegende Druckgestaltung selbst.
 */

@page {
  size: A4 portrait;
  margin: 15mm;
}

@media print {
  *, *::before, *::after {
    box-sizing: border-box;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  html, body {
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    color: #000 !important;
    font: 11pt/1.45 Arial, Helvetica, sans-serif;
  }

  /* Navigation, Suche, Slider und Bedienelemente entfallen. */
  nav, .headerinfowrap, .socials, .headslogan,
  #flexslidercontent, .flexslider,
  .flex-direction-nav, .flex-control-nav,
  .searchcontent, .kesearch_searchbox, .top_link,
  .glightbox-container, .no-print,
  #usercentrics-root, #CybotCookiebotDialog,
  #CybotCookiebotDialogBodyUnderlay,
  #CookiebotWidget, .uc-embedding-container,
  video, audio, iframe, button,
  input[type="submit"], input[type="button"] {
    display: none !important;
  }

  /* Einspaltige Ausgabe ohne feste Bildschirmbreiten oder Hoehen. */
  #container, #wrapper, main, #mainwrapstart, #mainwrap,
  .contentwrap, .maincontent, .mainmidtext,
  .mainleft, .mainmid, .mainright,
  .mainmidinner, .mainsubcenter, .boxequal,
  .ce-textpic, .ce-bodytext, .ce-gallery, .ce-row, .ce-column,
  .row, [class^="col-"], [class*=" col-"] {
    display: block !important;
    position: static !important;
    float: none !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    transform: none !important;
    background: transparent !important;
    color: #000 !important;
  }

  .frame, .maincontent, .mainleft, .mainmid, .mainright {
    margin-bottom: 6mm !important;
  }

  /* Logo einmal am Anfang; kein fixierter oder wiederholter Header. */
  #topmenubox {
    position: static !important;
    height: auto !important;
    margin: 0 0 8mm !important;
    padding: 0 0 4mm !important;
    border-bottom: 1pt solid #999;
    background: #fff !important;
  }

  #headpic {
    margin: 0 !important;
    padding: 0 !important;
  }

  #headpic img {
    display: block;
    width: 55mm !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* Gut lesbare Schrift ohne farbige oder dekorative Hintergruende. */
  main *, footer * {
    color: #000 !important;
    background: transparent !important;
  }

  h1, h2, h3, h4, h5, h6 {
    margin: 5mm 0 2mm !important;
    line-height: 1.2 !important;
    break-after: avoid-page;
    page-break-after: avoid;
  }

  h1 { font-size: 21pt !important; }
  h2 { font-size: 17pt !important; }
  h3 { font-size: 14pt !important; }
  h4, h5, h6 { font-size: 11pt !important; }

  p, li, address, td, th, figcaption, .lead {
    font-size: 11pt !important;
    line-height: 1.45 !important;
  }

  p { margin: 0 0 3mm; orphans: 3; widows: 3; }
  ul, ol { margin: 0 0 4mm; padding-left: 6mm; }
  li { margin-bottom: 1.5mm; }
  a { color: #000 !important; text-decoration: underline; overflow-wrap: anywhere; }

  /* Keine automatisch angehaengten langen Link-Adressen. */
  a[href]::after { content: none !important; }

  /* Bilder bleiben erhalten, werden aber fuer Papier begrenzt. */
  figure { margin: 0 0 4mm; }
  img, svg {
    max-width: 100% !important;
    height: auto;
  }
  main img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-height: 75mm !important;
    object-fit: contain;
    margin: 0 0 3mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  figcaption { margin-top: 1mm; font-size: 9pt !important; }

  /* Nur kleine Einheiten zusammenhalten; lange Texte duerfen umbrechen. */
  figure, tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  table { width: 100%; border-collapse: collapse; }
  thead { display: table-header-group; }
  th, td { padding: 2mm; border: 0.5pt solid #aaa; text-align: left; }

  /* Kontaktblock im Footer behalten, Linkliste ausblenden. */
  footer {
    position: static !important;
    margin-top: 8mm !important;
    padding-top: 4mm !important;
    border-top: 1pt solid #999;
    background: #fff !important;
  }
  footer .mainmid { display: none !important; }
  footer p { font-size: 9pt !important; }
}
