/* Print / Save as PDF (js/ui/print.js). Mirrors Printing.swift: the page on white with the Greenhand header,
   no navigation or buttons, and the contact footer. Everything else stays as on screen, so the yard filters carry over. */
.print-head, .print-foot, .print-only { display: none; }
.print-btn svg { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media print {
  @page { size: letter; margin: 14mm 14mm 16mm; }
  /* Chrome and Edge put these in the page margins; other browsers show the footer once, at the end. */
  @page {
    @bottom-left { content: "Greenhand Gardens · (704) 491-5259 · sales@greenhandgardens.com · greenhandgardens.com"; font: 8pt -apple-system, "Segoe UI", system-ui, sans-serif; color: #5A5A4E; }
    @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 8pt -apple-system, "Segoe UI", system-ui, sans-serif; color: #5A5A4E; }
  }

  /* Always the light palette on paper, even when the device is in dark mode. */
  :root {
    color-scheme: light;
    --forest: #1F3D2E; --forest-light: #3F6A4E; --forest-fill: #1F3D2E;
    --cream: #FFFFFF; --card: #FFFDF7; --gold: #C0983D; --gold-deep: #9C7623; --rust: #8B4A2E;
    --sage: #5C7A5E; --sage-fill: #DCE5DC; --ink: #2B2B24; --ink-soft: #5A5A4E; --line: #E4DCC6; --water: #2F6F9F;
    --lawn: #3E8E2F; --landscape: #9C4A8F; --irrigation: #2C78C0; --trouble: #D2602A; --pests: #C23B32; --health: #6B52B5; --aftercare: #B8841C; --home: #56687A; --pool: #0B8A94;
    --spring: #C95A8C; --summer: #D7961A; --fall: #C3602A; --winter: #3F78B0;
  }
  html, body { background: #fff; }
  body { padding: 0; font-size: 11pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .page { max-width: none; padding: 0; gap: 14px; }

  /* Header: logo, page title and date. */
  .print-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 8px; margin-bottom: 14px; border-bottom: 1.5px solid #C0983D; }
  .print-head img { height: 48px; width: auto; }
  .print-head-text { text-align: right; }
  .print-title { font: 600 13pt var(--serif); color: #1F3D2E; }
  .print-sub { font-size: 8pt; color: #5A5A4E; }
  .print-foot { display: block; margin-top: 18px; padding-top: 6px; border-top: 1px solid #E4DCC6; font-size: 8pt; color: #5A5A4E; }
  .print-only { display: revert; }

  /* Navigation, buttons and anything that only works by tapping. */
  .topbar, .tabbar, .toast, .modal, .btn, .btn-row, .link-btn, button, .grass-toggle, .track-card, .month-chips, .month-select,
  .grass-change, .chev, .cal-guide, .no-print, .feature-tile, .pool-choice:not(.on), .pool-radio, .progress, .check-progress { display: none !important; }
  /* Yard-setup bars keep "Your grass: Bermuda" so the reader knows what the page is filtered to. */
  button.grass-bar { display: flex !important; border: 0; padding: 0; background: none; box-shadow: none; }
  button.grass-bar .icon-badge { display: none; }
  .setup-prompt { display: none !important; }
  .pool-choice.on { display: flex !important; background: none !important; color: var(--ink) !important; border: 0; padding: 0; }
  .pool-choice.on .card-title { color: var(--ink) !important; }
  .pool-choice.on .card-title::before { content: "Your plan: "; font-weight: 400; color: var(--ink-soft); }
  .pool-choice.on .caption { color: var(--ink-soft) !important; }

  /* Banners print as a plain title (no artwork to use up ink). */
  .banner { min-height: 0 !important; color: var(--ink); border-radius: 0; display: block; }
  .banner > :not(.banner-text) { display: none; }
  .banner-text { padding: 0; text-shadow: none; max-width: none; }
  .banner-text h1, .banner-text h2 { color: var(--forest); font-size: 1.6rem; }
  .banner-text .eyebrow { color: var(--ink-soft); }
  .banner-text p { color: var(--ink-soft); }

  /* Cards lose their shadows; links read as plain text, except sources, which show their address. */
  .card, .row, .accent-card { box-shadow: none !important; }
  a { color: inherit; text-decoration: none; }
  .sources a::after { content: " " attr(href); color: var(--ink-soft); font-size: .8em; word-break: break-all; }
  details.card > summary::after, details.card[open] > summary::after { content: none; }

  /* Pool checklist: empty boxes to tick by hand. */
  .check { cursor: default; }
  .check input { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border: 1.5px solid var(--ink); border-radius: 3px; background: #fff; }
  .check.done .check-title { text-decoration: none; color: var(--ink); }

  /* Page breaks between cards and sections, not through them, and never right after a heading. */
  .card, .callout, .accent-card, .cal-task, .row, .check, .source, li { break-inside: avoid; }
  h1, h2, h3, .section-header, .heading { break-after: avoid; }
  p { orphans: 3; widows: 3; }
}
