/* ── Compact tables ─────────────────────────────────────────────────────── */

/* Size each column to its content — prevents leftover space being handed
   to the wrong column in 4+ column tables.  The table itself stays inside
   the content area; if it would overflow the browser scrolls it.          */
.md-typeset table:not([class]) {
  width: auto;
  max-width: 100%;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  padding: 0.3em 0.65em;
  vertical-align: top;
  line-height: 1.35;
}

/* ── Compact lists ───────────────────────────────────────────────────────── */

.md-typeset ol,
.md-typeset ul {
  margin-block: 0.45em;
}

.md-typeset li {
  margin-block: 0.1em;
  line-height: 1.5;
}

/* Shrink the marker (number / bullet) so it doesn't dominate the text   */
.md-typeset li::marker {
  font-size: 0.8em;
}

/* ── PDF rendering overrides ─────────────────────────────────────────────────
   The mkdocs-with-pdf plugin invokes WeasyPrint with @media print active.
   Material's screen layout uses position:sticky/fixed, viewport-height
   containers, and overflow:hidden in ways that break WeasyPrint's
   pagination — content past religion-stpa.md silently truncates without
   any build warning. These rules unwind those screen-only constraints so
   long-form content paginates naturally. Screen rendering is untouched.
*/
@media print {
  /* Hide chrome that has no meaning in a printed book */
  .md-header, .md-tabs, .md-footer, .md-sidebar, .md-search,
  .md-nav, .md-overlay, .md-skip, .md-source-file, .md-tooltip,
  .md-feedback, .md-top, .md-banner, .md-announce {
    display: none !important;
  }
  /* Let the document flow as one continuous block instead of a flexbox
     of viewport-height columns */
  html, body,
  .md-container, .md-main, .md-main__inner,
  .md-content, .md-content__inner, .md-content article {
    position: static !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }
  /* Tables and code blocks: allow natural reflow, no clipped scrollers */
  .md-typeset table, .md-typeset pre, .md-typeset code {
    overflow: visible !important;
    max-height: none !important;
  }
  /* Each <article> in the with-pdf concat may break across pages */
  article {
    page-break-inside: auto;
  }
}
