@media (max-width: 781px) {

    .flavor-fixer-header {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 12px !important;
        padding: 12px 14px !important;
    }

    body.page-template-page-no-header-image
    .wp-site-blocks > .wp-block-group.has-background {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

}


@media (max-width: 480px) {

    #ff-recipe-master .ff-inspiration-title,
    #ff-recipe-master .ff-fix-title {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 10px !important;
    }

    #ff-recipe-master .ff-inspiration-icon,
    #ff-recipe-master .ff-fix-icon {
        display: inline-block !important;
        flex: 0 0 auto !important;
        margin: 0 !important;
    }

}


@media print {

    @page {
        margin: 0.35in;
    }

    /* Hide website chrome */
    body.page-template-page-no-header-image header,
    body.page-template-page-no-header-image .flavor-fixer-header,
    body.page-template-page-no-header-image .wp-block-template-part {
        display: none !important;
    }

    /* Clean print background */
    #ff-recipe-master,
    #ff-recipe-master .ff-paper,
    #ff-recipe-master .ff-side,
    #ff-recipe-master .ff-dark-card {
        background: #fff !important;
        color: #000 !important;
    }

    #ff-recipe-master .ff-wrap {
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* PRINT HERO:
       more room for title, smaller natural photo */
    #ff-recipe-master .ff-hero {
        display: grid !important;
        grid-template-columns: 64% 36% !important;
        gap: 12px !important;
        align-items: start !important;
        padding: 0 0 8px !important;
    }

    #ff-recipe-master .ff-hero-copy {
        min-width: 0 !important;
    }

    #ff-recipe-master .ff-hero h1 {
        color: #000 !important;
        font-size: 17pt !important;
        line-height: 1.05 !important;
        margin: 0 0 5px !important;
    }

    #ff-recipe-master .ff-hero-copy > p {
        color: #000 !important;
        font-size: 8.5pt !important;
        line-height: 1.2 !important;
        margin: 0 !important;
    }

    /* Hero photo - natural proportions, no forced crop */
    #ff-recipe-master .ff-hero-photo {
        display: block !important;
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        margin: 0 !important;
    }

    #ff-recipe-master .ff-hero-photo > img:first-child {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
    }

    /* Remove webpage-only hero pieces */
    #ff-recipe-master .ff-hero-photo::before,
    #ff-recipe-master .ff-video-link,
    #ff-recipe-master .ff-buttons,
    #ff-recipe-master .ff-footer {
        display: none !important;
    }

    /* QUICK FACTS */
    #ff-recipe-master .ff-facts {
        background: #fff !important;
        border-top: 1px solid #777 !important;
        border-bottom: 1px solid #777 !important;
    }

    #ff-recipe-master .ff-facts-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
    }

    #ff-recipe-master .ff-fact {
        color: #000 !important;
        padding: 4px !important;
    }

    #ff-recipe-master .ff-fact-icon {
        width: 18px !important;
        height: 18px !important;
        flex-basis: 18px !important;
        margin-right: 5px !important;
    }

    #ff-recipe-master .ff-fact-text strong,
    #ff-recipe-master .ff-fact-text span {
        color: #000 !important;
        font-size: 7.5pt !important;
        line-height: 1.05 !important;
    }

    /* RECIPE BODY */
    #ff-recipe-master .ff-paper {
        padding: 8px 0 0 !important;
    }

    #ff-recipe-master .ff-recipe-grid {
        display: block !important;
    }

    /* Remove A Little About This Recipe */
    #ff-recipe-master .ff-main > h2:first-of-type,
    #ff-recipe-master .ff-main > h2:first-of-type + p,
    #ff-recipe-master .ff-main > h2:first-of-type + p + p,
    #ff-recipe-master .ff-main > h2:first-of-type + p + p + p,
    #ff-recipe-master .ff-main > h2:first-of-type + p + p + p + hr {
        display: none !important;
    }

    /* Compact print typography */
    #ff-recipe-master .ff-main h2 {
        font-size: 13pt !important;
        line-height: 1.05 !important;
        margin: 6px 0 4px !important;
    }

    #ff-recipe-master .ff-main h3 {
        font-size: 11pt !important;
        line-height: 1.05 !important;
        margin: 4px 0 3px !important;
    }

    #ff-recipe-master .ff-main p,
    #ff-recipe-master .ff-main li,
    #ff-recipe-master .ff-step,
    #ff-recipe-master .ff-side p,
    #ff-recipe-master .ff-side li {
        color: #000 !important;
        font-size: 8.5pt !important;
        line-height: 1.17 !important;
    }

    #ff-recipe-master .ff-main ul {
        margin-top: 3px !important;
        margin-bottom: 5px !important;
        padding-left: 18px !important;
    }

    #ff-recipe-master .ff-rule {
        margin: 6px 0 !important;
    }

    #ff-recipe-master .ff-step {
        margin-bottom: 4px !important;
    }

    /* SIDEBAR:
       print Chef's Notes only */
    #ff-recipe-master .ff-side > .ff-dark-card:nth-child(1),
    #ff-recipe-master .ff-side > .ff-dark-card:nth-child(3),
    #ff-recipe-master .ff-side > .ff-dark-card:nth-child(4) {
        display: none !important;
    }

    #ff-recipe-master .ff-side > .ff-dark-card:nth-child(2) {
        display: block !important;
        background: #fff !important;
        border: 0 !important;
        padding: 6px 0 0 !important;
    }

    #ff-recipe-master .ff-side > .ff-dark-card:nth-child(2) h2 {
        color: #000 !important;
        font-size: 11pt !important;
        line-height: 1.05 !important;
        margin: 0 0 3px !important;
    }

    #ff-recipe-master .ff-side > .ff-dark-card:nth-child(2) img {
        width: 18px !important;
        height: 18px !important;
    }

    #ff-recipe-master .ff-side > .ff-dark-card:nth-child(2) ul {
        margin-top: 2px !important;
        margin-bottom: 0 !important;
        padding-left: 18px !important;
    }

    /* Prevent awkward breaks */
    #ff-recipe-master h2,
    #ff-recipe-master h3 {
        break-after: avoid !important;
        page-break-after: avoid !important;
    }

    #ff-recipe-master .ff-step,
    #ff-recipe-master li {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }
}