/* Cleaned syntax version — source: :contentReference[oaicite:0]{index=0} */

/* === Goudy font (relative paths for staging) === */
@font-face {
  font-family: 'Goudy';
  src: url('../../fonts/goudy/Goudy.woff') format('woff'),
       url('../../fonts/goudy/Goudy.otf') format('opentype'),
       url('../../fonts/goudy/Goudy.ttf') format('truetype'),
       url('../../fonts/goudy/Goudy.eot');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Autography';
  src: url('../../fonts/Autography.woff2') format('woff2'),
       url('../../fonts/Autography.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* === Container Width and Responsiveness === */
.container {
  max-width: 1000px;
  margin: 0 auto;           /* centers content horizontally */
  padding: 0 20px;          /* inner side spacing */
}

/* Tablet view */
@media (max-width: 1024px) {
  .container { max-width: 95%; }
}

/* Mobile view */
@media (max-width: 600px) {
  .container {
    max-width: 100%;
    padding: 0 16px;
  }
}

h1.coaraw {
  font-family: 'Goudy', serif;
  text-decoration: underline;
}

tr.dark-brown { background-color: #402020 !important; }
tr.dark-brown td { color: #FFFFFF !important; text-align:left!important;}

/* General Reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background: url("images/Background.jpg") no-repeat center center;
  background-size: cover;
  background-attachment: scroll;
  padding: 1rem;
}

h1, h2, h3 {
  margin: 1rem 0 0.5rem;
  text-align: center;
  color: #402020;
}

/* Paragraphs */
p {
  margin-bottom: 1rem;
  color: #402020;
  line-height: 1.8;
}

/* Tablet screens (medium devices) */
@media (max-width: 1024px) {
  p {
    font-size: 14pt;
    line-height: 1.7;
  }
}

/* Mobile screens (small devices) */
@media (max-width: 600px) {
  p {
    font-size: 12pt;
    line-height: 1.6;
  }
}

/* Anresco section */
p.anresco {
  text-align: center;
  margin: 20px auto;
  max-width: 600px; /* keeps line length readable */
  font-size: 16px;
  line-height: 1.6;
}

/* Ensure the image scales and stays centered */
img.anresco {
  display: block;
  margin: 10px auto;
  max-width: 180px; /* adjust size as needed */
  height: auto;
}

p.introduction { margin-bottom: 30px; font-size:16px;  text-align: center;}

section.signature p { font-size: 16px; }
p.name {
  font-family: 'Autography', cursive;
  font-size: 28pt;
  text-align: left;
  color: #402020;
  margin-top: 20px;
}


/* Header / Footer */
.logo-header, .logo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 1rem 0;
}

.logo { max-width: 150px; height: auto; }

/* Tables */
.table-container { overflow-x: auto; margin: 1rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
  background: rgba(255, 255, 255, 0.9);
  color: #402020;
}

thead { background: rgba(0, 0, 0, 0.06); }

th, td {
  border: 1px solid rgba(0, 0, 0, 0.2);
  text-align: left;

}

th, td { white-space: nowrap; word-break: keep-all; padding: 0.75rem 1rem; }
@media (max-width: 600px) {
  th, td { font-size: 0.9rem; padding: 0.6rem 0.8rem; }
}

/* Tables grid: stacked on mobile, two columns on desktop */
.tables-grid { display: grid; gap: 1rem; }
@media (min-width: 992px) {
  .tables-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* Signature */
.signature { margin-top: 2rem; text-align: left; color: var(--ink); }

/* Disclaimer: plain text at the bottom (no box, no bg) */
.disclaimer {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink);
  margin-top: 1.5rem;
}

/* Desktop tweaks */
@media (min-width: 768px) {
  body { padding: 2rem 4rem; }
  .logo { max-width: 200px; }
}

/* Print Styles */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
    padding: 0;
    font-size: 12pt;
  }

  .logo { max-width: 120px; }
  .logo-header, .logo-footer { margin: 0 0 1rem 0; }

  /* Keep tables readable on print */
  table {
    border-collapse: collapse;
    background: #fff !important;
    color: #000 !important;
  }
  th, td {
    border: 1px solid #000 !important;
    padding: 6px;
    font-size: 10pt;
  }

  /* Disclaimer remains plain text */
  .disclaimer {
    background: transparent !important;
    border: none !important;
    color: #000 !important;
  }

  /* Signature plain text */
  .signature {
    background: transparent !important;
    border: none !important;
    color: #000 !important;
  }
}

/* --- COA PDF-like Panels --- */
.coa-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  overflow: hidden;
}

.coa-card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(0deg, rgba(0,0,0,0.06), rgba(0,0,0,0.06));
  border-bottom: 1px solid rgba(0,0,0,0.2);
}

.coa-card__title h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #402020;
}

.status-badge {
  display: inline-block;
  font-weight: bold;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.2);
}

.status-pass {
  color: #0f5132;
  background: #d1e7dd;
  border-color: #badbcc;
}

/* compact table look */
.table-container.compact { margin: 0; }

.coa-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
}

.coa-table th,
.coa-table td {
  border: 1px solid rgba(0,0,0,0.25);
  padding: 0.5rem 0.6rem;
  text-align: left;
  color: #402020;
  font-size: 0.95rem;
}

.coa-table thead th {
  background: rgba(0,0,0,0.06);
  font-weight: 700;
}

.coa-table td.numeric,
.coa-table th.numeric {
  text-align: right;
  white-space: nowrap;
}

.coa-note {
  margin: 0.5rem 0.75rem 0.75rem;
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Alignment helpers */
.coa-table th.center,
.coa-table td.center { text-align: center; }

/* --- PDF-accurate COA tables (tan theme) --- */
:root {
  --ink: #402020;
  --tan: #ead9c0;
  --tan-head: #e2cda8;
  --tan-border: #8a6b3f;
}


.coa-card.is-tan {
  background: var(--tan);
  border: 1px solid var(--tan-border);
  border-radius: 4px;
  overflow: hidden;
}

.coa-card__title.is-tan {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: var(--tan-head);
  border-bottom: 1px solid var(--tan-border);
}

.coa-card__title.is-tan.split-3 { grid-template-columns: 1fr 1fr 1fr; }

.coa-card__title h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
  text-align: left;
}

.table-container.compact { margin: 0; }

.coa-table.is-tan {
  width: 100%;
  border-collapse: collapse;
  color: var(--ink);
  background: transparent;
}

.coa-table.is-tan td,
.coa-table.is-tan th {
  border: 1px solid var(--tan-border);
  padding: 0.55rem 0.6rem;
  font-size: 0.8rem;
}

.coa-table.is-tan td.numeric { text-align: left; white-space: nowrap; }
.coa-table.is-tan td.center { text-align: center; }

.coa-table.is-tan td.status.green {
  font-weight: 800;
  color: #11843b; /* deep green for PASS as in PDF */
}

/* Alignment fix for HM / Pest / Pass-Fail table */
.coa-card__title.is-tan.split-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  text-align: center;
}

.coa-card__title.is-tan.split-3 h3 { text-align: center; }

.coa-table.is-tan.hm-pest th,
.coa-table.is-tan.hm-pest td { text-align: left; }

.coa-table.is-tan.hm-pest td:first-child { text-align: left; }

/* Print Button */
.print-btn {
  background: #402020;
  color: #fff;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.print-btn:hover { background: #603030; }

.logo-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo-footer .print-btn { margin: 0 auto; }

/* === Print-specific fixes === */
@media print {
  /* Hide any UI-only elements */
  .screen-only,
  .no-print,
  .print,
  .print-btn,
  .print-button,
  button.print,
  a.print,
  .print-pdf,
  #print,
  #printButton {
    display: none !important;
    visibility: hidden !important;
  }

  /* Ensure logos and images render in printed/PDF output across browsers */
  img,
  .logo,
  header .logo,
  footer .logo,
  img[src*="logo"],
  img[alt*="logo" i] {
    display: inline-block !important;
    visibility: visible !important;a
    opacity: 1 !important;
    filter: none !important;
    -webkit-filter: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    image-rendering: auto;
  }

  /* Preserve colors in print */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Lot Number */
.lot-number {
  border: 2px solid #402020;
  background: rgba(255, 255, 255, 0.25);
  text-align: center;
  padding: 10px 20px;
  display: block;
  width: fit-content;
  margin: 20px auto;
}
