/* Blank printable literature order form (served by the Pages Function
   functions/literature-order-blank.js). Laid out like the LA Intergroup's
   own order sheet. Print: US Letter, page 1 = blanks + ordering box,
   page 2 = item tables in two columns. On paper the tables are 7pt, the
   same as her sheet, so it fits on 2 pages; on screen they stay 9pt. Emphasis is bold AND red (never color alone), and boxes keep
   borders so a black-and-white printer loses nothing. */

:root {
  --ink: #111;
  --em: #b00000;
  --box: #e4e4e4;
  --rule: #555;
  --bg: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10pt;
  line-height: 1.3;
}

main { max-width: 8.5in; margin: 0 auto; padding: 0 16px; }

.intro {
  max-width: 8.5in;
  margin: 16px auto;
  padding: 12px 16px;
  border: 2px solid var(--rule);
  font-size: 12pt;
}
.intro p { margin: 0 0 8px; }

.sheet { padding: 0.2in 0; }
.sheet + .sheet { border-top: 2px dashed var(--rule); margin-top: 24px; }

.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.title-box { background: var(--box); border: 1px solid var(--rule); padding: 4px 20px; text-align: center; flex: 1; }
.title-box p { margin: 0; }
.org { font-weight: bold; font-size: 11pt; }
.form-name { font-weight: bold; font-size: 14pt; }
.seal { width: 0.8in; height: 0.8in; }

h1 { font-size: 11pt; margin: 4px 0 10px; }
h2 { font-size: 11pt; text-transform: uppercase; text-decoration: underline; margin: 10px 0 4px; }
h3 { font-size: 10.5pt; text-transform: uppercase; text-decoration: underline; margin: 10px 0 4px; }
.small { font-size: 9pt; margin: 0 0 6px; }
.em { color: var(--em); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.box { border: 1.5px solid var(--ink); padding: 8px 10px; }
.box.right { background: var(--box); }
.box p { margin: 0 0 6px; }
.box ol { margin: 0 0 6px; padding-left: 18px; }

.field { display: flex; align-items: flex-end; gap: 6px; margin: 0 0 12px; font-weight: bold; font-size: 9.5pt; }
.field .line { flex: 1; border-bottom: 1px solid var(--ink); min-height: 1.1em; }
.field.half { display: inline-flex; width: 48%; }
.send-to { margin-left: 0.3in; }
.send-to .line { display: inline-block; width: 70%; border-bottom: 1px solid var(--ink); min-height: 1.4em; }

.sheet-foot { text-align: center; margin-top: 10px; }
.sheet-foot p { margin: 0 0 2px; }
.rev { font-size: 9pt; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.col h2 { text-decoration: none; text-align: center; margin: 0 0 4px; font-size: 10pt; }

table.items { width: 100%; table-layout: fixed; border-collapse: collapse; margin-bottom: 4px; font-size: 9pt; line-height: 1.1; }
table.items caption { background: var(--box); border: 1px solid var(--ink); border-bottom: 0; font-weight: bold; text-transform: uppercase; padding: 2px; }
table.items th, table.items td { border: 1px solid var(--ink); padding: 1px 2px; vertical-align: middle; }
table.items th { font-size: 9pt; }
table.items td { height: 0.2in; }
.col-code { white-space: nowrap; font-weight: bold; }
.col-rev, .col-price { white-space: nowrap; text-align: right; }
/* Fixed layout reads widths from the header row: code, title (rest), revised, price, qty, total. */
table.items th:nth-child(1) { width: 0.42in; }
table.items th:nth-child(3) { width: 0.48in; }
table.items th:nth-child(4) { width: 0.5in; }
table.items th:nth-child(5) { width: 0.4in; }
table.items th:nth-child(6) { width: 0.5in; }

.subtotal { display: flex; align-items: flex-end; gap: 6px; font-weight: bold; margin: 10px 0; }
.subtotal .line { flex: 1; border-bottom: 1px solid var(--ink); min-height: 1.2em; }
.see-first { font-weight: bold; text-align: center; margin: 12px 0; }

@media (max-width: 640px) {
  .grid, .cols { grid-template-columns: 1fr; }
  .seal { width: 56px; height: 56px; }
}

@page { size: letter; margin: 0.4in; }

@media print {
  .screen-only { display: none !important; }
  main { padding: 0; max-width: none; }
  .sheet { padding: 0; }
  .sheet + .sheet { border-top: 0; margin-top: 0; }
  .sheet-1 { break-after: page; page-break-after: always; }
  .grid { grid-template-columns: 1fr 1fr; }
  table.items, table.items th { font-size: 7pt; line-height: 1.05; }
  table.items td { height: 0.15in; }
  .cols { display: block; column-count: 2; column-gap: 0.15in; }
  .col { display: contents; }
  .col h2 { break-after: avoid; }
  table.items caption, table.items thead { break-after: avoid; }
  .sheet-2 .sheet-head { margin-bottom: 4px; }
  .sheet-2 .seal { width: 0.5in; height: 0.5in; }
  .sheet-2 .form-name { font-size: 11pt; }
  table.items tr { break-inside: avoid; }
  .box.right, .title-box, table.items caption { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
