/* ============================================================
   ARMORY ALMANAC — the area report (packet C1).

   The report body is the composer's third surface (after the ladder page and
   the post). It CONSUMES the sealed tokens + almanac.css + site.css and adds
   only the report layout and the print rules. Every colour / type / spacing
   value comes from the sealed files via var(); this file declares none.

   Readability first (C1 item 2): IBM Plex, the light register, no walls of
   italics, a minimum 11 pt body in print. The PDF is the deliverable, so the
   print block is the important half: US Letter, generous margins, a page break
   between sections, the mark repeated in the header and the folio in the footer,
   no navigation.
   ============================================================ */

/* ---- screen layout ---- */
main.report{max-width:820px;}
.report .report-lede{font-size:var(--fs-h3);color:var(--text-muted);
  margin:0 0 var(--s-4);max-width:64ch;line-height:1.4;}
.report .legalform{font-family:var(--font-mono);font-size:var(--fs-label);
  text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);}

.report section.rsec{margin-top:var(--s-8);}
.report section.rsec > h2{font:var(--fs-h2)/1.2 var(--font-sans);font-weight:600;
  margin:0 0 var(--s-2);padding-bottom:var(--s-2);
  border-bottom:2px solid var(--chrome-rule-color,var(--hairline));}
.report section.rsec > .rsec-note{font-size:var(--fs-sm);color:var(--text-muted);
  margin:0 0 var(--s-4);max-width:70ch;line-height:1.5;}

/* a labelled fact with its own source line under it */
.report .rfact{padding:var(--s-3) 0;border-bottom:1px solid var(--border);}
.report .rfact:last-child{border-bottom:0;}
.report .rfact .rf-head{display:flex;justify-content:space-between;gap:var(--s-4);
  align-items:baseline;}
.report .rfact .rf-k{color:var(--text-muted);}
.report .rfact .rf-v{color:var(--text);text-align:right;font-family:var(--font-mono);
  font-feature-settings:"tnum" 1;}
.report .rfact .rf-src{font-size:var(--fs-micro);color:var(--text-dim);
  font-family:var(--font-mono);margin-top:3px;line-height:1.5;}
.report .rfact .rf-src a{color:var(--accent);}

/* the at-a-glance stat strip reuses site.css .covgrid/.stat */
.report .ataglance{margin-top:var(--s-4);}

/* the ten-newest-events list, compact */
.report .revents{list-style:none;margin:var(--s-4) 0 0;padding:0;}
.report .revent{padding:var(--s-3) 0;border-bottom:1px solid var(--border);}
.report .revent:last-child{border-bottom:0;}
.report .revent .re-date{font-family:var(--font-mono);font-size:var(--fs-micro);
  color:var(--text-muted);margin-right:var(--s-2);}
.report .revent .re-title{color:var(--text);}
.report .revent .re-src{display:block;font-size:var(--fs-micro);color:var(--text-dim);
  font-family:var(--font-mono);margin-top:2px;}

/* zoning district chips — a citation + link, never a rule value */
.report .districts{display:flex;flex-wrap:wrap;gap:var(--s-2);margin-top:var(--s-3);}
.report .districts .dchip{font-family:var(--font-mono);font-size:var(--fs-micro);
  border:1px solid var(--border);border-radius:4px;padding:2px 8px;color:var(--text-muted);}

.report .fixed-note{margin-top:var(--s-6);padding:var(--s-4);
  border:1px solid var(--border);background:var(--surface-panel);
  font-size:var(--fs-sm);color:var(--text-muted);line-height:1.5;}

/* ---- listing appointment pack (packet D3) --------------------------------- */
/* the 'Prepared by' header (from the agent profile) — also styled here so the
   standalone pack page is self-contained without desk.css. */
.report .prepared-by{display:flex;align-items:center;gap:var(--s-4);
  margin:0 0 var(--s-4);padding-bottom:var(--s-3);border-bottom:1px solid var(--border);}
.report .prepared-by img{max-height:56px;max-width:180px;}
.report .prepared-by .pb-k{font-family:var(--font-mono);font-size:var(--fs-label);
  text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);display:block;}
.report .prepared-by .pb-name{font-weight:600;font-size:var(--fs-h3);}
.report .prepared-by .pb-line{font-size:var(--fs-sm);color:var(--text-muted);}
/* a section's fixed / NJDEP line — never drops away from its section */
.report .pack-fixed{margin-top:var(--s-3);padding:var(--s-2) var(--s-3);
  border-left:3px solid var(--accent);background:var(--surface-panel);
  font-size:var(--fs-sm);color:var(--text-muted);line-height:1.5;}
.report .pack-gap{margin-top:var(--s-2);font-size:var(--fs-sm);
  color:var(--text-muted);font-style:italic;}

/* the running print header / footer — hidden on screen, shown on every printed
   page (Chromium repeats position:fixed blocks across printed pages). */
.print-head,.print-foot{display:none;}

/* ============================================================
   PRINT — the deliverable. US Letter, margins, page breaks, mark + folio.
   ============================================================ */
@page{size:letter;margin:18mm 16mm 16mm;}

@media print{
  html,body{background:#fff;}
  /* readability floor: 11 pt body in print, but a tight vertical rhythm so the
     report lands in 2–4 pages (done_when item 1). */
  main.report{max-width:none;padding:0;font-size:11pt;line-height:1.35;}
  .report .rfact .rf-v,.report .revent .re-date{font-size:10.5pt;}
  .report .rfact .rf-src,.report .revent .re-src{font-size:8.5pt;line-height:1.3;}
  .report .hero{padding:0 0 4mm !important;}
  .report .report-lede{font-size:11pt;margin-bottom:3mm;}
  .report .fixed-note{margin-top:3mm;padding:2.5mm 3mm;}
  .report section.rsec{margin-top:4mm !important;}
  .report section.rsec > h2{font-size:12.5pt;margin-bottom:1mm;padding-bottom:1mm;}
  .report section.rsec > .rsec-note{margin-bottom:1.5mm;font-size:8.5pt;line-height:1.25;}
  .report .rfact{padding:1.8mm 0;}
  .report .rfact .rf-src{margin-top:1pt;}
  .report .revent{padding:1.8mm 0;}
  /* the stat strip is a screen affordance; in print the sourced fact rows below
     it carry the same numbers WITH their source line, so the decorative tiles are
     dropped to save a block of the first page. */
  .report .ataglance{display:none !important;}
  .report .report-tools{display:none !important;}
  /* the ten newest records pack into two columns in print */
  .report .revents{column-count:2;column-gap:8mm;}

  /* no navigation in the printed report */
  header.mast .tabs,header.mast .crumbs,.report-tools{display:none !important;}
  header.mast{position:static;border:0;}
  header.mast .mastbar{padding-top:0;}

  /* Let the report flow to 2–4 pages: sections pack onto the page, but a section
     is not split awkwardly across a page boundary when it is small enough to fit,
     a heading is never orphaned from its body, and a single fact/event row never
     straddles a page. (Forcing a page break before every section blew the report
     up to ~10 pages — the done_when is 2–4.) */
  .report section.rsec{break-inside:auto;margin-top:var(--s-6);}
  .report section.rsec > h2{break-after:avoid;}
  .report .rfact,.report .revent,.report .districts{break-inside:avoid;}
  footer.attr{break-inside:avoid;}

  /* the mark repeated in the header and the folio in the footer */
  .print-head{display:block;position:fixed;top:-14mm;left:0;right:0;
    font-family:var(--font-mono);font-size:8pt;letter-spacing:.04em;
    color:#555;display:flex;justify-content:space-between;}
  .print-head .ph-mark{font-weight:600;color:#000;}
  .print-foot{display:block;position:fixed;bottom:-12mm;left:0;right:0;
    font-family:var(--font-mono);font-size:8pt;color:#555;
    display:flex;justify-content:space-between;}
  /* packet D3: the Fair Housing line rides the print footer so it lands on
     EVERY printed page; keep each section heading + its note + first rows
     together, and never orphan a fixed line from its section. */
  .print-foot .pf-fh{max-width:62%;text-align:left;color:#333;white-space:normal;}
  .report section.rsec > .rsec-note,.report .pack-fixed{break-after:avoid;}
  .report .pack-fixed,.report .pack-gap{break-inside:avoid;font-size:8.5pt;}
  .report .prepared-by{break-inside:avoid;margin-bottom:3mm;padding-bottom:2mm;}
  .report .prepared-by .pb-name{font-size:12pt;}
  a{color:#000 !important;text-decoration:underline;}
}
