/* 

 * Wedding Videography Contract Styling

 * Optimized for DOMPDF PDF generation

 */

/* Base styles */

* {
  margin: 0;

  padding: 0;

  text-indent: 0;

  box-sizing: border-box;
}

/* DOMPDF specific fixes for height calculation */

html {
  height: auto !important;

  margin: 0 !important;
}

body {
  font-family: Calibri, Arial, sans-serif;

  line-height: 1.4;

  color: #000000;

  font-size: 9.6pt;

  background-color: #ffffff;

  width: 100%;

  /* Add vertical space at top and bottom of page */

  padding-top: 15mm;

  padding-bottom: 0;

  height: auto !important;

  position: relative !important;

  margin-bottom: 0 !important;
}

.contract-container {
  width: 100%;

  max-width: 170mm;

  margin: 0 auto;

  padding: 0 10mm 0 10mm; /* Added padding for top and bottom */
}

/* Typography */

h1 {
  font-family: Calibri, Arial, sans-serif;

  font-style: normal;

  font-weight: bold;

  font-size: 11pt;

  margin-bottom: 12px; /* Increased spacing */

  color: #000000;
}

h2 {
  font-family: Calibri, Arial, sans-serif;

  font-style: normal;

  font-weight: bold;

  font-size: 10pt;

  margin-bottom: 8px; /* Increased spacing */

  color: #000000;
}

p {
  font-family: Calibri, Arial, sans-serif;

  font-style: normal;

  font-weight: normal;

  font-size: 9.6pt;

  margin-bottom: 8px; /* Increased spacing between paragraphs */

  line-height: 1.5; /* Slightly increased line height */
}

/* Header section */

.contract-header {
  width: 100%;
}

.contract-title {
  text-align: center;

  margin: 20px 0 25px 0; /* Increased spacing */

  font-size: 14pt;

  text-transform: uppercase;
}

.parties {
  margin: 25px 0 20px 0; /* Increased spacing */
}

.agreement-intro {
  margin: 20px 0; /* Increased spacing */

  font-weight: bold;
}

/* Lists styling */

.main-list {
  padding-left: 20px;

  list-style-position: outside;

  margin-left: 0;

  margin-bottom: 15px; /* Added spacing after lists */
}

.main-list > li {
  margin: 20px 0 15px 0; /* Increased spacing between main list items */
}

.bullet-list {
  list-style-type: disc;

  padding-left: 30px;

  margin: 12px 0; /* Increased spacing around bullet lists */
}

.bullet-list > li {
  margin-bottom: 20px; /* Increased spacing between bullet points */
}

.alpha-list {
  list-style-type: lower-alpha;

  padding-left: 30px;

  margin: 12px 0; /* Increased spacing around alpha lists */
}

.alpha-list > li {
  margin-bottom: 20px; /* Increased spacing between alpha list items */
}

/* Footer section */

.contract-footer {
  border-top: 1px solid #eeeeee;

  width: 100%;
}

.contract-footer h1 {
  text-align: center;

  margin-bottom: 20px; /* Increased spacing */
}

.contract-footer h1 span {
  font-weight: normal;

  font-size: 10pt;
}

/* Logo styles */

.contract-logo {
  text-align: center;

  margin-bottom: 25px; /* Increased spacing */
}

.contract-logo img {
  max-width: 500px;

  height: auto;
}

/* Signature section */

.signatures {
  margin-top: 0; /* Increased spacing */

  margin-bottom: 0;

  padding-bottom: 0;

  width: 100%;
}

.signature-table {
  width: 100%;

  border-collapse: collapse;

  margin-top: 25px; /* Increased spacing */

  font-family: Calibri, Arial, sans-serif;

  table-layout: fixed;

  margin-bottom: 0;

  padding-bottom: 0;
}

.signature-table th {
  width: 33.33%;

  text-align: left;

  font-weight: bold;

  text-decoration: underline;

  padding-bottom: 20px; /* Increased spacing */

  font-size: 11pt;
}

.signature-table td {
  width: 33.33%;

  padding: 12px 15px 12px 0; /* Increased spacing */

  vertical-align: top;
}

.signature-table p {
  margin-bottom: 10px; /* Increased spacing */
}

/* Signature image styles */

.signature-image {
  margin: 8px 0; /* Increased spacing */

  height: 50px;
}

.signature-image img {
  max-width: 150px;

  max-height: 50px;
}

.signature-space {
  height: 49px;
}

.signature-space-with-image {
  height: 15px;
}

.signature-date {
  padding-top: 20px;

  border-top: 1px solid #eeeeee;
}

/* Highlighted field styling - Fixed vertical alignment */

.highlight-field {
  background-color: #ffffc5;

  display: inline-block;

  padding: 0 3px;

  border: 1px dashed #ffd700;

  vertical-align: middle;

  line-height: normal;

  position: relative;

  top: -1px; /* Fine-tune vertical position */
}

.highlight-field-active {
  background-color: transparent;

  border: none;
}

.unhighlight-field {
  background-color: transparent;

  display: inline-block;

  padding: 0 3px;

  border: 1px dashed transparent;

  vertical-align: middle;

  line-height: normal;

  position: relative;

  top: -1px; /* Fine-tune vertical position */
}

/* DOMPDF specific page settings */

@page {
  margin: 0.5cm 2cm; /* Increased top/bottom margins */

  size: A4 portrait;
}

/* Ensure proper text wrapping for all elements */

* {
  word-wrap: break-word;
}

/* Ensure tables don't overflow */

table {
  max-width: 100%;
}

/* Fix for DOMPDF rendering */

.contract-terms {
  width: 100%;
}

/* Ensure highlighted text is properly aligned in paragraphs */

p .highlight-field {
  display: inline;

  vertical-align: baseline;

  position: relative;

  padding: 0 3px;

  line-height: inherit;
}

/* Fix for highlighted text in table cells */

td .highlight-field {
  display: inline-block;

  vertical-align: middle;

  line-height: normal;
}

/* Add extra space after each section in the contract terms */

.contract-terms .main-list > li {
  margin-bottom: 20px; /* Increased spacing between sections */
}

/* Add extra space after the last paragraph in each bullet point */

.bullet-list > li > p:last-child {
  margin-bottom: 10px; /* Ensure space after the last paragraph in each bullet */
}

/* Add extra space after the last paragraph in each alpha list item */

.alpha-list > li > p:last-child {
  margin-bottom: 10px; /* Ensure space after the last paragraph in each alpha list item */
}
