/* Traueranzeige Dr.-Ing. Alfred Weber
   Vorlage: Entwurf "Fassung B", Blatt 794 x 1123 px (A4).
   Ab 794 px Fensterbreite entspricht die Seite dem Entwurf Pixel für Pixel.
   Darunter passen sich Abstände und Schriftgrößen an, ohne unter gut lesbare Mindestwerte zu fallen. */

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/eb-garamond-roman.woff2") format("woff2");
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("/eb-garamond-italic.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #111111;
  --paper: #ffffff;
  /* Eine Einheit = 1 % der Innenbreite des Blattes (688 px im Originalmaß).
     Unter 726 px Fensterbreite ist das Blatt so breit wie das Fenster minus 38 px Rand und Rahmen. */
  --u: min(6.88px, calc((100vw - 38px) / 100));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "EB Garamond", Garamond, "Times New Roman", Times, serif;
  font-weight: 500;
  overflow-wrap: break-word;
}

p,
h1 {
  margin: 0;
}

/* Nur für Vorleseprogramme: Die sichtbaren Zeichen * und † werden dort als
   "geboren am" und "gestorben am" gesprochen. Unsichtbar und ohne Einfluss auf das Layout. */
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

/* Weißer Rand um das Blatt: 44 px im Originalmaß, auf kleinen Bildschirmen mindestens 10 px. */
.page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(10px, calc(50vw - 353px), 44px);
}

/* Äußerer Rahmen. Mindesthöhe im Seitenverhältnis des A4-Blattes (706 x 1035 px im Originalmaß);
   braucht der Text auf schmalen Bildschirmen mehr Höhe, wächst der Rahmen mit. */
.sheet {
  display: flex;
  width: 100%;
  max-width: 706px;
  min-height: min(1035px, calc((100vw - 20px) * 1035 / 706));
  border: 3px solid var(--ink);
  padding: 6px;
}

/* Innerer Rahmen */
.inner {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: clamp(20px, calc(var(--u) * 3.82), 26px);
  border: 1px solid var(--ink);
  padding: clamp(24px, calc(var(--u) * 6.46), 44px) clamp(14px, calc(var(--u) * 8.22), 56px) clamp(20px, calc(var(--u) * 5.29), 36px);
  text-align: center;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(20px, calc(var(--u) * 3.82), 26px);
}

.head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, calc(var(--u) * 3.53), 24px);
}

.portrait {
  display: block;
  box-sizing: content-box;
  width: clamp(128px, calc(var(--u) * 40), 180px);
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--ink);
}

/* Die vier Zeilen des Entwurfs bleiben als Sinnzeilen erhalten. Auf schmalen Bildschirmen wird die
   Schrift bis 16,5 px verkleinert, damit die längste Zeile nicht umbricht; reicht auch das nicht,
   teilt sich eine Zeile ausgewogen in zwei. */
.intro {
  font-size: min(clamp(18px, calc(var(--u) * 3.09), 21px), max(16.5px, calc(var(--u) * 5.2)));
  line-height: 1.45;
  font-style: italic;
}

.intro span {
  display: block;
  text-wrap: balance;
}

.who {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

h1 {
  font-size: clamp(18px, calc(var(--u) * 7.35), 50px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.dates {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: clamp(16px, calc(var(--u) * 5.88), 40px);
  row-gap: 0;
  font-size: clamp(18px, calc(var(--u) * 2.94), 20px);
  line-height: 1.4;
  font-variant-numeric: lining-nums;
  white-space: nowrap;
}

.dates p {
  position: relative;
}

.rule {
  width: 56px;
  height: 0;
  border-top: 1px solid var(--ink);
}

.words {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: clamp(18px, calc(var(--u) * 2.94), 20px);
  line-height: 1.5;
}

.words p {
  text-wrap: balance;
}

.pair {
  display: flex;
  flex-direction: column;
}

.signed {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.names {
  display: flex;
  flex-direction: column;
  font-size: clamp(19px, calc(var(--u) * 3.09), 21px);
  line-height: 1.4;
}

.names .second {
  font-size: clamp(16.75px, calc(var(--u) * 2.72), 18.5px);
}

.when {
  font-size: clamp(16px, calc(var(--u) * 2.5), 17px);
  line-height: 1.4;
}

.closing {
  font-size: clamp(17px, calc(var(--u) * 2.65), 18px);
  line-height: 1.4;
  font-style: italic;
  text-wrap: balance;
}

/* Druck: genau ein A4-Blatt im Originalmaß des Entwurfs. */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  .page {
    display: block;
    min-height: 0;
    height: 296mm;
    padding: 44px;
    overflow: hidden;
  }

  .sheet {
    min-height: 0;
    height: 100%;
    margin: 0 auto;
  }
}
