/*Write your custom css in this file.*/

/* ==========================================================
   Custom CSS for M.AD & ThessWebsite — Proposals (PDF layout)
   Applies to: Proposals, Proposal PDFs, Proposal Print
   File: /assets/css/custom-style.css
   ========================================================== */

/* Limit the rules only to proposal views and PDFs */
body.proposals-view,
body.proposals-pdf {
  background: #ffffff !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* A4 page layout for Proposal PDFs */
@page {
  size: A4;
  margin: 0;
}

/* General reset for proposal content */
body.proposals-view html,
body.proposals-pdf html,
body.proposals-view body,
body.proposals-pdf body {
  width: 210mm;
  height: 297mm;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  background: #ffffff !important;
}

/* Fix tables (used as background pages) */
body.proposals-view table,
body.proposals-pdf table {
  width: 794px !important;   /* 210mm at 96dpi */
  height: 1123px !important; /* 297mm at 96dpi */
  border-collapse: collapse;
  margin: 0 !important;
  padding: 0 !important;
}

/* Force background images to fill entire A4 */
body.proposals-view table[style*="background-image"],
body.proposals-pdf table[style*="background-image"] {
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: top left !important;
}

/* Each new table starts a new PDF page */
body.proposals-view table + table,
body.proposals-pdf table + table {
  page-break-before: always;
}

/* Typography & spacing cleanup */
body.proposals-view td,
body.proposals-view div,
body.proposals-view p,
body.proposals-pdf td,
body.proposals-pdf div,
body.proposals-pdf p {
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

.proposal-preview-container {
  padding: 0px;
  width: 210mm;
  height: 297mm;
}

/* Optional: Prevent content clipping */
body.proposals-view *,
body.proposals-pdf * {
  box-sizing: border-box;
}

/* print a4 */
@media print {
            @page {
                size: A4 portrait; /* Set the print size to A4 portrait */
                margin: 0; /* Remove default print margins */
            }
            body {
                margin: 0;
                padding: 0;
                /* Optional: force A4 dimensions on body if @page is not fully supported */
                width: 210mm;
                height: 297mm;
            }
        }