:root {
  --md-primary-fg-color: #EF7D00;
  --md-primary-fg-color--light: #ffffff;
  --md-primary-fg-color--dark: #700030;
  --md-accent-fg-color: #495757;
}
/* Navigation typography */
.md-nav__title { font-size: 1.2rem; }
.md-nav__item .md-nav__link { font-size: 0.8rem; }
/* Image helper classes */
.img-small, .img-medium, .img-large, .img-full {
  display: block;
  margin: 0.5rem auto;
  height: auto;
  max-width: 100%;
}
.img-small  { width: 25%; }
.img-medium { width: 50%; }
.img-large  { width: 75%; }
.img-full   { width: 100%; }
.img-right {
  float: right;
  margin: 0 0 1rem 1rem;
}
/* Überschriften ab H3: Standard-Style beibehalten, aber größer.
   Ziel: bessere TOC-Erkennbarkeit, H4/H5 nur marginal kleiner. */
.md-typeset h3{
  font-size: 22px;
  line-height: 31.8px;
  font-weight: 400;
  letter-spacing: -0.1px;
  margin-top: 24px;
  margin-bottom: 10px;
}
.md-typeset h4{
  font-size: 20px;
  line-height: 30.3px;
  font-weight: 400;
  letter-spacing: -0.1px;
  margin-top: 24px;
  margin-bottom: 10px;
}
.md-typeset h5{
  font-size: 19px;
  line-height: 28.9px;
  font-weight: 400;
  letter-spacing: -0.1px;
  margin-top: 24px;
  margin-bottom: 10px;
  text-transform: none;
  color: rgba(0, 0, 0, 0.87);
}
@media print {
  /* Hide UI + PDF button */
  .pdf-fab,
  .md-sidebar,
  .md-header,
  .md-footer,
  .md-tabs {
    display: none !important;
  }
  .md-main__inner { margin: 0 !important; }
  .md-content { max-width: 100% !important; }
  /* Single source of truth for page margins (header/footer area included) */
  @page { size: A4; margin: 32mm 12mm 18mm 12mm; }
  body, .md-content, .md-typeset {
    font-family: Arial, Helvetica, sans-serif !important;
  }
  /* Break rules + Chromium fallbacks */
  h1, h2, h3, h4 {
    break-after: avoid-page;
    page-break-after: avoid;
  }
  p, li { orphans: 3; widows: 3; }
  img, pre, blockquote, .admonition {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  table { break-inside: avoid; }
  section.doc-block {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  section.doc-block table { break-inside: auto !important; }
  .page-break { break-before: page; page-break-before: always; }
  /* break-config-1 */
  section.breakcfg.break-config-1 h2,
  section.breakcfg.break-config-1 h3 {
    break-before: page;
    page-break-before: always;
  }
  /* … außer beim ersten H2 auf der Seite */
  .md-typeset h2:first-of-type {
    break-before: auto;
    page-break-before: auto;
  }
    /* Ganze Liste möglichst zusammenhalten */
  ul, ol {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  /* Einzelne Listeneinträge nicht trennen (falls sie selbst mehrzeilig sind) */
  li {
    break-inside: avoid;
    page-break-inside: avoid;
  }
    /* Überschrift soll nicht alleine am Seitenende stehen */
  .md-typeset h1, .md-typeset h2, .md-typeset h3, .md-typeset h4, .md-typeset h5 {
    break-after: avoid-page;
    page-break-after: avoid;
  }
  /* Wenn direkt nach der Überschrift ein Absatz kommt: zusammenhalten */
  .md-typeset h1 + p,
  .md-typeset h2 + p,
  .md-typeset h3 + p,
  .md-typeset h4 + p,
  .md-typeset h5 + p {
    break-before: avoid;
    page-break-before: avoid;
  }
  /* Wenn direkt nach der Überschrift eine Liste kommt: zusammenhalten */
  .md-typeset h1 + ul, .md-typeset h1 + ol,
  .md-typeset h2 + ul, .md-typeset h2 + ol,
  .md-typeset h3 + ul, .md-typeset h3 + ol,
  .md-typeset h4 + ul, .md-typeset h4 + ol,
  .md-typeset h5 + ul, .md-typeset h5 + ol {
    break-before: avoid;
    page-break-before: avoid;
  }
  /* Cover (no fixed height => prevents overflow blank page)
     Grid => image can be vertically centered between top/bottom text blocks. */
  .pdf-cover{
    page-break-after: always;
    width: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    row-gap: 6mm;
    /* Cover typography base */
    font-size: 2em;
    line-height: 2;
  }
  /* Cover H1 separat (falls dir 2em zu groß ist) */
  .pdf-cover h1{
    font-size: 1.0em; /* relativ zu .pdf-cover (2em). Beispiel: 0.8–1.2em */
    line-height: 1.1;
  }
  .pdf-cover h1, .pdf-cover h2, .pdf-cover p{
    margin-block: 0.2rem;
  }
  /* Full width image, but hard mm height limit (stable in print) + vertical centering */
  .pdf-cover img{
    width: 100% !important;
    height: auto !important;
    max-height: 135mm !important;   /* adjust 125–150mm if needed */
    object-fit: contain !important;
    /* Grid centering (vertical + horizontal) */
    justify-self: center;
    align-self: center;
    /* Let grid control spacing (avoid pushing to next page) */
    margin: 0 !important;
    display: block !important;
  }
  .pdf-cover .img-small,
  .pdf-cover .img-full{
    width: 100% !important;
    max-width: 100% !important;
  }
  /* TOC */
  .pdf-toc { page-break-after: always; }
  .pdf-toc h1, .pdf-toc h2 { page-break-after: avoid; }
  .pdf-toc ol { padding-left: 1.2rem; }
  .pdf-toc li { margin: 0.15rem 0; }
  /* Prevent double page breaks right after cover/TOC */
  .pdf-cover + * {
    break-before: auto !important;
    page-break-before: auto !important;
  }
  .pdf-toc + * {
    break-before: auto !important;
    page-break-before: auto !important;
  }
}