/**
 * Datenblatt – eigenes Stilblatt für Papier.
 *
 * Bewusst getrennt vom Stilblatt der Website: Das Datenblatt hat eine andere
 * Aufgabe. Es wird gedruckt oder als PDF abgelegt, hat keine Navigation, keine
 * Zustände und keine Bewegung. Hier zählen Lesbarkeit auf A4, saubere
 * Seitenumbrüche und sparsamer Farbauftrag.
 *
 * Die Hausfarben sind dieselben wie auf der Website – mehr Gemeinsamkeit
 * braucht es nicht.
 */

:root {
  --anthrazit: #414141;
  --linie:     #e5e2da;
  --kante:     #c9c6bd;
  --flaeche:   #f2f2f0;
  --rot:       #dd3333;
  --rot-text:  #b4231f;
  --stumm:     #6b6861;
}

* { box-sizing: border-box }

body {
  margin: 0;
  background: #d8d5cc;
  font-family: Montserrat, system-ui, Arial, sans-serif;
  font-size: 11pt;
  line-height: 1.5;
  color: var(--anthrazit);
}

.mo { font-family: 'Archivo Narrow', Montserrat, Arial, sans-serif; font-variant-numeric: tabular-nums }

/* ------------------------------------------------------- Balken am Bildschirm */

.balken {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px; background: var(--anthrazit); color: #fff;
}
.balken a { color: #fff; text-decoration: none; font-size: 14px }
.balken a:hover { text-decoration: underline }
.balken button {
  min-height: 44px; padding: 0 22px;
  background: var(--rot); color: #fff; border: none; cursor: pointer;
  font: 700 14px Montserrat, Arial, sans-serif; letter-spacing: .02em;
}
.balken button:hover { background: #fff; color: var(--anthrazit) }
.balken button:focus-visible { outline: 3px solid #fff; outline-offset: 2px }

/* ------------------------------------------------------------------ Das Blatt */

.blatt {
  width: 210mm; min-height: 297mm;
  margin: 20px auto; padding: 16mm 16mm 14mm;
  background: #fff;
}

.kopf {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding-bottom: 10px; border-bottom: 3px solid var(--rot);
}
.kopf .logo { height: 15mm; width: auto }
.kopf-rechts { text-align: right }
.auge {
  display: block;
  font-family: 'Archivo Narrow', Montserrat, sans-serif;
  font-weight: 700; font-size: 9pt; letter-spacing: .18em; text-transform: uppercase;
  color: var(--stumm);
}
.kopf-rechts .nr { font-size: 12pt; font-weight: 700 }

h1 {
  font-family: 'Archivo Narrow', Montserrat, sans-serif;
  font-size: 22pt; line-height: 1.12; margin: 14px 0 2px;
}
.art { margin: 0 0 14px; font-size: 10pt; color: var(--stumm) }

/* Zustandsabzeichen über dem Titel – dieselben Farben wie auf der Karte. */
.abzeichen {
  display: inline-block; margin-bottom: 6px;
  padding: 2px 9px; font-size: 9pt; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: #fff;
}
.abzeichen-neu       { background: #2b772f }
.abzeichen-gebraucht { background: var(--anthrazit) }
.abzeichen-verkauft  { background: var(--stumm) }

h2 {
  font-family: 'Archivo Narrow', Montserrat, sans-serif;
  font-size: 13pt; margin: 16px 0 6px;
  padding-bottom: 4px; border-bottom: 1px solid var(--kante);
}

/* Bild und Kerndaten nebeneinander – das ist der Blick, den man zuerst braucht. */
.oben { display: grid; grid-template-columns: 95mm 1fr; gap: 8mm; align-items: start }

.hauptbild { margin: 0 }
.hauptbild img {
  width: 100%; height: 62mm; object-fit: contain;
  background: var(--flaeche); border: 1px solid var(--linie);
}

table { width: 100%; border-collapse: collapse }
.kerndaten th, .kerndaten td,
.technik th, .technik td {
  text-align: left; vertical-align: top;
  padding: 4px 0; border-bottom: 1px solid var(--linie);
  font-size: 10pt;
}
.kerndaten th, .technik th { width: 46%; font-weight: 500; color: var(--stumm) }
.kerndaten td, .technik td { font-weight: 600 }
.technik th { width: 58% }
.einheit { font-weight: 400; color: var(--stumm) }

.preisfeld {
  margin: 12px 0 0; padding: 10px 14px;
  background: var(--flaeche); border-left: 4px solid var(--rot);
}
.preis {
  display: block;
  font-family: 'Archivo Narrow', Montserrat, Arial, sans-serif;
  font-size: 18pt; font-weight: 700; line-height: 1.1;
}
.preis-zusatz { display: block; font-size: 9pt; color: var(--stumm); margin-top: 2px }

.beschreibung { font-size: 9.5pt; line-height: 1.6 }

/* Kontakt-Kasten: die Aufforderung zur Anfrage, hervorgehoben. */
.kontakt {
  margin: 16px 0 0; padding: 12px 16px;
  background: var(--flaeche); border-left: 4px solid var(--rot);
}
.kontakt-titel {
  display: block; margin-bottom: 8px;
  font-family: 'Archivo Narrow', Montserrat, sans-serif;
  font-size: 12pt; color: var(--rot-text);
}
.kontakt-spalten {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6mm;
  font-size: 9.5pt; line-height: 1.5;
}
.kontakt-spalten strong { color: var(--anthrazit) }

.fuss {
  display: flex; justify-content: space-between; gap: 16px; align-items: flex-end;
  margin-top: 16px; padding-top: 8px; border-top: 1px solid var(--kante);
  font-size: 8.5pt; line-height: 1.45; color: var(--stumm);
}
.fuss strong { display: block; color: var(--anthrazit) }
.stand { text-align: right; white-space: nowrap }
.seitenzahl { font-weight: 700; color: var(--anthrazit) }
.klein { font-size: 8pt }

/* --------------------------------------------------------- Zweites Blatt */

.blatt-zwei { min-height: auto }
/* Drei Spalten mit kompakten Kacheln, damit auch viele Fotos auf das Blatt
   passen. Das Raster fließt bei Bedarf auf weitere Seiten um; eine einzelne
   Kachel wird dabei nie zerrissen. */
.bildraster { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4mm; margin-top: 8px }
.bildraster figure { margin: 0; break-inside: avoid; page-break-inside: avoid }
.bildraster img {
  width: 100%; height: 42mm; object-fit: contain;
  background: var(--flaeche); border: 1px solid var(--linie);
}

/* ============================================================== Für Papier */

@page { size: A4; margin: 12mm }

@media print {
  body { background: #fff }

  /* Der Balken ist Bedienung, kein Inhalt. */
  .balken { display: none }

  .blatt {
    width: auto; min-height: auto;
    margin: 0; padding: 0;
    /* Jedes Blatt beginnt auf einer neuen Seite – sonst rutschten die Bilder
       mitten in die technischen Daten. */
    break-after: page; page-break-after: always;
  }
  .blatt:last-of-type { break-after: auto; page-break-after: auto }

  /* Tabellen nicht mitten in einer Zeile umbrechen. */
  tr, figure { break-inside: avoid; page-break-inside: avoid }
  h1, h2 { break-after: avoid; page-break-after: avoid }

  /* Hintergrundflächen gehören zur Aussage – Preisfeld und Bildrahmen sollen
     auch auf Papier erkennbar bleiben. */
  .preisfeld, .hauptbild img, .bildraster img {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}

/* ------------------------------------------------------- Schmale Schirme */

/* „screen" ist hier Pflicht. Ohne das gilt die Regel auch für Papier: Ein
   A4-Blatt ist 210 mm breit, also schmaler als 230 mm – Bild und Kerndaten
   rutschten im Druck untereinander, obwohl daneben Platz war. */
@media screen and (max-width: 230mm) {
  .blatt { width: auto; margin: 12px; padding: 16px }
  .oben { grid-template-columns: 1fr; gap: 14px }
  .hauptbild img { height: auto; max-height: 50vh }
  .fuss { flex-direction: column; gap: 10px }
  .stand { text-align: left; white-space: normal }
  .bildraster { grid-template-columns: 1fr }
  .bildraster img { height: auto }
}
