/**
 * WP Recipe Print Styles
 * Стилі для друку рецептів
 */
 
/* Загальні стилі для кнопки друку */
#printBtn {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

#printBtn:hover {
    opacity: 0.8;
}

#printBtn.loading {
    opacity: 0.6;
    cursor: wait;
}

/* Стилі для друку */
@media print {
    /* Приховуємо непотрібні елементи при друку */
    header,
    footer,
    nav,
    .site-header,
    .site-footer,
    .navigation,
    .sidebar,
    .widget,
    .comments,
    .comment-form,
    .social-share,
    .interaction-button,
    .advertisement,
    .ad,
    .popup,
    .modal,
    #wpadminbar,
    .no-print {
        display: none !important;
    }
    
    /* Оптимізація сторінки для друку */
    * {
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        margin: 0;
        padding: 20px;
        font-family: "Times New Roman", Times, serif;
        font-size: 12pt;
        line-height: 1.6;
        color: #000 !important;
    }
    
    /* Заголовки */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
        color: #000 !important;
    }
    
    h1 {
        font-size: 24pt;
        margin-bottom: 10pt;
    }
    
    h2 {
        font-size: 18pt;
        margin-top: 15pt;
        margin-bottom: 8pt;
    }
    
    h3 {
        font-size: 14pt;
        margin-top: 12pt;
        margin-bottom: 6pt;
    }
    
    /* Параграфи */
    p {
        margin: 0 0 10pt 0;
        orphans: 3;
        widows: 3;
    }
    
    /* Зображення */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
        page-break-after: avoid;
    }
    
    /* Списки */
    ul, ol {
        margin: 10pt 0;
        padding-left: 20pt;
    }
    
    li {
        margin-bottom: 5pt;
        page-break-inside: avoid;
    }
    
    /* Таблиці */
    table {
        border-collapse: collapse;
        width: 100%;
        page-break-inside: avoid;
        margin: 10pt 0;
    }
    
    table, th, td {
        border: 1px solid #000;
    }
    
    th, td {
        padding: 8pt;
        text-align: left;
    }
    
    th {
        background-color: #f0f0f0 !important;
        font-weight: bold;
    }
    
    /* Розриви сторінок */
    .page-break {
        page-break-before: always;
    }
    
    .page-break-after {
        page-break-after: always;
    }
    
    .no-page-break {
        page-break-inside: avoid;
    }
    
    /* Блоки рецепту */
    .recipe-meta,
    .recipe-ingredients,
    .recipe-instructions {
        page-break-inside: avoid;
        margin-bottom: 15pt;
    }
    
    .recipe-ingredients {
        border: 1pt solid #000;
        padding: 10pt;
        margin-top: 15pt;
    }
    
    .recipe-instructions {
        margin-top: 15pt;
    }
    
    /* Посилання */
    a {
        color: #000 !important;
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        font-style: italic;
    }
    
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
    
    /* Форматування дати та автора */
    .entry-meta,
    .post-meta {
        font-size: 10pt;
        margin-bottom: 15pt;
        color: #666 !important;
    }
    
    /* Підвал сторінки при друку */
    .print-footer {
        position: fixed;
        bottom: 0;
        width: 100%;
        text-align: center;
        font-size: 9pt;
        color: #666 !important;
        border-top: 1pt solid #ccc;
        padding-top: 5pt;
        margin-top: 20pt;
    }
}

/* Стилі для окремої сторінки друку */
.print-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: "Times New Roman", Times, serif;
}

.print-page .print-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #000;
}

.print-page .print-title {
    font-size: 32px;
    margin-bottom: 10px;
    color: #000;
}

.print-page .print-meta {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

.print-page .print-content {
    line-height: 1.8;
    font-size: 16px;
}

.print-page .print-image {
    text-align: center;
    margin: 20px 0;
}

.print-page .print-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
}

.print-page .recipe-section {
    margin-bottom: 30px;
}

.print-page .recipe-section h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #000;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}

.print-page .ingredients-list,
.print-page .instructions-list {
    padding-left: 25px;
}

.print-page .ingredients-list li,
.print-page .instructions-list li {
    margin-bottom: 10px;
}

.print-page .print-footer-info {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ccc;
    text-align: center;
    font-size: 12px;
    color: #999;
}
