/* -------------------------------------------------------------------------- */
/* Fonts                                                                       */
/* -------------------------------------------------------------------------- */
/* Place WOFF2 files here:
   /public/fonts/Gotham-Book.woff2
   /public/fonts/Gotham-Bold.woff2
   /public/fonts/Gotham-Black.woff2
*/
@font-face {
  font-family: "Gotham";
  src: url("/public/fonts/Gotham-Book.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gotham";
  src: url("/public/fonts/Gotham-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Gotham";
  src: url("/public/fonts/Gotham-Black.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------------------- */
/* Page setup                                                                  */
/* -------------------------------------------------------------------------- */
@page {
  size: Letter;
  margin: 0.5in;
}

body {
  font-family: "Gotham", Arial, sans-serif;
  background: #f3f4f6;
  margin: 0;
  padding: 24px;
}

/* -------------------------------------------------------------------------- */
/* App chrome (controls + preview container)                                   */
/* -------------------------------------------------------------------------- */
.preview-shell {
  max-width: 1200px;
  margin: 0 auto;
}

.controls {
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;

  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.controls input {
  width: 280px;
  margin-left: 8px;
  padding: 6px 8px;
}

.controls button {
  padding: 6px 10px;
  cursor: pointer;
}

.hint {
  flex-basis: 100%;
  font-size: 12px;
  color: #555;
}

.preview-area {
  background: #fff;
  padding: 12px;
  border-radius: 10px;
}

/* -------------------------------------------------------------------------- */
/* On-screen "page" preview                                                    */
/* -------------------------------------------------------------------------- */
.page-viewport {
  width: 100%;
  overflow: auto;
  padding: 12px;
  box-sizing: border-box;
}

.page {
  background: #fff;
  width: 8.5in;
  min-height: 11in;
  margin: 0 auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.page-preview {
  transform-origin: top center;
}

/* -------------------------------------------------------------------------- */
/* Letter content                                                              */
/* -------------------------------------------------------------------------- */
.certificate {
  padding: 28px;
  box-sizing: border-box;

  /* Helps the on-screen preview feel like a full page */
  min-height: calc(11in - 1in);

  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  width: 200px;
  max-height: 140px;
  object-fit: contain;
  object-position: left center;
}

.address {
  text-align: right;
  font-weight: 100;
  color: #999;
  line-height: 0.2;
}

.address__brand {
  color: var(--brand, #111);
  font-weight: 800;
}


.content {
  margin: 72px 60px 0 60px;
  flex: 1;
}

.date-right {
  text-align: right;
  margin: 0 0 12px 0;
}

.body-copy {
  line-height: 1.25;
}

.sig {
  margin-top: 3em;
  line-height: 14px;

  /* Keep together if anything ever tries to break */
  page-break-inside: avoid;
  break-inside: avoid;
}

.sig__closing {
  margin-bottom: 12px;
}

.sig img {
  width: 40%;
}

.sig p {
  margin: 5px auto;
}

/* -------------------------------------------------------------------------- */
/* Print                                                                        */
/* -------------------------------------------------------------------------- */
@media print {
  body {
    background: #fff;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .controls {
    display: none !important;
  }

  .preview-shell,
  .preview-area,
  .page-viewport {
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: visible !important;
    max-width: none !important;
  }

  /* Critical: stop the on-screen "fake page" sizing from affecting print */
  .page {
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .page-preview {
    transform: none !important;
  }

  /* Critical: allow content to fit within the real print page box */
  .certificate {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    page-break-after: avoid !important;
  }
}