/* Print stylesheets — toggled via body class */

@media print {
  body { font-family: Georgia, serif; color: #000; background: white; margin: 0; }
  .site-nav, .page-footer, .no-print, .filter-bar, .recipe-actions, .toast-container { display: none !important; }
  /* Force browsers to print background images (the hero is a div with background-image) */
  .recipe-img,
  .recipe-print-card .left,
  .recipe-print-card .left * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
}

/* === CARD LAYOUT (one A4, two max) === */
body.print-card a[href^="/"] { display: none !important; }
body.print-card .recipe-print-card {
  display: block !important;
  padding: 0;
}
body.print-card .recipe-print-card .left {
  float: right;
  width: 45mm;
  margin: 0 0 4mm 6mm;
}
body.print-card .recipe-print-card .left .recipe-img,
body.print-card .recipe-print-card .left img {
  width: 45mm !important;
  height: 34mm !important;
  aspect-ratio: auto !important;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: none !important;
  font-size: 2.4rem !important;
  background-size: cover !important;
  background-position: center !important;
}
body.print-card .recipe-print-card h1 { font-size: 22pt; margin: 0 0 2mm; line-height: 1.15; }
body.print-card .recipe-print-card .recipe-italian { font-style: italic; color: #666; margin: 0 0 3mm; font-size: 11pt; }
body.print-card .region-badge,
body.print-card .recipe-tag { font-size: 8pt; padding: 1pt 5pt; }
body.print-card .recipe-stats { gap: 8mm; margin: 3mm 0; }
body.print-card .recipe-stats .stat-label { font-size: 7.5pt; }
body.print-card .recipe-stats .stat-value { font-size: 11pt; }
body.print-card .recipe-print-card .meta { font-size: 8.5pt; color: #555; margin-bottom: 4mm; }
body.print-card .section-h { font-size: 13pt; margin: 4mm 0 2mm; }
body.print-card .recipe-print-card .ingredient-list {
  columns: 2; column-gap: 8mm;
  padding-left: 0; list-style: none;
}
body.print-card .ingredient-list li {
  padding: 1.5pt 0; font-size: 9.5pt; border: none;
  break-inside: avoid; line-height: 1.3;
}
body.print-card .ingredient-list .ing-qty { min-width: 0; }
body.print-card .step-list li {
  font-size: 10pt; padding: 2pt 0 2pt 22pt;
  border: none; line-height: 1.4; break-inside: avoid;
}
body.print-card .step-list li:before {
  width: 16pt; height: 16pt; background: #C2410C; color: white;
  font-size: 9pt; top: 2pt; line-height: 16pt;
}
body.print-card .chef-card,
body.print-card .wine-card,
body.print-card .story-card {
  font-size: 9pt; padding: 3mm; margin: 3mm 0; break-inside: avoid;
}
body.print-card #ai-sub-result { display: none !important; }
@page { size: A4; margin: 12mm; }

/* === BOOKLET LAYOUT (cover + flowing dense steps) === */
body.print-booklet .recipe-print-card {
  display: block !important;
  padding: 0;
}
body.print-booklet #ai-sub-result { display: none !important; }
body.print-booklet a[href^="/"] { display: none !important; }

/* Cover-ish header: image floats top-right, title + meta + ingredients flow */
body.print-booklet .recipe-print-card .left {
  float: right;
  width: 75mm;
  margin: 0 0 6mm 8mm;
}
body.print-booklet .recipe-print-card .left .recipe-img,
body.print-booklet .recipe-print-card .left img {
  width: 75mm !important;
  height: 56mm !important;
  aspect-ratio: auto !important;
  border: 1px solid #bbb;
  border-radius: 4px;
  box-shadow: none !important;
  font-size: 4rem !important;
  background-size: cover !important;
  background-position: center !important;
}
body.print-booklet h1 { font-size: 30pt; margin: 0 0 3mm; line-height: 1.1; }
body.print-booklet .recipe-italian { font-style: italic; color: #555; margin: 0 0 4mm; font-size: 13pt; }
body.print-booklet .region-badge,
body.print-booklet .recipe-tag { font-size: 9pt; padding: 1pt 6pt; }
body.print-booklet .recipe-stats { gap: 10mm; margin: 4mm 0; }
body.print-booklet .recipe-stats .stat-label { font-size: 8pt; }
body.print-booklet .recipe-stats .stat-value { font-size: 13pt; }
body.print-booklet .meta { font-size: 9pt; color: #555; margin-bottom: 4mm; }
body.print-booklet .section-h { font-size: 16pt; margin: 6mm 0 3mm; }

/* Ingredients: 2-column, still readable. Forces a page break before the method
   so the method section starts clean on the next page. */
body.print-booklet .ingredient-list {
  columns: 2; column-gap: 10mm;
  padding-left: 0; list-style: none;
}
body.print-booklet .ingredient-list li {
  font-size: 12pt; padding: 3pt 0; border: none;
  break-inside: avoid; line-height: 1.35;
}
body.print-booklet .ingredient-list .ing-qty { min-width: 0; }

/* Method: start on a fresh page, flowing steps at a readable size.
   No forced break per step — only avoid splitting an individual step mid-page. */
body.print-booklet h2.section-h + ol.step-list { page-break-before: always; }
body.print-booklet .step-list {
  counter-reset: step;
  padding-left: 0;
}
body.print-booklet .step-list li {
  font-size: 14pt;
  line-height: 1.55;
  padding: 4mm 4mm 4mm 22mm;
  margin-bottom: 4mm;
  min-height: 16mm;
  border: none;
  break-inside: avoid;
  page-break-inside: avoid;
  position: relative;
}
body.print-booklet .step-list li:before {
  width: 14mm; height: 14mm;
  background: #C2410C; color: white;
  font-size: 16pt;
  line-height: 14mm;
  text-align: center;
  top: 3mm; left: 2mm;
  border-radius: 50%;
}

/* Wine / story / chef notes — keep small, after method */
body.print-booklet .chef-card,
body.print-booklet .wine-card,
body.print-booklet .story-card {
  font-size: 10pt; padding: 4mm; margin: 4mm 0; break-inside: avoid;
}
