/**
 * Print stylesheet — global, loaded with media="print" so it never costs
 * a paint on screen. Two jobs:
 *
 *   1. Strip the chrome readers don't want on paper (header, footer,
 *      floating CTAs, share bar, related posts, author bio, TOCs, etc.).
 *   2. Optimize the recipe card for printing: force black-on-white,
 *      avoid splitting ingredient rows / steps across pages, allow a
 *      natural break between ingredients and directions.
 *
 * Recipe-specific rules are unscoped because the recipe card may live
 * on any variant — print is print regardless of variant body class.
 */

/* --------------------------------------------------------------
   Global chrome / floating UI — hide on paper
   -------------------------------------------------------------- */

.site-header,
.site-footer,
.cb-share-bar,
.cb-floating-cta,
.cb-back-to-top,
.cb-reading-progress,
.post-toc-mobile,
.cb-pillar-sidebar,
.post-toc-inline,
.post-toc,
.post-related,
.post-author-bio,
.post-footer-cta {
    display: none !important;
}

/* --------------------------------------------------------------
   Page-wide reset for ink + paper
   -------------------------------------------------------------- */

@page {
    margin: 0.6in;
}

html,
body {
    background: #fff !important;
    color: #000 !important;
}

/* Drop heavy shadows globally — they print as ugly gray smudges. */
* {
    box-shadow: none !important;
    text-shadow: none !important;
}

a {
    color: #000 !important;
    text-decoration: underline;
}

img {
    max-width: 100% !important;
    page-break-inside: avoid;
}

/* --------------------------------------------------------------
   Recipe card optimizations
   -------------------------------------------------------------- */

.block-recipe-card {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000;
    padding: 0.25in;
    margin: 0 !important;
}

.block-recipe-card *,
.block-recipe-card *::before,
.block-recipe-card *::after {
    background: transparent !important;
    color: #000 !important;
    border-color: #000 !important;
}

/* Hero image is decorative on paper; let it size naturally but never
   force a break around it. */
.block-recipe-card__hero,
.block-recipe-card__hero-img {
    page-break-inside: avoid;
}

/* Keep each ingredient on a single page. */
.block-recipe-card__ingredient-row {
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Keep each step on a single page. */
.block-recipe-card__step {
    page-break-inside: avoid;
    break-inside: avoid;
}

/* Allow a natural page break between ingredients and directions —
   long recipes look better with directions starting on a fresh page
   than with a few ingredients orphaned at the top of page 2. */
.block-recipe-card__directions {
    page-break-before: auto;
    break-before: auto;
}

/* Section headings should stay with at least one line of their list. */
.block-recipe-card__ingredients h2,
.block-recipe-card__ingredients h3,
.block-recipe-card__directions h2,
.block-recipe-card__directions h3 {
    page-break-after: avoid;
    break-after: avoid;
}
