/* ============================================================
   print.css – Optimiert für den Druck der Rechtliche-Seite
   ============================================================ */

@media print {

    /* ---------- Seitenränder & Grundlagen ---------- */
    @page {
        margin-top: 1cm;
        margin-right: 2cm;
        margin-bottom: 2cm;
        margin-left: 2cm;
    }

    * {
        box-shadow: none !important;
        text-shadow: none !important;
        background: transparent !important;
        color: #000 !important;
    }

    body {
        padding-left: 2cm; /* Nutzen Sie cm oder mm für Druckerlayouts */
        padding-right: 2cm; /* Abstand von Rechts */
        margin-left: 0;      /* Verhindert Konflikte mit Browser-Standardrändern */

        font-size: 11pt;
        line-height: 1.5;
        background: #fff;
        color: #000;
    }
       
    /* ---------- Druck-Kopf beim Druck einblenden und als Flex-Container ---------- */
    .print-header {
        display: flex !important;
        justify-content: space-between;  /* Logo links, Kontakt rechts */
        align-items: center;             /* vertikal zentriert */
        margin-top: -1cm !important;
        padding-top: 0 !important;
        margin-bottom: 0.5rem;
        page-break-after: avoid;         /* verhindert, dass der Kopf allein auf einer Seite steht */
    }

    /* Logo-Bereich – links */
    .print-logo {
        flex: 0 0 auto;
        /* falls das SVG zu groß ist: */
        max-width: 40%;
    }
    
    /* ---------- Druck-Logo explizit dimensionieren ---------- */
    .print-logo svg {
        width: 150px !important;   /* oder was zu deinem Layout passt */
        height: auto !important;
        max-height: 80px !important;
        display: block !important;
    }

    /* Kontakt-Bereich – rechts */
    .print-contact {
        text-align: right;
        font-size: 10pt;
        line-height: 1.4;
        flex: 0 0 auto;
    }

    /* Durchgezogene Linie unter dem Kopf */
    .print-separator {
        display: block !important;
        border: none;
        border-top: 2px solid #000 !important;
        margin: 0.25rem 0 1.5rem 0;
        width: 100%;
    }
   
    /* ---------- Layout: Container, Row, Spalten ---------- */
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .row {
        display: block !important;
        margin: 0 !important;
    }

    .col-lg-4,
    .col-lg-8 {
        width: 100% !important;
        float: none !important;
        flex: none !important;
        padding: 0 !important;
    }

    /* ---------- Navigation ausblenden ---------- */
    .navbar,
    aside .legal-nav,
    #navRechtliches,
    .sticky-lg-top {
        display: none !important;
        position: static !important;
    }

    /* ---------- Cards als einfache Blöcke ---------- */
    .card {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        margin-bottom: 1.5rem !important;
        page-break-inside: avoid;
    }

    .card-body {
        padding: 0 !important;
    }

    /* ---------- Überschriften ---------- */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
        orphans: 3;
        widows: 3;
    }

    h2.h4 {
        font-size: 1.3rem;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
    }

    h3.h6 {
        font-size: 1rem;
        font-weight: bold;
        color: #000 !important;
        margin-top: 0.75rem;
        margin-bottom: 0.25rem;
    }

    /* ---------- Absätze, Listen ---------- */
    p, ul, li {
        orphans: 3;
        widows: 3;
    }

    ul {
        padding-left: 1.5rem;
    }

    /* ---------- Artikel – keine Trennung innerhalb ---------- */
    article {
        page-break-inside: avoid;
        margin-bottom: 2rem !important;
        padding-bottom: 2rem !important;
    }

    /* ---------- Alerts ---------- */
    .alert {
        border: 1px solid #ccc !important;
        background: #f9f9f9 !important;
        color: #000 !important;
        padding: 0.5rem 0.75rem !important;
        border-radius: 0 !important;
        
        /* NEU: Browser zwingen, Hintergrund zu drucken */
        -webkit-print-color-adjust: exact !important;  /* Chrome, Safari, Edge */
        print-color-adjust: exact !important;          /* Firefox, Standard */
    }

    /* ---------- Links: URL anzeigen (externe Links) ---------- */
    a[href]:not([href^="#"])::after {
        content: " (" attr(href) ")";
        font-size: 90%;
        color: #333 !important;
        text-decoration: none;
    }

    a {
        color: #000 !important;
        text-decoration: underline;
    }

    /* ---------- Abstände kompakter machen ---------- */
    .mb-4, .my-4 {
        margin-bottom: 0.75rem !important;
    }
    .mb-3 {
        margin-bottom: 0.5rem !important;
    }
    .mt-3 {
        margin-top: 0.5rem !important;
    }
    .py-4 {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
    .py-2 {
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
    .px-3 {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    /* ---------- Sekundärfarben auf Schwarz ---------- */
    .text-secondary {
        color: #000 !important;
    }

    /* ---------- Trennlinien ---------- */
    hr {
        border-top: 1px solid #ccc !important;
        margin: 0.5rem 0 !important;
    }

    /* ---------- Datum ---------- */
    .small {
        font-size: 9pt;
        color: #333 !important;
    }

    /* ---------- Zusätzliche Hintergrund-Entfernungen ---------- */
    .bg-light,
    .shadow-sm {
        background: transparent !important;
    }

    /* ---------- Spezielle Blöcke ---------- */
    .legal-block {
        margin-bottom: 0.5rem;
    }

    /* ---------- E‑Mail‑Link (JavaScript) – keine URL anzeigen ---------- */
    .js-mail .email-text {
        /* bleibt wie er ist, kein zusätzlicher Linktext */
    }
    .js-mail[href]::after {
        content: "" !important; /* verhindert, dass die mailto:-URL gedruckt wird */
    }

    /* ---------- Falls noch irgendwo Schatten oder abgerundete Ecken stören ---------- */
    .rounded,
    .rounded-3 {
        border-radius: 0 !important;
    }

    /* ---------- Force Hintergrund weiß für alle Container ---------- */
    .container,
    .card,
    .card-body,
    .legal-block,
    article,
    section,
    main {
        background: #fff !important;
    }
    
    footer, #contactform-info, #returnBttn {
    display: none !important;
    }
}

@media screen {
  .print-header, .print-separator {
    display: none;
  }
}