/* Drucklayout: ausschliesslich fuer Papier und PDF. */
@media print {
    @page {
        size: A4;
        margin: 18mm 16mm;
    }

    *,
    *::before,
    *::after {
        box-sizing: border-box;
        color: #000 !important;
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
        animation: none !important;
        transition: none !important;
    }

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

    /* Keine Bedienoberflaechen, Formulare oder dekorativen Medien. */
    .noprint,
    .visually-hidden,
    .sr-only,
    [hidden],
    form,
    input,
    textarea,
    select,
    button,
    .header-main:not(header),
    nav:not(#navbar),
    .skip-link,
    .btn:not(.btn-link),
    .modal,
    .modal-backdrop,
    .offcanvas,
    .offcanvas-backdrop,
    .totop,
    #accessibility-widget,
    #accessibility-widget-toggler,
    .cc-window,
    .cc-revoke,
    iframe,
    video,
    audio,
    canvas,
    object,
    embed,
    svg,
    .fa,
    [class*="fa-"],
    .slick-arrow,
    .slick-dots,
    .slick-autoplay-toggle-button,
    .slick-cloned {
        display: none !important;
    }

    /* Ausnahmen direkt im Ausschluss: noprint bleibt auch bei diesen Bildern wirksam. */
    img:not(:is(header.header-main .navbar-brand img, #project-list img, .project-slider img, .personCardInner img)) {
        display: none !important;
    }

    :is(#project-list, .project-slider, .personCardInner) img {
        position: static !important;
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: 65mm !important;
        object-fit: contain !important;
        border-radius: 0 !important;
        break-inside: avoid;
    }

    .personCardInner img {
        max-height: 40mm !important;
    }

    /* Einspaltiger Lesefluss, auch bei aktiviertem Barrierefreiheits-Layout. */
    html body :is(#content, #footer) :is(.container, [class*="container-"], .row) {
        display: block !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html body :is(#content, #footer) .row > * {
        float: none !important;
        flex: none !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 0 4mm !important;
        padding: 0 !important;
    }

    #content,
    .content-main,
    .lesbar,
    .hero,
    .card,
    .card-body,
    .image-container-full {
        display: block;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    #content :is(.py-5, .py-lg-5, .p-4, .pe-lg-5, .ps-xl-5, .card-body) {
        padding: 0 !important;
    }

    #content :is(section, article, .hero) {
        margin: 0 0 6mm !important;
    }

    .hero::before,
    .image-container::before,
    .image-container-full::before,
    .timeline::before,
    .timeline-item::before,
    .timeline-marker {
        display: none !important;
        content: none !important;
    }

    .card,
    [class*="border-"] {
        border: 0 !important;
    }

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

    h1 { font-size: 20pt !important; }
    h2 { font-size: 16pt !important; }
    h3 { font-size: 13pt !important; }
    h4, h5, h6 { font-size: 10.5pt !important; }

    p, li, address, dt, dd {
        font-size: 10.5pt !important;
        orphans: 3;
        widows: 3;
    }

    p { margin: 0 0 3mm !important; }
    a { text-decoration: underline; overflow-wrap: anywhere; }
    a.btn-link { padding: 0 !important; font: inherit !important; }
    pre { white-space: pre-wrap; }
    table { width: 100%; border-collapse: collapse; }
    thead { display: table-header-group; }
    tr, figure, .personCardInner { break-inside: avoid; }
    th, td { padding: 2mm; border: 1px solid #999; }

    .timeline,
    .timeline-item {
        display: block !important;
        padding: 0 !important;
        margin: 0 0 3mm !important;
    }

    /* Alle Originalfolien drucken, ohne Abschneiden und ohne Slider-Kopien. */
    .project-slider,
    .project-slider .slick-list,
    .project-slider .slick-track,
    .project-slider .slick-slide {
        display: block !important;
        position: static !important;
        float: none !important;
        width: auto !important;
        height: auto !important;
        overflow: visible !important;
        transform: none !important;
        opacity: 1 !important;
    }

    .project-slider .slick-cloned { display: none !important; }
    .project-slider .position-relative { padding-top: 0 !important; }
    .project-slider .card { margin-bottom: 5mm !important; break-inside: avoid; }

    #footer {
        margin-top: 6mm !important;
        padding-top: 4mm !important;
        border-top: 1px solid #999;
        text-align: left !important;
    }
    /* Im Seitenkopf nur das Logo, ohne fixierte Navigation. */
    header.header-main,
    header.header-main #navbar,
    header.header-main #navbar > .container {
        display: block !important;
        position: static !important;
        width: auto !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    header.header-main .navbar-brand {
        display: block;
        margin: 0 0 8mm !important;
        padding: 0 !important;
    }

    header.header-main .navbar-brand img {
        width: 45mm !important;
        height: auto !important;
        max-width: 100% !important;
        max-height: none !important;
    }

    /* Kontaktdaten kompakt und auch mit Desktop-Telefonbuttons sichtbar. */
    #footer { display: block !important; break-inside: avoid; }
    html body #footer .footer-contact-row > :first-child { display: none !important; }
    html body #footer .footer-contact-row > :last-child {
        margin-bottom: 2mm !important;
        text-align: left !important;
    }
    #footer .footer-contact-row br { display: block !important; }
    #footer .footer-contact-row .d-lg-none { display: none !important; }
    #footer .text-center { text-align: left !important; }
    #footer .footer-contact-row button.btn-link {
        display: inline !important;
        border: 0 !important;
        padding: 0 !important;
        font: inherit !important;
        text-decoration: none !important;
    }
    /* Ruhige Dokumentgestaltung; Rahmen funktionieren auch ohne Hintergrunddruck. */
    header.header-main .navbar-brand {
        margin-bottom: 7mm !important;
        padding-bottom: 5mm !important;
        border-bottom: 0.6mm solid #DF2A4B !important;
    }

    #content h1 {
        font-size: 25pt !important;
        font-weight: 700 !important;
        letter-spacing: -0.035em;
        text-transform: none !important;
        margin-bottom: 4mm !important;
    }

    #content h2 {
        font-size: 16pt !important;
        letter-spacing: -0.02em;
        text-transform: none !important;
    }

    #content h3 { text-transform: none !important; }
    #content .eyebrow {
        color: #8f2036 !important;
        font-size: 8.5pt !important;
        font-weight: 700;
        letter-spacing: 0.12em;
        margin-bottom: 3mm !important;
    }

    #content .hero {
        border-bottom: 0.25mm solid #cbd0d5;
        padding-bottom: 5mm !important;
        margin-bottom: 7mm !important;
    }

    /* Vorhandene Inhaltskarten sowie einzelne Referenzprojekte. */
    #content .card,
    #project-list > article {
        border: 0.25mm solid #cbd0d5 !important;
        border-radius: 3mm !important;
        padding: 5mm !important;
        margin-bottom: 5mm !important;
        break-inside: avoid;
        page-break-inside: avoid;
        box-decoration-break: clone;
        -webkit-box-decoration-break: clone;
    }

    #content .card .card {
        border: 0 !important;
        padding: 0 !important;
    }

    #content .card-body > :last-child,
    #content .card p:last-child {
        margin-bottom: 0 !important;
    }

    /* Portraet und Beschreibung bilden eine gemeinsame, kompakte Karte. */
    html body #content .personCardInner.row {
        display: grid !important;
        grid-template-columns: 30mm minmax(0, 1fr);
        gap: 5mm;
        align-items: start;
    }

    html body #content .personCardInner.row > * {
        margin-bottom: 0 !important;
        min-width: 0;
    }

    :is(#project-list, .project-slider, .personCardInner) img {
        border-radius: 2mm !important;
    }

    /* Drei Kontaktkarten statt langer, untereinander stehender Footerzeilen. */
    #footer {
        border-top: 0.5mm solid #DF2A4B !important;
        padding-top: 4mm !important;
    }

    html body #footer > .container > .row {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 3mm;
    }

    html body #footer > .container > .row > :not(.noprint) {
        width: auto !important;
        min-width: 0;
        padding: 3mm !important;
        margin: 0 !important;
        border: 0.25mm solid #cbd0d5 !important;
        border-radius: 2mm;
        font-size: 9pt !important;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    #footer p,
    #footer a,
    #footer .footer-contact-row button.btn-link {
        font-size: 9pt !important;
        text-decoration: none !important;
    }

    #footer p { font-weight: 700; }
    /* Kernkompetenzen: zwei gleich breite Karten pro Druckzeile. */
    html body #content :where(#leistungsspektrum) > .container > .row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4mm;
    }

    html body #content :where(#leistungsspektrum) > .container > .row > * {
        width: auto !important;
        min-width: 0;
        margin: 0 !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    #content #leistungsspektrum .card {
        height: 100% !important;
        margin: 0 !important;
    }
    /* Diese Ausschluesse haben auch gegen Layout- und Bildregeln Vorrang. */
    html body :is(body, #content, #footer) :is(.noprint, .visually-hidden, .sr-only, form, [hidden]) {
        display: none !important;
    }
}
