/*
 * Rezeptwerk Print Stylesheet
 * Optimized for A4 printing, removing ads, sidebars, and unnecessary UI elements.
 */

@media print {
    /* 1. Reset & Setup */
    * {
        -webkit-print-color-adjust: exact !important;
        color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page {
        margin: 1.5cm;
        size: A4 portrait;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
        line-height: 1.4;
    }

    /* 2. Hide Unnecessary Elements */
    .site-header,
    .site-footer,
    .sidebar,
    .recipe-sidebar,
    .comments-area,
    .related-recipes,
    .newsletter-box,
    .ads-container,
    .btn,
    button,
    .social-share,
    #wpadminbar,
    .cook-mode-toggle,
    .recipe-instructions__step-image,
    .recipe-nutrition__details {
        display: none !important;
    }

    /* 3. Layout Adjustments */
    .site-content,
    .container,
    .recipe-grid,
    .single-recipe-layout {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }

    .recipe-main-content {
        width: 100% !important;
    }

    /* 4. Recipe Header */
    .recipe-header {
        text-align: center;
        margin-bottom: 20px;
        page-break-after: avoid;
    }

    .recipe-header__title {
        font-size: 24pt;
        margin-bottom: 10px;
        color: #000 !important;
    }

    .recipe-header__meta {
        justify-content: center !important;
        margin-bottom: 15px;
        font-size: 10pt;
    }

    /* 5. Recipe Image */
    .recipe-header__image-wrapper {
        text-align: center;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .recipe-header__image {
        max-width: 400px !important;
        height: auto !important;
        margin: 0 auto;
        border-radius: 0 !important;
    }

    /* 6. Ingredients */
    .recipe-ingredients {
        page-break-inside: avoid;
        border: 1px solid #ccc;
        padding: 15px;
        margin-bottom: 20px;
        border-radius: 0;
        background: transparent !important;
    }

    .recipe-ingredients__list {
        columns: 2;
        column-gap: 40px;
    }

    .recipe-ingredients__item {
        margin-bottom: 8px;
        font-size: 11pt;
        page-break-inside: avoid;
    }

    /* 7. Instructions */
    .recipe-instructions {
        margin-bottom: 20px;
    }

    .recipe-instructions__item {
        page-break-inside: avoid;
        margin-bottom: 15px;
        border-bottom: 1px dashed #eee;
        padding-bottom: 15px;
    }

    .recipe-instructions__step-badge {
        background: #000 !important;
        color: #fff !important;
        border-radius: 50% !important;
        -webkit-print-color-adjust: exact;
    }

    /* 8. Links */
    a {
        text-decoration: none !important;
        color: #000 !important;
    }
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        word-break: break-all;
    }
    a[href^="javascript:"]:after,
    a[href^="#"]:after {
        content: "";
    }
}
