/* ===================================================
   print.css — Clean recipe print layout
   TheMeasuringCup.com
   =================================================== */

@media print {
  /* ── Reset ── */
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    font-size: 13pt;
    line-height: 1.55;
    font-family: Georgia, 'Times New Roman', Times, serif;
    color: #000;
    background: #fff;
  }

  /* ── Hide everything outside the recipe article ── */
  header.top,
  .site-footer,
  .search-overlay,
  .site-search,
  .serving-scaler,
  .recipe-image,
  .cooking-mode-toggle,
  .cooking-mode-bar,
  img,
  iframe,
  nav,
  .foot-nav,
  .copyright,
  .brand,
  .brandtext,
  .brandlink img {
    display: none !important;
  }

  /* ── Show only the recipe article ── */
  body > div,
  #__next,
  main,
  .container,
  article.recipe {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
  }

  /* ── Article layout ── */
  article.recipe {
    margin: 0 auto !important;
    padding: 0.75in 0 !important;
    max-width: 6.5in !important;
  }

  /* ── Title ── */
  h1 {
    font-size: 26pt;
    line-height: 1.15;
    margin: 0 0 4pt;
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-weight: 700;
    page-break-after: avoid;
  }

  /* ── Snippet / meta ── */
  p.muted {
    font-size: 11pt;
    color: #444 !important;
    margin: 0 0 12pt;
  }

  /* ── Section headings ── */
  h2 {
    font-size: 16pt;
    font-weight: 700;
    margin: 18pt 0 8pt;
    font-family: Georgia, 'Times New Roman', Times, serif;
    page-break-after: avoid;
  }

  /* ── Ingredients ── */
  ul {
    margin: 0 0 12pt;
    padding-left: 1.4em;
    list-style: disc;
  }
  ul li {
    font-size: 12.5pt;
    line-height: 1.6;
    margin-bottom: 2pt;
    page-break-inside: avoid;
  }

  /* ── Steps ── */
  ol {
    margin: 0 0 12pt;
    padding-left: 1.6em;
    counter-reset: step-counter;
  }
  ol li {
    font-size: 12.5pt;
    line-height: 1.65;
    margin-bottom: 8pt;
    padding-left: 4pt;
    page-break-inside: avoid;
    orphans: 3;
    widows: 3;
  }
  ol li::marker {
    font-weight: 700;
    font-size: 0.95em;
  }

  /* ── No page breaks near headings ── */
  h1, h2, h3, h4 {
    page-break-after: avoid;
  }

  /* ── Links: show the URL after the text ── */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555 !important;
    font-weight: normal;
  }
  a[href^="/"]::after {
    content: " (https://themeasuringcup.com" attr(href) ")";
    font-size: 9pt;
    color: #555 !important;
    font-weight: normal;
  }
  a[href^="#"]::after {
    content: none;
  }

  /* ── Force page breaks between sections if content overflows ── */
  section {
    page-break-inside: avoid;
  }
}
