/*
 * Build Calc Guy - public_html/assets/css/print.css
 * Load with: <link rel="stylesheet" href=".../print.css" media="print">
 *
 * stair-print.js builds the sheet inside #bcg-print and sets <html data-print="summary|template">.
 * While that attribute is set, only the sheet prints. US Letter, portrait.
 * The step template is drawn in real inches: it is true size only when printed at 100%.
 */

@page { size: letter portrait; margin: 0.25in; }

@media print {

  html[data-print], html[data-print] body { background: #fff !important; }
  html[data-print] body > *:not(#bcg-print) { display: none !important; }
  html[data-print] #bcg-print { display: block !important; }

  #bcg-print {
    color: #021D37;
    font-size: 8pt;
    line-height: 1.28;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  #bcg-print p, #bcg-print dl, #bcg-print dd, #bcg-print ul, #bcg-print ol, #bcg-print figure { margin: 0; }

  /* ================= Summary sheet ================= */

  .ps { padding: 0.1in 0.25in 0; }

  .ps-head { display: flex; align-items: center; gap: 12pt; padding-bottom: 3pt; border-bottom: 2pt solid #021D37; }
  .pb { display: inline-flex; align-items: center; gap: 6pt; }
  .pb__mark { height: 0.5in; width: auto; display: block; }
  .pb__name { font-family: var(--font-display); font-weight: 800; font-size: 15pt; letter-spacing: -0.01em; white-space: nowrap; }
  .pb__accent { color: #F97F0D; }
  .ps-head__title { font-family: var(--font-display); font-weight: 700; font-size: 11pt; color: #37729C; }
  .ps-head__date { margin-left: auto; color: #4A5B6C; }

  .ps-title {
    font-family: var(--font-display); font-weight: 800; font-size: 9.5pt;
    margin: 5pt 0 2.5pt; padding-bottom: 1pt; border-bottom: 1pt solid #021D37;
  }

  /* headline */
  .ps .hero { margin-top: 5pt; padding: 3pt 10pt 4pt; border: 1pt solid #D1DCE3; border-left: 6pt solid #F97F0D; border-radius: 0;
              display: flex; flex-wrap: wrap; align-items: baseline; gap: 2pt 14pt; }
  .ps .hero__main { margin: 0; order: 1; gap: 0 6pt; }
  .ps .hero__count, .ps .hero__value { font-size: 17pt; }
  .ps .hero__at { font-size: 12pt; }
  .ps .hero__sub { order: 2; margin: 0; font-size: 10.5pt; }
  .ps .badge { order: 3; margin-left: auto; padding: 2pt 8pt 2pt 4pt; font-size: 8.5pt; }
  .ps .badge__icon { width: 12pt; height: 12pt; font-size: 7pt; }
  .ps .hero__note { order: 4; flex: 1 1 auto; margin: 0; font-size: 7.5pt; }

  /* diagram + measurements */
  .ps-top { display: flex; gap: 12pt; margin-top: 5pt; align-items: flex-start; }
  .ps-top__diagram { flex: 0 0 63%; }
  .ps-top__side { flex: 1 1 0; min-width: 0; }
  .ps-top__side .ps-title:first-child { margin-top: 0; }
  .ps .diagram { margin: 0; border: 1pt solid #D1DCE3; border-radius: 0; }
  .ps .diagram svg { display: block; width: 100%; height: auto; }
  .ps .diagram__caption { padding: 2pt 6pt; font-size: 7.5pt; border-top: 1pt solid #D1DCE3; }

  .ps-inputs__row { display: flex; justify-content: space-between; gap: 8pt; padding: 1pt 0; border-bottom: 0.5pt solid #D1DCE3; }
  .ps-inputs dt { color: #4A5B6C; }
  .ps-inputs dd { font-weight: 600; text-align: right; }

  .ps .keys { margin-top: 4pt; grid-template-columns: 1fr; border: 1pt solid #D1DCE3; border-radius: 0; }
  .ps .keys__item { display: flex; align-items: baseline; justify-content: space-between; gap: 6pt; padding: 2pt 6pt; border-left: 0; border-top: 0.5pt solid #D1DCE3; }
  .ps .keys__item:first-child { border-top: 0; }
  .ps .keys__label { font-size: 7pt; }
  .ps .keys__value { margin: 0; font-size: 10.5pt; text-align: right; white-space: nowrap; }
  .ps .keys__sub { font-size: 7pt; margin: 0; }

  /* code check | good practice + materials */
  .ps-cols { display: flex; gap: 12pt; align-items: flex-start; }
  .ps-col { flex: 1 1 0; min-width: 0; }

  .ps .checks { gap: 0; }
  .ps .check-item { gap: 5pt; padding: 1pt 0 1pt 5pt; border: 0; border-left: 2.5pt solid #1E7E34; border-radius: 0; background: none;
                    break-inside: avoid; margin-bottom: 1pt; }
  .ps .check-item--fail { border-left-color: #C62828; }
  .ps .check-item--warn { border-left-color: #FDB23D; }
  .ps .check-item--info { border-left-color: #37729C; }
  .ps .check-item__icon { display: none; }
  .ps .check-item__label { display: inline; font-size: 7.5pt; }
  .ps .check-item__message { display: inline; font-size: 7.5pt; }
  .ps .check-item__message::before { content: " "; }
  .ps .check-item__source { display: inline; font-size: 6.5pt; margin: 0; }
  .ps .check-item__source::before { content: " \00B7  "; }

  .ps .materials { border: 0; border-radius: 0; }
  .ps .materials__item { gap: 8pt; padding: 1.5pt 0; border-top: 0.5pt solid #D1DCE3; }
  .ps .materials__qty { font-size: 10pt; min-width: 2.6em; }
  .ps .materials__note { display: inline; font-size: 7.5pt; }
  .ps .materials__note::before { content: " "; }

  /* cutting */
  .ps .rows { display: grid; grid-template-columns: repeat(3, 1fr); border: 1pt solid #D1DCE3; border-radius: 0; }
  .ps .rows__item { padding: 2pt 6pt; border: 0; border-top: 0.5pt solid #D1DCE3; border-left: 0.5pt solid #D1DCE3; break-inside: avoid; }
  .ps .rows__item:nth-child(-n+3) { border-top: 0; }
  .ps .rows__item:nth-child(3n+1) { border-left: 0; }
  .ps .rows__label { font-size: 6.5pt; }
  .ps .rows__value { margin: 0; font-size: 9.5pt; }
  .ps .rows__note { font-size: 6.5pt; margin: 0; }

  .ps .marks { display: flex; flex-wrap: wrap; gap: 2pt 3pt; }
  .ps .marks__item { gap: 3pt; padding: 0.5pt 4pt; border: 0.5pt solid #7B8FA0; border-radius: 0; }
  .ps .marks__step { font-size: 7pt; min-width: 0; }
  .ps .marks__value { font-size: 8pt; }

  .ps-foot { margin-top: 5pt; break-inside: avoid; }
  .ps .notice { margin: 0; padding: 2pt 6pt; border-left: 3pt solid #021D37; font-size: 7.5pt; background: none; }
  .ps-foot__source { margin-top: 3pt !important; font-size: 7pt; color: #4A5B6C; }

  /* ================= Full-size step template ================= */

  .pt { position: relative; width: 8in; height: 10.4in; overflow: hidden; break-inside: avoid; }
  .pt-drawing { position: absolute; left: 0; top: 0; display: block; }
  .pt-shape { fill: none; stroke: #021D37; stroke-width: 1.2; stroke-linejoin: miter; }
  .pt-corner { fill: none; stroke: #021D37; stroke-width: 0.8; }
  .pt-text { font-family: var(--font-body); font-size: 17px; font-weight: 700; fill: #021D37; letter-spacing: 1px; }
  .pt-text--edge { font-size: 13px; font-weight: 600; }

  .pt-info { position: absolute; right: 0; bottom: 0; width: 3.8in; font-size: 8.5pt; line-height: 1.35; }
  .pt-info .pb__mark { height: 0.6in; }
  .pt-info__title { font-family: var(--font-display); font-weight: 800; font-size: 13pt;
                    margin: 2pt 0 0; padding-bottom: 2pt; border-bottom: 2pt solid #021D37; }
  .pt-info__sub { margin: 4pt 0 6pt !important; font-weight: 600; }
  .pt-steps { padding-left: 14pt; }
  .pt-steps li { margin-bottom: 4pt; }
  .pt-ruler { display: block; margin: 2pt 0; }
  .pt-ruler__line { fill: none; stroke: #021D37; stroke-width: 1.2; }
  .pt-info__note { margin-top: 6pt !important; padding: 3pt 6pt; border-left: 3pt solid #021D37; font-weight: 600; }
  .pt-info__source { margin-top: 4pt !important; font-size: 7pt; color: #4A5B6C; }

  /* ================= Roof pitch chart (pitch-chart-print.js) ================= */

  .pc-sheet { padding: 0.15in 0.35in 0; font-size: 9pt; }
  .pc-sheet__head { display: flex; align-items: center; gap: 12pt; padding-bottom: 4pt; border-bottom: 2pt solid #021D37; }
  .pc-sheet__title { margin-left: auto; font-family: var(--font-display); font-weight: 800; font-size: 16pt; }
  .pc-sheet__table { width: 100%; margin-top: 10pt; border-collapse: collapse; font-size: 10.5pt; line-height: 1.2; }
  .pc-sheet__table caption { display: none; }
  .pc-sheet__table th, .pc-sheet__table td { padding: 4pt 6pt; text-align: left; border-bottom: 0.5pt solid #D1DCE3; }
  .pc-sheet__table thead th { background: #021D37 !important; color: #fff; font-weight: 700; font-size: 9pt; vertical-align: bottom; }
  .pc-sheet__table tbody th, .pc-sheet__table td { white-space: nowrap; }
  .pc-sheet__table tbody th { font-weight: 800; }
  .pc-sheet__table tbody tr:nth-child(even) { background: #F1F5F8 !important; }
  .pc-sheet__table tr.is-major th, .pc-sheet__table tr.is-major td { font-weight: 700; }
  .pc-sheet__table tr.is-major th { box-shadow: inset 4pt 0 0 #F97F0D; }
  .pc-sheet__note { margin-top: 6pt !important; font-size: 7.5pt; color: #4A5B6C; }
  .pc-sheet__url { margin-top: 2pt !important; font-size: 8pt; font-weight: 700; }
}
