/* ============================================================
   Resource Library printables — screen additions + print sheet
   Namespace: rp-
   Loaded only by public/resources/{slug}.html (generate-resource-pages.js).
   Sits on top of help-center.css, which supplies the article typography,
   the callout/copy block and the table shell.

   MASTER-PLAN task 4.z. The two hard requirements come from the F1 review,
   section G item 1:
     1. an empty square before every item in a checklist list, on screen and
        on paper, that a parent can tick with a pen;
     2. writable row heights on the blank rows of a notes table in print.
   Everything else here exists so a printed sheet is the artifact and not a
   screenshot of a web page.
   ============================================================ */

/* The Help Center hides the main site nav because it has its own chrome. A
   printable is reached from /resources, which carries the full site nav, so
   hiding it here would make the child page look like a different site. */
.rp-page #fpa-site-nav-mount {
  display: block;
}

.rp-hero-kicker {
  color: var(--hc-text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

/* ——— Print bar ——— */

.rp-actions {
  align-items: flex-start;
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin: 1.25rem 0 0;
  padding: 0.875rem 1rem;
}

.rp-print-btn {
  align-items: center;
  background: var(--hc-text);
  border: 0;
  border-radius: var(--hc-radius-pill);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
}

.rp-print-btn:hover {
  background: var(--hc-accent);
}

.rp-print-btn .material-symbols-outlined {
  font-size: 20px;
}

.rp-actions__note {
  color: var(--hc-text-muted);
  flex: 1 1 18rem;
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0;
}

/* ——— Tick lists ——— */

/* The square is a real element, not a ::before background. Browsers print
   with background graphics off by default, and a checkbox that disappears on
   paper defeats the page. A 1px border prints. */
.rp-check {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.rp-check__item {
  display: flex;
  gap: 0.65rem;
  margin: 0 0 0.5rem;
  padding: 0;
}

.rp-check__box {
  border: 1.5px solid var(--hc-text);
  border-radius: 3px;
  flex: 0 0 auto;
  height: 1rem;
  margin-top: 0.42rem;
  width: 1rem;
}

.rp-check__label {
  flex: 1 1 auto;
}

/* answerStyle.printFormat: lines that open with "Do not" are cautions. */
.rp-check__item--caution .rp-check__label {
  font-weight: 600;
}

.rp-check__item--caution .rp-check__box {
  border-color: var(--hc-accent);
}

/* ——— Writable tables ——— */

.rp-table--writable td,
.rp-table--writable th[scope="row"] {
  height: 2.25rem;
}

/* ============================================================
   Print
   ============================================================ */

@media print {
  /* Anything that is navigation, promotion or interaction. A printed sheet
     that carries a nav bar and a feedback widget wastes the first page. */
  .rp-page #fpa-site-nav-mount,
  .rp-page #fpa-site-footer-mount,
  .rp-page .hc-hero,
  .rp-page .hc-toc,
  .rp-page .hc-toc-mobile,
  .rp-page .rp-actions,
  .rp-page .hc-feedback,
  .rp-page .hc-related,
  .rp-page .hc-author-bio,
  .rp-page .hc-advocate-cta,
  .rp-page .hc-contact-strip,
  .rp-page .fpa-site-skip,
  .rp-page .hc-callout-copy,
  .rp-page .hc-byline-photo {
    display: none !important;
  }

  .rp-page {
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
    line-height: 1.4;
  }

  .rp-page .hc-panel {
    border-radius: 0;
    margin: 0;
    min-height: 0;
    padding: 0;
  }

  .rp-page .hc-container,
  .rp-page .hc-container--wide {
    max-width: none;
    padding: 0;
  }

  /* The two-column article/sidebar grid collapses so the article uses the
     full width of the sheet. */
  .rp-page .hc-article-layout {
    display: block;
  }

  .rp-page .hc-article {
    max-width: none;
  }

  .rp-page .hc-breadcrumb {
    margin-bottom: 0.5rem;
  }

  .rp-page h1 {
    font-size: 18pt;
    margin: 0 0 0.25rem;
  }

  .rp-page .hc-article-lede {
    font-size: 11pt;
    margin: 0 0 0.5rem;
  }

  .rp-page .hc-byline {
    font-size: 9pt;
    margin: 0 0 0.75rem;
  }

  /* One section per block of the sheet. Keep a heading with its list, and
     never split a section across a page boundary if it fits on one. */
  .rp-page .hc-section {
    break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 0.9rem;
  }

  .rp-page .hc-section h2 {
    break-after: avoid;
    page-break-after: avoid;
    font-size: 13pt;
    margin: 0 0 0.35rem;
  }

  .rp-page .hc-section p {
    margin: 0 0 0.4rem;
    orphans: 3;
    widows: 3;
  }

  /* Tick lines. Two lines at most per item is the authoring rule, so a break
     inside one is always a mistake. */
  .rp-page .rp-check__item {
    break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 0.32rem;
  }

  .rp-page .rp-check__box {
    border: 1pt solid #000000;
    height: 12pt;
    margin-top: 2pt;
    width: 12pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .rp-page .rp-check__item--caution .rp-check__box {
    border-color: #000000;
  }

  /* Copyable blocks print as the script they are, not as a grey card. */
  .rp-page .hc-callout {
    background: transparent;
    border: 1pt solid #000000;
    break-inside: avoid;
    page-break-inside: avoid;
    padding: 0.4rem 0.55rem;
  }

  .rp-page .hc-callout-text {
    white-space: pre-wrap;
  }

  /* Tables. The scroll container has no meaning on paper, and the header row
     repeats when a long table does cross a page. */
  .rp-page .hc-table-wrap {
    overflow: visible;
  }

  .rp-page .hc-table {
    border-collapse: collapse;
    width: 100%;
  }

  .rp-page .hc-table th,
  .rp-page .hc-table td {
    border: 0.75pt solid #000000;
    padding: 3pt 5pt;
    vertical-align: top;
  }

  .rp-page .hc-table thead {
    display: table-header-group;
  }

  /* The notes grid is written on in the room, so its rows need pen height and
     the grid must not be split across two sheets mid-row. */
  .rp-page .rp-table--writable td,
  .rp-page .rp-table--writable th[scope="row"] {
    height: 30pt;
  }

  .rp-page .rp-table--writable tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* A URL after every link turns a two-page checklist into four. The sources
     block prints its citations, which is what a reader needs on paper. */
  .rp-page a {
    color: #000000;
    text-decoration: none;
  }

  .rp-page .hc-sources {
    break-inside: avoid;
    page-break-inside: avoid;
    font-size: 9pt;
  }

  .rp-page .hc-jurisdiction {
    background: transparent;
    border: 0.75pt solid #000000;
    font-size: 9pt;
  }

  .rp-page .hc-jurisdiction-icon {
    display: none;
  }
}
