/* Print stylesheet - applies only when printing (linked with media="print").
   US Letter, 0.5in margins, black-on-white, ink-conscious: hierarchy comes
   from borders and weight, not background fills. Orientation is injected
   per-template by printView.js (#print-page-setup). */

@page {
  margin: 0.5in;
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font-size: 9pt; color: #444; }
  @bottom-left { content: "GAN Yisroel Chayolei Hamelech"; font-size: 9pt; color: #444; }
}

/* only the print sheet is visible while printing */
body.printing { background: #fff !important; }
body.printing > *:not(.print-overlay) { display: none !important; }
.print-overlay { position: static !important; overflow: visible !important; background: #fff !important; padding: 0 !important; }
.print-overlay .print-toolbar { display: none !important; }
.print-sheet { box-shadow: none !important; margin: 0 !important; padding: 0 !important; max-width: none !important; }

.print-sheet { color: #000; background: #fff; font-size: 10.5pt; }

/* standard header block (logo slot renders only if the owner provides one) */
.print-sheet .p-header {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2pt solid #000;
  padding-bottom: 6pt; margin-bottom: 10pt;
}
.print-sheet .p-camp { font-size: 10pt; font-weight: 700; letter-spacing: .04em; }
.print-sheet .p-title { font-size: 16pt; font-weight: 800; unicode-bidi: plaintext; }
.print-sheet .p-date, .print-sheet .p-sub { font-size: 9pt; color: #444; }
.print-sheet .p-empty { color: #444; font-size: 11pt; margin-top: 12pt; }

/* sections: never orphan a heading; directory bunks start on a fresh page */
.print-sheet .p-section-title {
  font-size: 12pt; font-weight: 800;
  border-bottom: 1pt solid #999;
  margin: 10pt 0 6pt; padding-bottom: 2pt;
  break-after: avoid-page;
}
.print-sheet .p-new-page {
  break-before: page;
  /* the dashed page-break hint is screen-only chrome */
  border-top: none; margin-top: 0; padding-top: 0;
}

/* camper cards: fixed ~0.8in photo with thin border; empty frame when missing */
.print-sheet .p-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6pt; }
.print-sheet .p-card {
  break-inside: avoid;
  border: 1pt solid #bbb; border-radius: 3pt;
  padding: 4pt; text-align: center;
}
.print-sheet .p-photo {
  width: 0.8in; height: 0.8in; object-fit: cover;
  border: 0.5pt solid #999; border-radius: 2pt;
  display: block; margin: 0 auto 3pt;
  background: #fff;
}
.print-sheet .p-photo.empty { border: 1pt dashed #999; }
.print-sheet .p-photo-lg { width: 1.1in; height: 1.1in; }
.print-sheet .p-name { font-weight: 700; font-size: 9.5pt; unicode-bidi: plaintext; }
.print-sheet .p-meta { font-size: 8pt; color: #333; }

/* tables (counselor/teacher rosters) */
.print-sheet table { width: 100%; border-collapse: collapse; }
.print-sheet th, .print-sheet td {
  border: 1pt solid #999; padding: 3pt 5pt;
  font-size: 9.5pt; text-align: left; vertical-align: top;
}
.print-sheet th { font-weight: 700; border-bottom-width: 2pt; }
.print-sheet tr { break-inside: avoid; }

/* grade roster: names-only mode is large and scannable */
.print-sheet .p-names-only .p-name-lg { font-size: 13pt; font-weight: 800; }
.print-sheet .p-names-only.no-photo { grid-template-columns: repeat(3, 1fr); }
.print-sheet .p-names-only.no-photo .p-card { padding: 7pt 4pt; }
.print-sheet .p-photocell { width: 0.6in; padding: 2pt; }
.print-sheet .p-photocell .p-photo { width: 0.5in; height: 0.5in; margin: 0; }

/* attendance sheet: tall rows for handwriting, blank date headers */
.print-sheet .p-attendance td, .print-sheet .p-attendance th { height: 0.28in; }
.print-sheet .p-attendance .p-datehead { min-width: 0.55in; border-bottom: 2pt solid #000; }
.print-sheet .p-attendance .p-checkcell { min-width: 0.55in; }

/* profile sheet */
.print-sheet .p-profile-head { display: flex; gap: 12pt; align-items: flex-start; margin-bottom: 8pt; break-inside: avoid; }
.print-sheet .p-profile-head > div { flex: 1; }
.print-sheet .p-cols { column-count: 2; column-gap: 14pt; }
.print-sheet .p-block { break-inside: avoid; margin-bottom: 8pt; }
.print-sheet .p-block-title { font-weight: 800; font-size: 10.5pt; border-bottom: 1pt solid #999; margin-bottom: 3pt; }
.print-sheet .p-row { display: flex; gap: 6pt; font-size: 9.5pt; padding: 1.5pt 0; }
.print-sheet .p-k { color: #444; width: 1.1in; flex-shrink: 0; }
.print-sheet .p-v { unicode-bidi: plaintext; overflow-wrap: anywhere; }
.print-sheet .p-note { white-space: pre-wrap; font-size: 9.5pt; }

/* medical block on profile sheets: unmissable */
.p-med {
  border: 2px solid #b91c1c; border-radius: 6px;
  padding: .1in .12in; margin: .1in 0;
}
.p-med .p-block-title { color: #b91c1c; }

/* Bus prints --------------------------------------------------------------- */
.p-sub { color: #555; font-size: 9pt; margin: 2pt 0 6pt; }
.p-signin td, .p-signin th, .p-checkin td, .p-checkin th { font-size: 9.5pt; padding: 3pt 5pt; }
.p-signin .p-checkcell { min-width: .9in; }
.p-coun td { background: #f0ead2; font-weight: 700; }
.p-checkin .p-box { text-align: center; font-size: 13pt; width: .7in; }

.p-door { text-align: center; }
.p-door-bus { font-size: 44pt; font-weight: 800; color: #1a3a5c; }
.p-door-bunks { font-size: 19pt; font-weight: 700; color: #1a3a5c; margin: 4pt 0; }
.p-door-count { font-size: 11pt; color: #666; margin-bottom: 8pt; }
.p-door-top { font-size: 15pt; font-weight: 700; color: #1a3a5c; margin: 2pt 0; }
.p-door-names { margin-top: 6pt; }
.p-door-names.two-col { column-count: 2; column-gap: .4in; }
.p-door-name { font-size: 13pt; padding: 1.5pt 0; break-inside: avoid; }
.p-door-name.coun { font-weight: 700; color: #1a3a5c; }
.p-door-role { margin-top: 8pt; }
.p-door-role-h { font-weight: 700; color: #1a3a5c; font-size: 11.5pt; }
.p-div-name { text-align: left; }
.p-signin, .p-checkin { border-collapse: collapse; width: 100%; }
.p-signin td, .p-signin th, .p-checkin td, .p-checkin th { border: 1pt solid #999; text-align: left; }
.p-signin thead th, .p-checkin thead th { background: #eee !important; font-weight: 800; }
