/* Print / PDF stylesheet. The standard has to survive being handed to a judges' table on paper.
   Two rules do most of the work here: a heading must never be the last thing on a page, and a
   section must be tight enough to actually fit the page it was given. */

@page {
  size: letter;
  margin: 17mm 15mm 18mm;
  @bottom-left  { content: "Pitch Competition Standards Council"; font: 8.5pt -apple-system, sans-serif; color: #8A8A8A; }
  @bottom-right { content: "Page " counter(page); font: 8.5pt -apple-system, sans-serif; color: #8A8A8A; }
}

.no-print, .topnav, .pagefoot, .toc__swap, .accordion-hint, .section-chevron,
.docmast, .jump { display: none !important; }

body {
  background: #fff; font-size: 10.5pt; line-height: 1.42;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.page { max-width: none; margin: 0; padding: 0; }
.page:has(.home-grid) { max-width: none; }
.home-grid { display: block; }
.toc--side { position: static; margin-top: 18px; break-inside: avoid; }

/* ── page breaks ─────────────────────────────────────────────────────────
   A heading is never allowed to sit alone at the foot of a page. `break-after: avoid`
   is what was missing before, which is why section titles orphaned. */
.section-head, .ref-card__head, .rubric-class, .table-head,
h1, h2, h3, h4, .cover__title, .cover__sub { break-after: avoid; break-inside: avoid; }
p { orphans: 3; widows: 3; }

/* small blocks stay whole */
.rule-card, .rubric-card, .criterion, .ref-card, .lj-shot, .anchor,
.factor, .rubric-protocol, .letter, .scale-note { break-inside: avoid; }

/* ── 4.1 judged factors ──────────────────────────────────────────────────
   These rules cover what 4.1 emits now. It was rebuilt from a class-and-mode table into
   factors with criteria and anchored bands, and none of the break control above matches
   the new markup: `.factor` is the on-screen accordion, while print emits `.subsec`
   holding `.crit` blocks. So a criterion could lose its last band or two to the next page,
   leaving band rows stranded under no heading, and a criterion name could sit alone at the
   foot of a page.

   A criterion is the unit a judge reads: the name plus its six anchored bands mean nothing
   apart, so the whole block travels together. Six bands run about a quarter of a page, so
   this can never strand a block too tall to place. A factor can exceed a page, so it stays
   breakable and only its heading is pinned to the first criterion under it. */
.crit { break-inside: avoid; }
.crit__bands, .crit__bands .band { break-inside: avoid; }
.crit__factor { break-after: avoid; }
/* Chrome honors break-inside far more reliably than break-after, so the heading is also
   held from the other side by the block that follows it. */
.subsec > .crit__factor + .crit,
.crit__factor + .crit { break-before: avoid; }

/* 4.3's criterion cards are a two column grid on screen. In print that grid strands its
   last card on a page of its own: every grid row is as tall as the tallest card in it, and
   that wasted space is exactly what the final card needed. Two columns of flowing text
   instead pack each card at its natural height, which recovers the space and keeps the set
   together. Cards stay unbreakable, so none is ever cut down the middle. */
.criteria-grid { display: block; columns: 2; column-gap: 14px; }
.criteria-grid .criterion { break-inside: avoid; margin: 0 0 12px; width: 100%; }

/* front matter owns page 1, then every numbered section starts fresh */
/* A cover page is a cover page: the block sits in the optical middle of the sheet with
   the mark above it, and nothing else shares the page. 240mm is the letter page height
   less the @page margins, so "centred" means centred in the printable area rather than in
   a viewport that does not exist on paper. */
.cover {
  min-height: 240mm; padding: 0; break-after: page;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cover__logo { height: 82px; width: auto; margin: 0 0 30px; }
.cover__kicker { font-size: 9.5pt; }
.letter { margin: 0; }
.rule-section, .rule-accordion { break-before: page; }
/* standalone /rubric/rules starts at the top of a page already, so no leading blank */
.rule-section:first-of-type, .rule-accordion:first-of-type { break-before: avoid; }
/* but the complete document has a cover and a letter in front of section 1.0 */
body[data-page="print"] .rule-section:first-of-type { break-before: page; }

/* Section 5 starts a page, then the role walkthroughs flow two or three to a page */
.lj-sections { break-before: page; }
.lj-sections .rule-section { break-before: auto; break-inside: avoid; }
.lj-sections .rule-section + .rule-section { margin-top: 22px; }

/* accordions print open and flat */
.rule-accordion { border: 0; box-shadow: none; overflow: visible; margin: 0; }
.rule-accordion > summary.section-head { padding: 0; }
.accordion-body { padding: 0; border-top: 0; background: #fff; }

/* ── density ──────────────────────────────────────────────────────────────
   Tightened so a six-rule section fits one page instead of spilling a single
   card onto a near-empty one. */
.section-head { margin: 0 0 14px; padding-bottom: 11px; gap: 13px; }
.section-badge { width: 54px; height: 40px; font-size: 17px; border-radius: 4px; }
.section-eyebrow { font-size: 8pt; margin: 0 0 2px; }
.section-title { font-size: 19pt; margin: 0 0 4px; }
.section-subtitle { font-size: 9pt; max-width: none; }

.rule-list { gap: 8px; }
.rule-card { padding: 10px 13px; gap: 12px; border-radius: 5px; }
.rule-num { width: 24px; height: 24px; font-size: 10pt; border-radius: 3px; }
.rule-title { font-size: 11.5pt; margin: 0 0 3px; }
.rule-text { font-size: 9.5pt; line-height: 1.4; }
.pill { margin-top: 7px; padding: 3px 9px; font-size: 7.5pt; }

.cover__title { font-size: 30pt; }
.cover__sub { font-size: 13pt; }
.cover__status { margin-top: 12px; padding: 7px 14px; font-size: 8pt; }
.letter { padding: 20px 22px; border-radius: 5px; }
.letter p { margin: 0 0 10px; font-size: 10pt; }

.rubric-grid { gap: 10px; }
.rubric-card { padding: 13px; border-radius: 5px; }
.rubric-card__name { font-size: 11.5pt; }
.rubric-card__desc { font-size: 8.5pt; margin-bottom: 9px; }
.rubric-card__label { margin: 10px 0 5px; font-size: 7.5pt; }
.rubric-protocol { gap: 5px; }
.rubric-protocol div { padding: 5px 7px; }
.rubric-protocol strong { font-size: 8.5pt; }
.factor { padding: 5px 7px; gap: 7px; }
.factor__type { width: 17px; height: 17px; font-size: 7.5pt; }
.factor__name, .factor__weight { font-size: 8.5pt; }


.criteria-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.criterion { padding: 13px; border-radius: 5px; }
.criterion__title { font-size: 10.5pt; margin-bottom: 6px; }
.criterion__body { font-size: 9pt; margin-bottom: 10px; }

/* ── Section 5 device screens ── */
.lj-grid { gap: 14px; }
.lj-grid--phone { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.lj-grid--desktop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lj-shot figcaption { font-size: 8pt; margin-top: 6px; }

/* ── Appendix A ── */
.scale-note { margin-bottom: 16px; padding: 11px 13px; font-size: 9pt; }
.ref-grid { gap: 12px; }
.ref-card { padding: 15px; border-radius: 5px; }
.ref-card__title { font-size: 14pt; }
.ref-card__dim { font-size: 7.5pt; }
.ref-card__body { gap: 13px; margin-top: 11px; }
.ref-card__panel { padding: 13px 15px; border-radius: 5px; }
.ref-card__panel li { font-size: 9pt; margin-bottom: 6px; }
.k-badge { font-size: 8pt; padding: 5px 10px; margin-top: 11px; }
.anchor { padding: 8px 10px; border-radius: 5px; gap: 9px; }
.anchor__n { width: 22px; height: 22px; font-size: 9.5pt; border-radius: 4px; }
.anchor__text { font-size: 9pt; }

/* the criterion index is a real table: let it flow, and repeat its header */
.ref-table { break-inside: auto; font-size: 9pt; }
.ref-table thead { display: table-header-group; }
.ref-table tr { break-inside: avoid; }
.ref-table th, .ref-table td { padding: 5px 8px; }
.table-head { margin: 22px 0 8px; font-size: 13pt; }

a { color: inherit; text-decoration: none; }

/* The facts stack is a screen affordance: four labelled rows per criterion added eleven
   pages to the printed document. On paper the same facts run inline on one line. */
.shell, .plane, .plane__body { display: block; border: 0; border-radius: 0; padding: 0; min-height: 0; }
.ref-facts { display: block; font-size: 8pt; background: none; border: 0; padding: 0; }
.ref-facts div { display: inline; }
.ref-facts div + div::before { content: " · "; color: #9A9A9A; }
.ref-facts dt { display: inline; font-size: 8pt; letter-spacing: .04em; }
.ref-facts dt::after { content: " "; }
.ref-facts dd { display: inline; font-size: 8pt; }

/* ── printed criterion cards: density, not decoration ──
   The facts line added about twenty points to each card, which is all it took to push a
   second card off the page: the appendix went from two cards a page to one, and the
   document from 34 pages to 45. Trimming the padding buys the pairing back. Verified by
   page count, which is the only honest measure of a change like this. */
.ref-card { padding: 11px 13px; }
.ref-card__title { font-size: 12.5pt; }
.ref-card__body { gap: 10px; margin-top: 8px; }
.ref-card__panel { padding: 10px 12px; }
.ref-card__panel-label { margin-bottom: 5px; }
.ref-card__panel li { font-size: 8.5pt; margin-bottom: 3px; line-height: 1.35; }
.crit__bands { gap: 3px; }
.band { padding: 3px 7px; }
.band__r { font-size: 8pt; }
.band__t { font-size: 8.5pt; line-height: 1.35; }
.ref-facts { margin-top: 3px; }

/* conformance prints as part of the front matter, tight */
.conf__lead p { font-size: 9.5pt; margin: 0 0 8px; }
.conf__labels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.conf__label { padding: 11px 13px; border-radius: 5px; break-inside: avoid; }
.conf__label h4 { font-size: 11pt; margin: 0 0 4px; }
.conf__label p { font-size: 9pt; }
.conf__note { margin-top: 12px; padding: 9px 12px; font-size: 8.5pt; break-inside: avoid; }
.conf__tmpl { background: #fff; color: #16181A; border: 1px solid #CFCBC2; font-size: 8pt; padding: 10px 12px; break-inside: avoid; }
.conf__lead-p, .conf__short { font-size: 9pt; }
