/* ProAgriMedia 2026 Preference List — print stylesheet (loaded with media="print").

   The printed sheet is what reaches the rep, so it is designed to survive the print dialog's
   defaults: with "Background graphics" off every fill disappears, so nothing here that
   carries meaning depends on one. Chapter headers are ink on paper with a navy rule, a
   ticked option is a black tick in a ruled box plus a bold label, and the logos are images,
   which print either way. */

@page {
  size: A4 portrait;
  margin: 14mm 12mm 16mm 12mm;

  @bottom-left {
    content: "ProAgriMedia 2026 Preference List   |   " var(--print-running, "");
    font-family: var(--font-heading);
    font-size: 7pt;
    color: var(--ink-muted);
    vertical-align: top;
    padding-top: 3mm;
  }

  @bottom-right {
    content: "Page " counter(page) " of " counter(pages);
    font-family: var(--font-heading);
    font-size: 7pt;
    color: var(--ink-muted);
    vertical-align: top;
    padding-top: 3mm;
  }
}

html,
body {
  background: var(--white);
}

body {
  color: var(--ink);
  font-size: 9.5pt;
  line-height: 1.4;
}

/* -------------------------------------------------------- screen-only UI */

.skip-link,
.statusbar,
.chapter-toggle,
.region-filter,
.region-head,
.region-chips,
.closing-actions,
.closing-saved,
#total-live {
  display: none !important;
}

/* The accordion and the filter must never cost the printed page a chapter or a country;
   print.js clears both on beforeprint, and this is the guard if it did not run. */
.chapter-body.is-collapsed {
  display: block !important;
}

.chip[data-dimmed] {
  opacity: 1;
}

*,
*::before,
*::after {
  box-shadow: none !important;
  transition: none !important;
}

/* ------------------------------------------------------- running footer

   Chrome 131+ draws @page margin boxes, so every page carries the company, reference, date
   and a page count. print.js writes `--print-running` on beforeprint. The old fixed-position
   `.running-head` is not used on paper: Chrome drew a fixed element pushed into the page
   margin onto the neighbouring page instead of repeating it. */
.running-head {
  display: none !important;
}

/* ------------------------------------------------------------- masthead */

.masthead {
  border: 0;
}

.masthead-inner {
  max-width: none;
  padding: 0 0 4mm;
}

.masthead-top {
  padding-bottom: 3mm;
  border-bottom: 0.75pt solid var(--heading);
}

.logo-tag img {
  width: 58mm;
}

.masthead-meta dt {
  font-size: 7pt;
}

.masthead-meta dd {
  font-size: 9pt;
}

.masthead h1 {
  margin-top: 5mm;
  font-size: 19pt;
}

.masthead h1 span {
  display: inline;
}

.masthead h1::after {
  width: 18mm;
  height: 1mm;
  margin-top: 2.5mm;
  /* An ink-safe rule: a border prints when backgrounds do not. */
  background: none;
  border-top: 1mm solid var(--accent);
}

.masthead-lede {
  max-width: none;
  margin-top: 3mm;
  font-size: 9pt;
}

.prepared-for {
  margin-top: 4mm;
  padding: 0;
  background: none;
  border: 0;
}

.prepared-for-label {
  margin-bottom: 2mm;
  font-size: 10pt;
}

.prepared-fields {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4mm;
}

.pf label {
  font-size: 7pt;
  color: var(--ink-muted);
  margin: 0;
}

.pf input {
  min-height: 0;
  padding: 1mm 0;
  border: 0;
  border-bottom: 0.75pt solid var(--ink);
  border-radius: 0;
  font-size: 10pt;
  font-weight: var(--fw-medium);
}

.pf input::placeholder {
  color: transparent;
}

/* ---------------------------------------------------------------- sheet */

.sheet {
  max-width: none;
  margin: 0;
  border-radius: 0;
  overflow: visible;
}

.chapter {
  display: flex;
  align-items: baseline;
  gap: 3mm;
  margin-top: 5mm;
  padding: 0 0 1.5mm;
  background: none;
  color: var(--heading);
  border-bottom: 1.5pt solid var(--heading);
  break-after: avoid;
  break-inside: avoid;
}

.chapter::before,
.chapter::after {
  display: none;
}

.chapter-number {
  font-size: 15pt;
}

.chapter-name {
  font-size: 13pt;
}

.chapter-promise {
  display: none;
}

.chapter-count {
  margin-left: auto;
  padding: 0;
  border: 0;
  font-size: 8pt;
  color: var(--ink-muted);
}

.chapter-count span {
  color: var(--ink);
}

.chapter-body {
  padding: 0;
}

.section {
  grid-template-columns: 42mm minmax(0, 1fr);
  column-gap: 5mm;
  padding: 2.5mm 0;
  border-top: 0.5pt solid var(--rule-strong);
  break-inside: avoid;
}

.section-head {
  gap: 0.5mm 1.5mm;
}

.section-index,
.section-title {
  font-size: 8.5pt;
}

.section-count {
  padding: 0 1.2mm;
  background: none;
  border: 0.75pt solid var(--heading);
  color: var(--heading);
  font-size: 7pt;
  line-height: 1.5;
}

.section-note {
  font-size: 7.5pt;
}

/* ------------------------------------------------------- choice items */

.items[data-density="row"],
.items[data-density="card"],
.items[data-density="solo"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1mm 4mm;
}

.item,
.chip {
  min-height: 0;
  padding: 0.6mm 0;
  background: none !important;
  border: 0 !important;
  border-radius: 0;
  color: var(--ink-muted);
  font-weight: var(--fw-regular);
}

.item-label {
  grid-template-columns: 3.4mm minmax(0, 1fr);
  column-gap: 1.8mm;
  font-size: 8.5pt;
}

.item-sub {
  font-size: 7pt;
}

/* The box is a border and the tick is a glyph, so both print with backgrounds switched off. */
.item-label::before,
.chip-label::before {
  content: "";
  display: block;
  width: 3.4mm !important;
  height: 3.4mm;
  margin-top: 0.2mm;
  background: none !important;
  border: 0.75pt solid var(--ink);
  border-radius: 0.5mm;
  color: var(--ink);
  font-family: "Segoe UI Symbol", "DejaVu Sans", sans-serif;
  font-size: 8pt;
  font-weight: var(--fw-bold);
  line-height: 3.2mm;
  text-align: center;
}

.item:has(input[type="radio"]) .item-label::before {
  border-radius: 50%;
}

.item.is-on,
.item:has(input:checked),
.chip.is-on,
.chip:has(input:checked) {
  color: var(--ink);
  font-weight: var(--fw-bold);
}

.item.is-on .item-label::before,
.item:has(input:checked) .item-label::before,
.chip.is-on .chip-label::before,
.chip:has(input:checked) .chip-label::before {
  content: "\2713";
  border: 1.2pt solid var(--ink);
}

.item.is-on:has(input[type="radio"]) .item-label::before,
.item:has(input[type="radio"]:checked) .item-label::before {
  content: "\25CF";
  font-size: 6pt;
}

.items[data-density="chip"] {
  gap: 1mm 5mm;
}

.chip-label {
  gap: 1.8mm;
  font-size: 8.5pt;
}

/* --------------------------------------------------------------- regions

   On paper each region is one sentence written by print.js — "Southern Africa — all 9
   countries", "2 of 9: Botswana, Namibia", "not answered". Counting chips is what the
   grouping exists to end, so the chips themselves do not print. */
.section[data-kind="regions"] .items {
  display: block;
}

.regions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2mm 5mm;
}

.region-summary {
  display: block !important;
  margin: 0;
  font-size: 8.5pt;
  color: var(--ink-muted);
}

.region[data-print="all"] .region-summary,
.region[data-print="partial"] .region-summary {
  color: var(--ink);
  font-weight: var(--fw-bold);
}

.region[data-print="untouched"] .region-summary {
  font-style: italic;
}

/* ------------------------------------------------------ magazine compare */

.items.compare {
  gap: 3mm;
}

.compare-col {
  border: 0.5pt solid var(--rule-strong);
  border-radius: 0;
}

.compare-col-head {
  min-height: calc(2 * 1.35em + 2.4mm + 1.5pt);
  padding: 1.2mm 2mm;
  background: none;
  border-top: 1.5pt solid var(--accent);
  border-bottom: 0.5pt solid var(--rule-strong);
  font-size: 7.5pt;
}

.compare-col .item {
  padding: 0.8mm 2mm;
  border-top: 0 !important;
}

/* ------------------------------------------------------------------ fields */

.field label {
  font-size: 7pt;
}

.field input,
.field textarea {
  min-height: 0;
  padding: 1mm 0;
  border: 0;
  border-bottom: 0.75pt solid var(--ink);
  border-radius: 0;
  font-size: 9.5pt;
  field-sizing: content;
  resize: none;
}

.field textarea {
  min-height: 12mm;
}

.field input::-webkit-calendar-picker-indicator {
  display: none;
}

/* ----------------------------------------------------------------- closing */

.closing {
  max-width: none;
  margin: 0;
  border-top: 1.5pt solid var(--heading);
  clip-path: none;
  break-inside: avoid;
}

.closing-inner {
  grid-template-columns: 42mm minmax(0, 1fr);
  column-gap: 5mm;
  padding: 4mm 0;
}

.closing-count strong {
  font-size: 22pt;
}

.closing-note {
  font-size: 10.5pt;
}

.contact {
  margin: 0;
  padding: 3mm 0 0;
  background: none;
  color: var(--ink);
  border-top: 0.5pt solid var(--rule-strong);
  font-size: 8pt;
  break-inside: avoid;
}

.contact-logo {
  width: 32mm;
}

.contact a {
  color: var(--ink);
  text-decoration: none;
}
