@import url('https://fonts.googleapis.com/css2?family=STIX+Two+Text:wght@400;500;700&family=Source+Sans+3:wght@400;600&display=swap');

/* The same physical A4 composition is used for live preview and every printed page.
   Red/navy artwork and school lockup never participate in adaptive text fitting. */
.print-certificate {
  position: relative;
  box-sizing: border-box;
  display: block;
  width: 100%;
  aspect-ratio: 297 / 210;
  border-radius: 0 !important;
  overflow: hidden;
  container-type: inline-size;
  background: #fff url('/award-creator/st-bernadettes-approved-border.svg') center / 100% 100% no-repeat;
  color: #0e375e;
  text-align: center;
  isolation: isolate;
}
.print-certificate.volunteer {
  background-image: url('/award-creator/st-bernadettes-approved-border.svg');
}
.print-certificate .certificate-crest {
  position: absolute;
  z-index: 1;
  top: 12.3%;
  right: 5.1%;
  left: auto;
  display: block;
  width: 18.2%;
  height: 29%;
  object-fit: contain;
  object-position: center top;
}
/* Symmetric main field: its centre aligns with the physical page, not the crest. 
   The title has a narrower transparent region to avoid the right-hand lockup. */
.print-certificate .certificate-white-space {
  position: absolute;
  inset: 11.5% 9% 29% 9%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  background: transparent;
}
.print-certificate .certificate-copy {
  --certificate-fit: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: calc(1.65cqw * var(--certificate-fit));
  width: 100%;
  max-height: 100%;
  min-width: 0;
  overflow-wrap: normal;
  text-align: center;
  background: transparent;
}
.print-certificate .award-title {
  width: 69%;
  max-width: 100%;
  margin: 0 auto;
  font: 700 calc(5.6cqw * var(--certificate-fit)) / 1.01 'STIX Two Text', Georgia, serif;
  white-space: pre-line;
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
.print-certificate .presented {
  margin: 0;
  font: italic 600 calc(2.25cqw * var(--certificate-fit)) / 1.14 'Source Sans 3', Arial, sans-serif;
}
.print-certificate .divider { display: none; }
.print-certificate .certificate-recipient {
  width: 92%;
  margin: calc(1cqw * var(--certificate-fit)) auto;
  color: #ed193f;
  font: 500 calc(6.65cqw * var(--certificate-fit)) / 1.02 'STIX Two Text', Georgia, serif;
  text-wrap: balance;
}
.print-certificate .award-class {
  margin: 0;
  font: 600 calc(1.55cqw * var(--certificate-fit)) / 1.14 'Source Sans 3', Arial, sans-serif;
}
.print-certificate .certificate-citation {
  width: 91%;
  margin: calc(1cqw * var(--certificate-fit)) auto 0;
  font: 400 calc(2.2cqw * var(--certificate-fit)) / 1.2 'STIX Two Text', Georgia, serif;
  white-space: pre-line;
  text-wrap: pretty;
}
/* Reserved centred footer: unaffected by title or citation length.
   Writing lines sit above the labels; the date sits centred beneath. */
.print-certificate .certificate-footer {
  position: absolute;
  z-index: 1;
  left: 12%;
  right: 12%;
  bottom: 12.4%;
  height: 13.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: .75cqw;
  color: #0e375e;
}
.print-certificate .certificate-signatures {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 11%;
  width: 100%;
  margin: 0;
  font: 600 1.5cqw / 1.15 'Source Sans 3', Arial, sans-serif;
}
.print-certificate .certificate-signatures span {
  position: relative;
  box-sizing: border-box;
  width: 33%;
  text-align: center;
  padding-top: 2.7cqw;
}
.print-certificate .certificate-signatures span::before {
  content: '';
  position: absolute;
  top: 2.05cqw;
  left: 0;
  right: 0;
  border-top: 1px solid currentColor;
}
.print-certificate .certificate-signatures span:only-child {
  width: 42%;
}
.print-certificate .certificate-date {
  margin: 0;
  font: 600 1.45cqw / 1.15 'Source Sans 3', Arial, sans-serif;
  white-space: nowrap;
  background: transparent;
}
.certificate-pack { width: 297mm; margin: 0; }
@page { size: A4 landscape; margin: 0; }
@media print {
  .print-certificate {
    width: 297mm !important;
    height: 210mm !important;
    max-width: none;
    break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .certificate-pack .print-certificate + .print-certificate {
    break-before: page;
  }
}

/* Prevent preview shells or shared card rules from rounding certificate artwork. */
.print-certificate, .print-certificate * { border-radius: 0 !important; }
