/**
 * Total Recipe Generator Print Styles
 *
 * Clean, distraction-free printable stylesheet for recipes.
 * Automatically excludes navigation, footers, sidebars, ads, and interactive buttons.
 *
 * @package Total_Recipe_Generator_El
 * @version 2.4.0
 */

@page {
    size: auto;
    margin: 15mm 15mm 15mm 15mm;
}

@media print {
    /* Hide distractions and interactive elements (Fecha excluida completamente de la impresión) */
    header,
    nav,
    footer,
    aside,
    sidebar,
    .site-header,
    .site-footer,
    .main-navigation,
    .widget-area,
    .sidebar,
    #comments,
    .comments-area,
    .post-navigation,
    .nav-links,
    .trg-recipe-actions,
    .trg-no-print,
    .post-date,
    .recipe-meta .post-date,
    [itemprop="datePublished"],
    .trg-sharing,
    .trg-ad-spot,
    .trg-editorial-warning,
    .cookie-notice,
    .elementor-element-overlay,
    .elementor-editor-element-setting {
        display: none !important;
    }

    /* Isolated single recipe print targeting */
    body.trg-is-printing * {
        visibility: hidden !important;
    }

    body.trg-is-printing .trg-print-target-active,
    body.trg-is-printing .trg-print-target-active * {
        visibility: visible !important;
    }

    body.trg-is-printing .trg-print-target-active {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Base print typography */
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
        font-size: 11pt !important;
        line-height: 1.5 !important;
    }

    .trg-recipe {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        font-size: 11pt !important;
    }

    /* Print header (Site Branding) */
    .trg-print-only {
        display: block !important;
        visibility: visible !important;
    }

    .trg-print-header {
        border-bottom: 2px solid #2e7d32;
        padding-bottom: 8px;
        margin-bottom: 16px;
    }

    .trg-print-site-name {
        font-size: 16pt;
        font-weight: 700;
        color: #2e7d32;
        display: block;
    }

    .trg-print-tagline {
        font-size: 9pt;
        color: #555555;
    }

    /* Recipe Title */
    .trg-recipe .recipe-title {
        font-size: 20pt !important;
        color: #000000 !important;
        margin: 0 0 6px 0 !important;
        page-break-after: avoid;
        break-after: avoid;
    }

    /* Photo (Centrada y en su tamaño original en impresión) */
    .trg-recipe .recipe-image,
    .trg-recipe .trg-recipe-image-wrap {
        width: 100% !important;
        margin: 10px auto 16px auto !important;
        page-break-inside: avoid;
        break-inside: avoid;
        text-align: center !important;
    }

    .trg-recipe .recipe-image img,
    .trg-recipe .trg-recipe-image-wrap img,
    .trg-recipe img.trg-image {
        max-width: 100% !important;
        max-height: 350px !important;
        height: auto !important;
        border-radius: 4px;
        display: inline-block !important;
        margin: 0 auto !important;
    }

    /* Info Board (Meta) */
    .trg-recipe .info-board {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
        background: #f4f6f5 !important;
        border: 1px solid #d0d7d4 !important;
        border-radius: 6px !important;
        padding: 10px 14px !important;
        margin: 14px 0 !important;
        page-break-inside: avoid;
        break-inside: avoid;
        list-style: none !important;
    }

    .trg-recipe .info-board > li {
        flex: 1 1 auto !important;
        text-align: center !important;
        padding: 4px 8px !important;
    }

    .trg-recipe .info-board > li .ib-label {
        font-size: 8.5pt !important;
        text-transform: uppercase !important;
        color: #555555 !important;
        display: block !important;
    }

    .trg-recipe .info-board > li .ib-value {
        font-size: 11pt !important;
        font-weight: 700 !important;
        color: #000000 !important;
    }

    .trg-recipe .info-board > li .ib-icon {
        display: none !important; /* Hide SVGs in info board on print to keep clean text */
    }

    /* Headings con Iconos Font Awesome visibles */
    .trg-recipe .recipe-heading {
        font-size: 13pt !important;
        color: #2e7d32 !important;
        border-bottom: 1.5px solid #2e7d32 !important;
        padding-bottom: 4px !important;
        margin-top: 18px !important;
        margin-bottom: 10px !important;
        page-break-after: avoid;
        break-after: avoid;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .trg-recipe .recipe-heading .trg-heading-icon {
        display: inline-flex !important;
        align-items: center !important;
    }

    .trg-recipe .recipe-heading .trg-heading-icon svg {
        display: inline-block !important;
        width: 14pt !important;
        height: 14pt !important;
        fill: #2e7d32 !important;
    }

    /* Ingredients con Checkboxes Cuadrados [ ] para marcar en papel */
    .trg-recipe .trg-interactive-ingredients,
    .trg-recipe .ing-list {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 0 16px 0 !important;
    }

    .trg-recipe .trg-ingredient-row,
    .trg-recipe .ing-list > li {
        display: block !important;
        padding: 5px 0 !important;
        border-bottom: 1px dotted #ccc !important;
        page-break-inside: avoid;
        break-inside: avoid;
        font-size: 10.5pt !important;
    }

    .trg-recipe .trg-ingredient-label {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Casilla cuadrada vacía [ ] lista para marcar a mano con bolígrafo */
    .trg-recipe .trg-ingredient-checkbox {
        display: inline-block !important;
        appearance: none !important;
        -webkit-appearance: none !important;
        width: 12px !important;
        height: 12px !important;
        min-width: 12px !important;
        border: 1.5px solid #2e7d32 !important;
        border-radius: 2px !important;
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        vertical-align: middle !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        flex-shrink: 0 !important;
    }

    .trg-recipe .ing-list > li .ing-check-icon {
        display: none !important;
    }

    /* Instructions con insignias de paso e iconos */
    .trg-recipe .recipe-instruction {
        margin-bottom: 12px !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .trg-recipe .step-num {
        background: #2e7d32 !important;
        color: #ffffff !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 10pt !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .trg-recipe .step-header-meta {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin-bottom: 4px !important;
    }

    .trg-recipe .step-badge {
        display: inline-flex !important;
        align-items: center !important;
        gap: 4px !important;
        border: 1px solid #bbf7d0 !important;
        background: #f0fdf4 !important;
        padding: 1px 6px !important;
        border-radius: 3px !important;
        font-size: 9pt !important;
        color: #2e7d32 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .trg-recipe .step-badge .step-icon svg {
        display: inline-block !important;
        width: 9pt !important;
        height: 9pt !important;
        fill: #2e7d32 !important;
    }

    .trg-recipe .step-title-text {
        font-weight: 700 !important;
        color: #000000 !important;
        font-size: 10.5pt !important;
    }

    .trg-recipe .step-content {
        font-size: 10.5pt !important;
        line-height: 1.5 !important;
    }

    /* Tips & Equipment */
    .trg-recipe .trg-tips-box,
    .trg-recipe .trg-equipment-box {
        border: 1px solid #ccc !important;
        border-left: 4px solid #2e7d32 !important;
        background: #fafafa !important;
        padding: 10px 14px !important;
        margin: 14px 0 !important;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Nutrition */
    .trg-recipe .nutrition-section {
        page-break-inside: avoid;
        break-inside: avoid;
        margin-top: 16px !important;
    }

    .trg-recipe .nutrition-table {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        list-style: none !important;
        padding: 0 !important;
    }

    .trg-recipe .nutrition-table > li {
        border: 1px solid #ddd !important;
        padding: 4px 8px !important;
        font-size: 9pt !important;
        background: #ffffff !important;
    }

    /* Print Footer (Source Link) */
    .trg-print-footer {
        margin-top: 24px !important;
        padding-top: 10px !important;
        border-top: 1px solid #ccc !important;
        font-size: 9pt !important;
        color: #555555 !important;
        page-break-before: avoid;
        break-before: avoid;
    }
}