/*
 * Geschenkurkunde für die Seite "Spende verschenken".
 * Die Urkunde hat ein festes Format (A4 quer, 1123 × 794 px), damit Vorschau,
 * PDF und Ausdruck identisch aussehen. Sie wird in der Vorschau per JS skaliert.
 * Schriften liegen lokal (SIL Open Font License 1.1), kein Abruf bei Google Fonts.
 */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("/assets/cormorant-garamond-0b6541cf.woff2") format("woff2");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/cormorant-garamond-italic-d3604db8.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/assets/source-sans-3-4320f018.woff2") format("woff2");
}

@font-face {
  font-family: "Mrs Saint Delafield";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/mrs-saint-delafield-d7c45be6.woff2") format("woff2");
}

.gift-certificate-preview {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.gift-certificate-export {
  position: fixed;
  left: -10000px;
  top: 0;
}

/*
 * For the PDF export, html2canvas measures font baselines with this 1 × 1 pixel image next to a sample text in <body>.
 * Tailwind's preflight makes images block-level, which pushes the pixel onto its own line and draws all text too low.
 */
body > div > img[src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"] {
  display: inline;
}

.gift-certificate {
  --cert-teal: #2c5359;
  --cert-lehm: #dab784;
  --cert-pink: #d6896f;
  --cert-text: #22313a;
  --cert-muted: #5b6b70;

  box-sizing: border-box;
  width: 1123px;
  height: 794px;
  position: relative;
  overflow: hidden;
  background: #fffdf8;
  color: var(--cert-text);
  font-family: "Source Sans 3", Arial, sans-serif;
  transform-origin: top left;

  * { box-sizing: border-box; }

  .frame {
    position: absolute;
    inset: 28px;
    border: 3px solid var(--cert-lehm);

    &::after {
      content: "";
      position: absolute;
      inset: 8px;
      border: 1px solid var(--cert-lehm);
    }
  }

  .watermark {
    position: absolute;
    width: 480px;
    height: 480px;
    right: -150px;
    bottom: -170px;
    opacity: .05;
  }

  .inner {
    position: absolute;
    inset: 64px 96px 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .kicker {
    letter-spacing: .28em;
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 600;
    color: var(--cert-teal);
  }

  .title {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 600;
    font-size: 76px;
    line-height: 1;
    color: var(--cert-teal);
    margin: 14px 0 0;
  }

  .occasion {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-style: italic;
    font-size: 28px;
    color: var(--cert-pink);
    margin-top: 6px;
    min-height: 34px;
  }

  .for {
    font-size: 18px;
    color: var(--cert-muted);
    margin-top: 18px;
  }

  .name {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-weight: 600;
    font-size: 58px;
    line-height: 1.1;
    margin-top: 2px;
    padding: 0 24px 6px;
    border-bottom: 2px solid var(--cert-lehm);
    max-width: 820px;
    overflow-wrap: anywhere;
  }

  .text {
    font-size: 20px;
    line-height: 1.5;
    max-width: 780px;
    margin-top: 22px;
  }

  .stage {
    font-size: 18px;
    line-height: 1.5;
    max-width: 760px;
    margin-top: 10px;
    color: var(--cert-muted);
  }

  .amount {
    font-size: 18px;
    margin-top: 10px;
    font-weight: 600;
    color: var(--cert-teal);
  }

  .message {
    font-family: "Cormorant Garamond", Georgia, serif;
    font-style: italic;
    font-size: 25px;
    line-height: 1.35;
    max-width: 740px;
    margin-top: 14px;
    overflow-wrap: anywhere;
  }

  .footer {
    margin-top: auto;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 24px;

    .col {
      font-size: 15px;
      color: var(--cert-muted);
      line-height: 1.4;
    }

    .left { text-align: left; }
    .right { text-align: right; }

    .line {
      border-top: 1px solid var(--cert-muted);
      padding-top: 6px;
      display: inline-block;
      min-width: 230px;
    }

    strong {
      color: var(--cert-text);
      font-weight: 600;
    }
  }

  .signature {
    display: block;
    font-family: "Mrs Saint Delafield", cursive;
    font-size: 54px;
    line-height: 1;
    color: #1f3f6b;
    margin: 0 18px 6px 0;
    transform: rotate(-4deg);
    transform-origin: right bottom;
    white-space: nowrap;
  }

  .seal {
    width: 78px;
    height: 78px;
  }

  .fine {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 46px;
    text-align: center;
    font-size: 11.5px;
    color: #8a9599;
  }
}

/* Druck: nur die Urkunde, ohne Navigation und Fußzeile der Website */
@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  body:has(.gift-certificate) * { visibility: hidden !important; }

  .gift-certificate,
  .gift-certificate * { visibility: visible !important; }

  .gift-certificate {
    position: fixed !important;
    left: 0;
    top: 0;
    transform: none !important;
    width: 297mm;
    height: 210mm;
  }
}
