/* Code Analyzer Exceptions report — screen chrome + a real print stylesheet.
 *
 * doc: This page is handed to AppExchange reviewers, who will read it on screen
 * and then print or "Save as PDF" it to attach to a submission. Material's own
 * print handling keeps the sidebars and clips wide tables, so the print rules
 * below are not cosmetic — without them the PDF loses the right-hand column of
 * every findings table, which is the column holding the justification.
 *
 * Scoped to .ca-* classes and to printing, so nothing here can affect the rest
 * of the site. Consumed only by docs/reference/analyzer-exceptions.md, which is
 * generated by docs-site/scripts/generate_analyzer_exceptions.py. */

.ca-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin: 0 0 1.6rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid var(--fn-line, #d3d3ce);
  border-radius: var(--fn-radius, 10px);
  background: var(--fn-gen-soft, #e9e9e5);
}

.ca-print {
  font-family: var(--fn-font-body, sans-serif);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fn-panel, #fff);
  background: var(--fn-ink, #0b0b0b);
  border: 0;
  border-radius: 6px;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  transition: background 120ms ease;
}

.ca-print:hover,
.ca-print:focus-visible {
  background: var(--fn-accent-ink, #a80217);
}

.ca-stamp {
  font-family: var(--fn-font-mono, monospace);
  font-size: 0.72rem;
  color: var(--fn-ink-faint, #8a8a86);
}

.ca-meta {
  font-family: var(--fn-font-mono, monospace);
  font-size: 0.74rem;
  color: var(--fn-ink-soft, #494949);
  margin: -0.4rem 0 1rem;
  padding: 0.35rem 0.6rem;
  border-left: 3px solid var(--fn-line, #d3d3ce);
  background: var(--fn-paper-dim, #e4e4e0);
}

.ca-meta code {
  font-size: 0.95em;
  background: none;
  padding: 0;
}

/* ---------------------------------------------------------------- print --- */

@media print {
  /* Material's chrome: navigation, search, the footer nav, the announcement
     bar, and the "back to top" button all have no meaning on paper. */
  .md-header,
  .md-sidebar,
  .md-footer,
  .md-nav,
  .md-search,
  .md-top,
  .md-dialog,
  .md-skip,
  .ca-actions {
    display: none !important;
  }

  /* Material constrains .md-content to a column sized for a viewport that has
     two sidebars. With those gone the column must reclaim the full page, or
     every table below is clipped at the right edge. */
  .md-main__inner,
  .md-content,
  .md-content__inner,
  .md-grid {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  body,
  .md-typeset {
    background: #fff !important;
    color: #000 !important;
    font-size: 10.5pt;
  }

  /* Findings tables are the payload. Let them wrap rather than scroll — a
     horizontal scrollbar prints as a truncation. */
  .md-typeset table:not([class]) {
    display: table !important;
    width: 100% !important;
    font-size: 8.8pt;
    table-layout: fixed;
    border-collapse: collapse;
  }

  .md-typeset table:not([class]) th,
  .md-typeset table:not([class]) td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    padding: 4pt 6pt;
    border: 0.5pt solid #999 !important;
    vertical-align: top;
  }

  .md-typeset table:not([class]) code {
    font-size: 0.94em;
    overflow-wrap: anywhere;
  }

  .md-typeset :is(.tabbed-content, .md-typeset__scrollwrap, .md-typeset__table) {
    overflow: visible !important;
  }

  /* Keep a justification with its heading and its table. A rationale split
     across a page break is the one thing that makes this document unreadable. */
  .md-typeset :is(h2, h3) {
    break-after: avoid;
    page-break-after: avoid;
  }

  .md-typeset :is(table, .admonition, pre) {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .md-typeset h2 {
    break-before: page;
    page-break-before: page;
    padding-top: 0;
  }

  .md-typeset h2:first-of-type {
    break-before: avoid;
    page-break-before: avoid;
  }

  .md-typeset a,
  .md-typeset a:visited {
    color: #000 !important;
    text-decoration: underline;
  }

  .md-typeset .admonition {
    border: 0.75pt solid #333 !important;
    box-shadow: none !important;
  }
}

@page {
  margin: 16mm 14mm;
}
