/* print.css — print-only surface. NOT the Scheduler V2 theme: black-on-white,
   no gradients/shadows/rounded corners, ink-conservative. Loaded @media print. */

/* Futura Std (Michael's licensed copy, carried over from V1) — the menu sheet
   must match V1's typography exactly. Registered at top level so the browser can
   lazy-load it when the menu print view first renders. */
@font-face {
  font-family: 'Futura Std';
  src: url('assets/fonts/FuturaStd-Light.otf') format('opentype');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Futura Std';
  src: url('assets/fonts/FuturaStd-LightOblique.otf') format('opentype');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@media print {
  /* Real page margins on EVERY sheet so content never bleeds to the paper edge or
     into the browser's own header/footer band. The bottom margin is a touch larger
     to seat the repeating page footer. (Bug 4) */
  @page { margin: 0.5in 0.5in 0.6in 0.5in; }

  /* Hide everything that isn't the print document. */
  .topbar,
  .tabs,
  .toast-host,
  .modal-backdrop,
  .no-print,
  .btn-primary,
  .btn-secondary,
  .btn-danger,
  .btn-ghost { display: none !important; }

  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .page { max-width: none; margin: 0; padding: 0; }

  /* The print document is injected into #print-root and shown only when printing. */
  #print-root { display: block !important; }
  #app-root { display: none !important; }

  /* Page wrapper: a full-width table whose <tfoot> repeats the page footer on every
     printed page and reserves its height in the flow, so content can't run under it.
     Scoped to the wrapper's OWN cells (direct children) so the order guide's nested
     print-table keeps its own padding/borders. (Bug 4) */
  table.print-sheet { width: 100%; border-collapse: collapse; }
  table.print-sheet > tbody > tr > td,
  table.print-sheet > tfoot > tr > td { padding: 0; border: 0; }
  table.print-sheet > tfoot { display: table-footer-group; }

  /* Futura Std throughout every print sheet (V1 used it for menu, prep, and order
     guide alike), with graceful fallbacks. */
  .print-doc { font-family: 'Futura Std', 'Futura Light', 'Century Gothic', Arial, sans-serif; color: #000; }
  .print-doc h1 { font-size: 18pt; margin: 0 0 6pt; }
  .print-doc h2 { font-size: 14pt; margin: 0 0 4pt; }
  .print-doc .print-meta { font-size: 10pt; color: #000; margin-bottom: 10pt; }

  /* Page footer: lives in the .print-sheet <tfoot>, so Chromium repeats it on every
     printed page and reserves its space in the flow — each loose sheet says which
     event it belongs to, and content never overlaps it. (Bug 4) */
  .print-footer {
    font-family: 'Futura Std', 'Futura Light', 'Century Gothic', Arial, sans-serif;
    font-size: 8pt; color: #000;
    border-top: 0.5pt solid #000; padding-top: 3pt; margin-top: 10pt;
  }

  /* Order guide vendor groups flow continuously (one-vendor-per-page wastes paper).
     Vendors stay grouped + sorted; we only keep a vendor header with its first
     rows so a heading never strands at the bottom of a page. */
  .print-vendor { margin-top: 12pt; }
  .print-vendor:first-of-type { margin-top: 0; }
  .print-vendor h2 {
    border-bottom: 1.5pt solid #000;
    padding-bottom: 2pt;
    margin-bottom: 6pt;
    page-break-after: avoid;
  }

  table.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10pt;
  }
  table.print-table th,
  table.print-table td {
    text-align: left;
    padding: 3pt 5pt;
    vertical-align: top;
  }
  /* Item rows: a fine, light hairline so the per-item separators read as quiet
     row dividers and never compete with the bold black header / subtotal rules. */
  table.print-table td { border-bottom: 0.25pt solid #c8c8c8; }
  table.print-table th { border-bottom: 1pt solid #000; font-weight: 700; }
  table.print-table .num { text-align: right; font-variant-numeric: tabular-nums; }
  table.print-table tr { page-break-inside: avoid; }

  .print-subtotal td { font-weight: 700; border-top: 1pt solid #000; border-bottom: none; }
  .print-grandtotal { margin-top: 10pt; font-size: 12pt; font-weight: 700; text-align: right; }

  /* Checkbox glyph for prep lists — legibility >= 14pt. */
  .print-check {
    display: inline-block;
    width: 14pt; height: 14pt;
    border: 1pt solid #000;
    margin-right: 6pt;
    vertical-align: middle;
  }

  /* Prep list hierarchy: the dish is a bold heading; each component/sub-component
     is indented by depth (inline padding-left, set per level in prep.js) so a
     sub-component reads clearly as nested under its parent. */
  .print-prep .lvl-0 { font-weight: 700; font-size: 12pt; margin-top: 8pt; }
  /* Menu-page components line (the menu item's descriptor) under the dish name:
     subdued so it reads as context, never competing with the checkable lines. */
  .print-prep .prep-desc { font-style: italic; font-size: 9.5pt; color: #444; margin: 1pt 0 2pt; page-break-inside: avoid; }
  .print-prep .prep-line { padding: 2pt 0; page-break-inside: avoid; }
  .print-prep .prep-qty { font-variant-numeric: tabular-nums; }

  /* Menu sheet — matches V1 exactly (Menu Template SOP): Futura Std throughout,
     12pt dish title ALL CAPS, 12pt Title-Case description, 10pt allergens. */
  /* Only the Light weight (300) of Futura Std is embedded, so we render the whole
     menu at 300 and forbid synthetic bold — otherwise the heavy event name + dish
     titles get FAUX-bolded from the Light face and stop looking like Futura Std
     Light. Hierarchy comes from size + UPPERCASE + letter-spacing instead. */
  .print-menu {
    font-family: 'Futura Std', 'Futura Light', 'Century Gothic', sans-serif;
    font-weight: 300;
    color: #000;
    font-size: 12pt;
    font-synthesis: none;
    -webkit-font-synthesis: none;
  }
  .print-menu .menu-header { margin-bottom: 32pt; }
  .print-menu .menu-event-name { font-size: 22pt; font-weight: 300; letter-spacing: 2px; }
  .print-menu .menu-sub { font-size: 12pt; color: #555; margin-top: 6pt; }
  .print-menu .menu-times { font-size: 12pt; color: #555; margin-top: 2pt; }
  .print-menu .dish { page-break-inside: avoid; margin-bottom: 18pt; }
  .print-menu .dish-title { font-size: 12pt; font-weight: 300; text-transform: uppercase; letter-spacing: 1.5px; }
  .print-menu .dish-desc { font-size: 12pt; margin-top: 2pt; }
  .print-menu .allergens { font-size: 10pt; color: #555; margin-top: 2pt; }
  .print-menu .menu-footer {
    margin-top: 40pt;
    font-size: 9pt;
    color: #999;
    text-align: center;
    border-top: 1px solid #E0E0E0;
    padding-top: 12pt;
  }

  /* Full package: menu + prep + order guide in one job. Each major section starts
     on a fresh page; the menu footer is dropped between stitched sections. */
  /* Each package section is its own table row group; break before all but the first
     so menu / prep / order guide each start on a fresh page. Chromium honors breaks
     between row groups (where it ignores them on content inside a single cell). */
  .print-sheet > tbody.pkg-break-group { page-break-before: always; break-before: page; }
  .print-package .menu-footer { display: none; }
}

/* Off-screen by default; only the print stylesheet reveals it. */
#print-root { display: none; }
