/* The print layout (Print → Save as PDF), one recipe per page on Letter
   paper. print.js draws it into #print-root; on screen it stays hidden.
   Ink-friendly: white paper, thin terracotta and olive lines, no fills.
   Colors are written out here, not taken from the app's theme, so a phone
   in Lamplight still prints on white. */

/* Letter, 11in tall. Top + bottom margins leave 9.6in (921.6px) of content;
   print.js relies on that number to keep each recipe on its own page. */
@page {
  size: letter;
  margin: 0.6in 0.7in 0.8in;
  @bottom-left {
    content: "Mullis Family Cookbook";
    font-family: 'Rye', Georgia, serif;
    font-size: 11pt;
    color: #5C4837;
    vertical-align: top;
    padding-top: 0.16in;
  }
  @bottom-right {
    content: counter(page);
    font-family: 'Cinzel', Georgia, serif;
    font-weight: 700;
    font-size: 10pt;
    color: #5C4837;
    vertical-align: top;
    padding-top: 0.17in;
  }
}
@page cover {
  @bottom-left { content: none; }
  @bottom-right { content: none; }
}

.print-root { display: none; }
/* While print.js measures, the layout sits off screen at print width. */
@media screen {
  .print-root.measuring { display: block; position: absolute; top: 0; left: -10000px; width: 7.1in; visibility: hidden; }
}

@media print {
  :root { color-scheme: light !important; }
  html, body { background: #fff !important; color: #2B2118 !important; }
  /* With a print layout ready, print only that. */
  body.print-ready > :not(.print-root) { display: none !important; }
  body.print-ready .print-root { display: block; }
  body.print-ready { display: block; min-height: 0; }
  /* Without one (any screen but a recipe), print the screen itself, minus buttons. */
  body:not(.print-ready) .masthead, body:not(.print-ready) .toolbar, body:not(.print-ready) .bar,
  body:not(.print-ready) .toast-wrap, body:not(.print-ready) .offline-note, body:not(.print-ready) .home-foot { display: none !important; }
}

.print-root {
  color: #2B2118;
  font-family: 'Lora', Georgia, serif;
  font-size: 12pt;
  line-height: 1.5;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.print-root ul, .print-root ol { list-style: none; margin: 0; padding: 0; }
.print-root h1, .print-root h2, .print-root h3, .print-root p, .print-root dl, .print-root dd { margin: 0; font-weight: 400; }
.print-root .tone-olive { color: #4B5E28; }
.print-root .tone-terra { color: #A0462A; }
.print-root .tone-ochre { color: #8A5A0B; }
.print-root .tone-grape { color: #5B3A5E; }
.print-root .garland .stem { stroke: #6E7F3A; }
.print-root .garland .lf { fill: #6E7F3A; }
.print-root .garland .fr { fill: #2E3516; }

/* ---------- Cover ---------- */
.p-cover {
  page: cover;
  height: 9.5in;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18in;
  text-align: center;
  break-after: page;
}
.p-door { width: 1.5in; height: 1.75in; margin-bottom: 0.08in; }
.p-olive { fill: #556B2F; }
.p-olive .ln { fill: none; stroke: #3F4A1E; stroke-width: 1.4; stroke-linecap: round; }
.p-cover h1 { display: flex; flex-direction: column; align-items: center; gap: 0.06in; }
.p-cover-1 { font-family: 'Rye', Georgia, serif; font-size: 50pt; line-height: 1.05; }
.p-cover-2 { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 20pt; letter-spacing: .4em; margin-right: -.4em; text-transform: uppercase; color: #A0462A; }
.p-cover .garland { width: 2.2in; height: 0.55in; }
.p-cover p { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 12pt; letter-spacing: .14em; text-transform: uppercase; color: #5C4837; }

/* ---------- Contents ---------- */
.p-toc { break-after: page; }
.p-toc h1 { margin-bottom: 0.08in; padding-bottom: 0.06in; border-bottom: 2.5pt double #B4532F; font-family: 'Rye', Georgia, serif; font-size: 34pt; line-height: 1.1; }
.p-toc h2 { display: flex; align-items: center; gap: 0.08in; margin: 0.22in 0 0.04in; font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 12.5pt; letter-spacing: .12em; text-transform: uppercase; break-after: avoid; }
.p-toc li { display: flex; align-items: baseline; gap: 0.1in; padding: 0.03in 0; break-inside: avoid; }
.p-dots { flex: 1; border-bottom: 1.2pt dotted #A99A7E; transform: translateY(-3pt); }
.p-pg { min-width: 0.25in; font-weight: 700; text-align: right; }

/* ---------- One recipe (sizes in em so print.js can shrink a recipe to fit) ---------- */
.p-recipe { font-size: 12pt; break-after: page; }
.p-recipe:last-child { break-after: auto; }
.p-recipe > header { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5em; margin-bottom: 1.1em; padding-top: 0.6em; }
.p-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.1em 0.7em;
  border: 1.5pt solid currentColor;
  border-radius: 2pt;
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  font-size: 0.85em;
  letter-spacing: .14em;
  text-transform: uppercase;
  rotate: -1.5deg;
}
.p-stamp .fi { width: 1.4em; height: 1.4em; }
.p-recipe h1 { align-self: stretch; padding-bottom: 0.25em; border-bottom: 2.5pt double #B4532F; font-family: 'Rye', Georgia, serif; font-size: 2.9em; line-height: 1.08; text-wrap: balance; }
.p-tags { display: flex; flex-wrap: wrap; gap: 0.5em; }
.p-tags div { display: flex; align-items: baseline; gap: 0.45em; padding: 0.15em 0.8em; border: 1pt solid #6E7F3A; border-radius: 2pt; }
.p-tags dt { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 0.78em; letter-spacing: .12em; text-transform: uppercase; color: #4B5E28; }
.p-tags dd { font-weight: 700; }
.p-from { font-size: 0.9em; color: #5C4837; }
.p-from span { font-family: 'Caveat', cursive; font-weight: 600; font-size: 1.5em; color: #4B5E28; }

.p-cols { display: flex; align-items: flex-start; gap: 2.2em; }
.p-ings { flex: 0 0 34%; min-width: 0; }
.p-method { flex: 1; min-width: 0; }
.p-cols.solo .p-ings, .p-cols.solo .p-method { flex: 1; }
.p-cols.solo .p-ings .p-list { columns: 2; column-gap: 2.2em; }
.p-recipe h2 { display: flex; align-items: center; gap: 0.4em; margin: 0 0 0.3em; font-family: 'Rye', Georgia, serif; font-size: 1.55em; line-height: 1.2; break-after: avoid; }
.p-recipe h2 .garland { width: 2.6em; height: 0.65em; }
.p-recipe h3 { margin: 0.8em 0 0.2em; font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 0.85em; letter-spacing: .1em; text-transform: uppercase; color: #4B5E28; break-after: avoid; break-inside: avoid; }
.p-recipe h2 + h3, .p-recipe h2 + .p-list > h3:first-child { margin-top: 0.2em; }
.p-ings li { display: flex; align-items: flex-start; gap: 0.6em; padding: 0.22em 0; border-bottom: 0.6pt solid #D5DEE6; break-inside: avoid; }
.p-box { width: 0.85em; height: 0.85em; margin-top: 0.36em; border: 1.1pt solid #5C4837; border-radius: 1.5pt; flex-shrink: 0; }
.p-ings strong { font-weight: 700; }
.p-method li { display: flex; align-items: flex-start; gap: 0.7em; padding: 0.35em 0; break-inside: avoid; }
.p-num {
  width: 1.65em;
  height: 1.65em;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.2pt solid #B4532F;
  border-radius: 50%;
  color: #A0462A;
  font-family: 'Rye', Georgia, serif;
  font-size: 0.95em;
  line-height: 1;
}
.p-body { padding-top: 0.12em; min-width: 0; }
.p-time { display: block; font-size: 0.85em; font-weight: 700; color: #4B5E28; }
.p-note { width: fit-content; max-width: 82%; margin-top: 1.3em; padding: 0.5em 1.2em 0.6em; border: 1.2pt dashed #6E7F3A; border-radius: 3pt; break-inside: avoid; }
.p-note-h { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 0.8em; letter-spacing: .12em; text-transform: uppercase; color: #4B5E28; }
.p-note-t { font-family: 'Caveat', cursive; font-weight: 600; font-size: 1.55em; line-height: 1.15; white-space: pre-line; }
