/* =====================================================================
   Platzfinder – Druck-Stylesheet (für die "Anrufliste drucken"-Funktion)

   Dieses Stylesheet wird NUR beim Drucken (oder "Als PDF speichern") aktiv,
   weil es mit  media="print"  eingebunden ist.

   Grundidee seit 07/2026: Die breite Bildschirm-Tabelle wird beim Drucken
   KOMPLETT ausgeblendet (.nur-bildschirm). Stattdessen erscheint die
   Druck-Liste (.druck-liste aus _ergebnisse.html): ein gut lesbarer Block
   je Einrichtung über die volle Blattbreite – mit allen Angaben,
   Ankreuzfeldern und Linien für handschriftliche Notizen. Das funktioniert
   in Hoch- UND Querformat, egal welchen Drucker-Dialog man benutzt.
   ===================================================================== */

@media print {
  @page { margin: 14mm; }

  /* Bildschirm-Deko ausblenden: Kopfzeile, Navigation, Buttons, Formulare
     – und die breite Ergebnis-Tabelle selbst (.nur-bildschirm).
     Auf Papier soll NUR die Anrufliste erscheinen. */
  header.kopf,
  nav.hauptnav,
  .btn,
  .btn-reihe,
  .aktion-links,
  .meldung,
  form,
  .hinweis-box,
  .datenschutz-hinweis,
  .leer-hinweis,
  .verlauf-spalte,
  .live-box,
  .fortschritt,
  .warn-box,
  .ausgeblendet-zeile,
  .nur-bildschirm {
    display: none !important;
  }

  /* Alles auf Weiß, schwarze Schrift, keine Schatten – spart Toner */
  body { background: #fff; color: #000; font-size: 11pt; }
  main { max-width: none; margin: 0; padding: 0; }
  .karte { box-shadow: none; border: none; padding: 0; margin: 0 0 .5rem; }

  /* Druck-Kopfzeile (welche Suche, von wann) sichtbar machen */
  p.druck-kopf {
    display: block !important;
    font-size: 10pt;
    color: #333;
    border-bottom: 1px solid #000;
    padding-bottom: .3rem;
    margin-bottom: .5rem;
    white-space: normal;
  }

  /* Links: schwarz statt blau (Toner, Lesbarkeit) */
  a { color: #000 !important; text-decoration: none; }

  /* ------------------------------------------------------------------
     Die Druck-Liste: ein Block je Einrichtung.
     ------------------------------------------------------------------ */
  .druck-liste {
    display: block !important;
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: treffer;
  }
  .druck-liste li {
    counter-increment: treffer;
    padding: 7pt 0 9pt;
    border-bottom: 1px solid #888;
    break-inside: avoid;          /* Block nie über den Seitenumbruch reißen */
  }

  /* Kopfzeile des Blocks: Nr. | Score | Name | Entfernung (rechts) */
  .druck-kopfzeile {
    display: flex;
    align-items: baseline;
    gap: 7pt;
  }
  .druck-kopfzeile::before {
    content: counter(treffer) ".";
    font-weight: 700;
    font-size: 12pt;
    min-width: 14pt;
  }
  .druck-score {
    border: 1.2pt solid #000;
    border-radius: 10pt;
    padding: 0.5pt 6pt;
    font-weight: 700;
    white-space: nowrap;
  }
  .druck-name { font-weight: 700; font-size: 12pt; flex: 1; }
  .druck-entfernung { font-weight: 700; white-space: nowrap; }

  /* Angaben-Zeilen darunter, leicht eingerückt (unter der Nummer heraus) */
  .druck-zeile {
    margin: 2pt 0 0 21pt;
    font-size: 10pt;
    overflow-wrap: break-word;    /* lange Web-Adressen brechen um */
  }
  .druck-leise { color: #444; font-size: 9pt; }

  /* Ankreuzfelder + Notiz-Linien zum handschriftlichen Ausfüllen */
  .druck-abhaken {
    display: flex;
    align-items: flex-end;
    margin: 7pt 0 0 21pt;
    font-size: 10.5pt;
  }
  .druck-abhaken span:first-child { white-space: nowrap; }
  .druck-notizlinie {
    flex: 1;
    margin-left: 6pt;
    border-bottom: 1pt dotted #777;
    min-height: 1.1em;
  }
  .druck-notizlinie.voll {        /* zweite, volle Notiz-Zeile darunter */
    display: block;
    flex: none;
    margin: 13pt 0 0 21pt;
  }

  /* ------------------------------------------------------------------
     Übrige Tabellen (z. B. Ansprechstellen Bereitschaftspflege):
     schlichte schwarze Linien, kein Zeilen-Zerreißen am Seitenumbruch.
     ------------------------------------------------------------------ */
  .tabelle-umrandung { overflow: visible !important; }
  table { border-collapse: collapse; }
  thead th { background: #fff; border-bottom: 1px solid #000; }
  tbody td { border-bottom: 1px solid #999; }
  tbody tr { break-inside: avoid; }
  .badge { border: 1px solid #666; background: #fff !important; color: #000 !important; white-space: normal; }
  tr.geflaggt { opacity: 1; }
}
