/*
 * Post Print Pro Print Styles
 */

/* --- Print Button Styling --- */
.ppp-print-button-container {
    margin: 20px 0; /* Add some space around the button */
    text-align: center; /* Center the button */
}

.ppp-print-button {
    display: inline-flex; /* Use flexbox for icon and text alignment */
    align-items: center;
    /* Gradient Background */
    background: linear-gradient(to right, #0073aa, #dc3232); /* Blue to Red gradient */
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1em;
    font-weight: 600;
    transition: background 0.3s ease; /* Transition for hover */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    border: none; /* Remove default button border if used on a button element */
    /* Ensure text is visible over gradient */
    position: relative;
    overflow: hidden; /* Hide overflow for gradient */
}

/* Hover effect - slightly change gradient or add overlay */
.ppp-print-button:hover,
.ppp-print-button:focus {
    background: linear-gradient(to right, #005177, #c42626); /* Darker gradient on hover/focus */
    color: #fff; /* Keep text white */
    text-decoration: none; /* Ensure no underline on hover */
    outline: none; /* Remove default outline */
}

.ppp-print-icon {
    display: inline-block;
    width: 1em; /* Icon size */
    height: 1em; /* Icon size */
    margin-right: 8px; /* Space between icon and text */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm1-9H4v4h16V3z"/></svg>'); /* Simple print icon SVG */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
}

/* --- Print Specific Styles --- */
@media print {

    /* --- Page Margins --- */
    @page {
        margin-top: 20mm; /* Add margin to the top of each page */
        margin-bottom: 20mm; /* Add margin to the bottom of each page */
        margin-left: 15mm; /* Keep left margin */
        margin-right: 15mm; /* Keep right margin */
    }


    /* Hide the print button and other non-essential elements */
    .ppp-print-button-container,
    .ppp-print-button,
    nav, /* Hide navigation */
    aside, /* Hide sidebars */
    footer, /* Hide footer */
    header, /* Hide header */
    form, /* Hide forms */
    .comments-area, /* Hide comments */
    .entry-meta, /* Hide post meta */
    .sharedaddy, /* Hide sharing buttons */
    .jetpack-sharing-buttons, /* Hide Jetpack sharing */
    .wp-block-social-links, /* Hide Gutenberg social links */
    .heateor_sss_sharing_container, /* Hide Heateor social sharing */
    .simplesocialbuttons, /* Hide Simple Social Buttons */
    .easy-social-share-buttons, /* Hide Easy Social Share Buttons */
    .mashsb-container, /* Hide MashShare social sharing */
    .essb_links_list, /* Hide Easy Social Share Buttons specific list */
    #wpadminbar, /* Hide admin bar */
    .elementor-location-header, /* Hide Elementor header */
    .elementor-location-footer, /* Hide Elementor footer */
    .site-header, /* Common theme header class */
    .site-footer, /* Common theme footer class */
    .sidebar /* Common theme sidebar class */
     {
        display: none !important;
    }

    /* Adjust content margins/padding for print */
    body {
        margin: 0; /* Reset body margin as @page handles page margins */
        padding: 0; /* Reset body padding */
        width: 100%;
        font-family: serif; /* Use a readable serif font for print */
        color: #000; /* Ensure black text */
        background: none; /* Remove background colors */
    }

    .ppp-printable-wrapper {
        /* Use padding here for internal spacing within the content area */
        /* Page margins are handled by @page rule */
        margin: 0; /* Remove margin from wrapper as @page handles page margins */
        padding: 10mm 0; /* Add internal padding top/bottom, keep left/right 0 as @page handles those */
        box-shadow: none; /* Remove shadows */
        border: 1px solid #0073aa; /* Border color set to blue */
        background-color: #fff; /* Ensure white background for content */
    }

    /* Style for the logo */
    .ppp-print-logo-container {
        text-align: center;
        margin-bottom: 20mm; /* Space after logo */
    }

    .ppp-print-logo {
        max-width: 300px; /* Increased size further */
        height: auto;
    }

    /* Style for the feature image */
    .ppp-print-feature-image-container {
        text-align: center;
        margin: 15mm 0; /* Space around feature image */
    }

    .ppp-print-feature-image {
        max-width: 100%;
        height: auto;
        display: block; /* Ensure it takes its own line */
        margin: 0 auto; /* Center the image */
    }


    .ppp-printable-content {
        margin: 0 10mm; /* Add left/right margin to content within the wrapper */
        padding: 0; /* Remove padding from content div itself */
        line-height: 1.6; /* Improve readability */
        font-size: 1em; /* Ensure base font size */
        background: none; /* Ensure no background image */
        /* Ensure content is readable over the background */
        position: relative; /* Needed for z-index */
        z-index: 1; /* Ensure content is above the background image */
    }

    /* Ensure text and other elements within content are above the background image */
    .ppp-printable-content > * {
        position: relative;
        z-index: 2;
    }

    /* Make bold content blue */
    .ppp-printable-content strong,
    .ppp-printable-content b {
        font-weight: bold; /* Ensure bold text is clearly bold */
        color: #0073aa; /* WordPress blue */
    }


    /* Improve content typography */
    .ppp-printable-content h1,
    .ppp-printable-content h2,
    .ppp-printable-content h3,
    .ppp-printable-content h4,
    .ppp-printable-content h5,
    .ppp-printable-content h6 {
        margin-top: 1.5em;
        margin-bottom: 0.5em;
        line-height: 1.2;
        color: #333; /* Slightly darker headings */
    }

    .ppp-printable-content p {
        margin-bottom: 1em;
    }


    .ppp-printable-content ul,
    .ppp-printable-content ol {
        margin-bottom: 1em;
        padding-left: 25px; /* Increase padding for list markers */
    }

    .ppp-printable-content li {
        margin-bottom: 0.6em; /* Increase space between list items */
    }

    /* Add subtle styling to blockquotes */
    .ppp-printable-content blockquote {
        margin: 1em 20px;
        padding: 10px 20px;
        border-left: 4px solid #ccc;
        font-style: italic;
        background-color: #f9f9f9;
    }


    /* Ensure images scale correctly within content */
    .ppp-printable-content img {
        max-width: 100% !important;
        height: auto !important;
        display: block; /* Ensure images are block elements */
        margin: 1em auto; /* Add some space around images */
        border: 1px solid #eee; /* Subtle border for images */
        padding: 3px;
    }

    /* Ensure tables are readable */
    .ppp-printable-content table {
        width: 100% !important;
        border-collapse: collapse;
        margin-bottom: 1em;
    }
    .ppp-printable-content th,
    .ppp-printable-content td {
        border: 1px solid #ddd;
        padding: 8px;
        text-align: left; /* Align table text left */
    }
    .ppp-printable-content th {
        background-color: #f2f2f2; /* Light background for headers */
        font-weight: bold;
    }


    /* Break long words if necessary */
    p, li, td {
        word-break: break-word;
        hyphens: auto; /* Enable hyphenation */
    }

    /* Prevent page breaks inside elements where possible */
    h1, h2, h3, h4, h5, h6, figure, table, pre, blockquote {
        page-break-inside: avoid;
    }

    /* Force page breaks after headings */
    /* h1, h2 { page-break-after: always; } */


    /* Style for the article footer link */
    .ppp-article-footer {
        margin-top: 15mm; /* Space after content */
        border-top: 1px solid #eee;
        padding-top: 10mm;
        font-size: 0.9em;
        text-align: center;
        color: #555;
    }

    .ppp-article-footer p {
        margin: 5px 0;
        padding: 0;
    }

    .ppp-article-footer a {
        color: #0073aa; /* WordPress blue */
        text-decoration: underline;
        font-weight: bold; /* Make link bold */
        font-size: 1.1em; /* Make link slightly larger */
    }

    /* Ensure links are visible and don't break across pages awkwardly */
    a {
        word-wrap: break-word;
    }
}

/* --- Basic Responsive Adjustments (for button) --- */
@media (max-width: 768px) {
    .ppp-print-button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
    .ppp-print-icon {
        margin-right: 5px;
    }
}
