/* Notfallkarte im Schadenwissen, Baustein notfallkarte, Skript assets/js/notfallkarte.js.
   Baut auf main.css auf (Farben, Schrift, .werkzeug, .knopf). Die Karte ist auf A4 hoch gezeichnet
   (794 x 1122 px bei 96 dpi). Die Vorschau verkleinert sie mit zoom, den Wert setzt das Skript nach
   der Breite der Spalte, die Werte hier gelten ohne Skript. */

/* Nur auf Seiten mit der Notfallkarte: die Antwort in Kuerze als schlichter Absatz ohne Kasten,
   Balken und Titelzeile, damit das Werkzeug gleich unter der Ueberschrift beginnt. */
body:has([data-werkzeug="notfallkarte"]) .antwortkasten { background: none; border-left: 0; padding: 0; margin: 0.75rem 0 1rem; font-size: 0.9375rem; color: #4A4A4A; }
body:has([data-werkzeug="notfallkarte"]) .antwortkasten-titel { display: none; }

.nk-wahl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.nk-wahl li + li { margin-top: 0 !important; }
.nk-wahl label { height: 100%; }
.nk-wahl small { display: block; font-size: 0.8125rem; color: #6B6B6B; }

.nk-formular { display: none; }
.nk-aktiv .nk-formular { display: block; }
.nk-eingabe { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.25rem; margin: 0 0 1rem; }
.nk-eingabe label { display: block; font-size: 0.9375rem; font-weight: 600; color: var(--fastschwarz); }
.nk-eingabe input {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.6rem 0.75rem;
  border: 1px solid #B5B5B5; border-radius: 4px; font: inherit; font-weight: 400; color: var(--text); background: var(--weiss);
}
.nk-eingabe input:focus-visible { outline: 3px solid var(--blau); outline-offset: 0; }
.nk-gruppe { font-weight: 600; color: var(--fastschwarz); margin: 1.25rem 0 0.5rem !important; }
.nk-foto-wahl { position: relative; align-self: end; }
.nk-foto-wahl .knopf { display: block; width: 100%; text-align: center; }
.nk-foto-wahl input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.nk-foto-wahl input:focus-visible + label { outline: 3px solid var(--blau); outline-offset: 2px; }

.nk-vorschau-titel { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--blau); margin: 1.75rem 0 0.5rem !important; }
.nk-vorschau { border: 1px solid var(--linie); background: var(--flaeche-mittel); padding: 1rem; overflow: hidden; }
.nk-vorschau .nk-karte { zoom: 0.8; margin: 0 auto; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14); }
.nk-vorschau .nk-karte + .nk-karte { margin-top: 1rem; }
.nk-karte[hidden] { display: none !important; }

/* Die Karte */
.nk-karte {
  --nk-feld: 41px; --nk-luft: 16px;
  width: 794px; height: 1122px; overflow: hidden; background: #fff; color: #262626;
  border-top: 10px solid var(--rot); padding: 34px 46px 30px;
  display: flex; flex-direction: column; font-size: 16px; line-height: 1.35; text-align: left;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.nk-karte p { margin: 0; }
.nk-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--blau); }
.nk-karte .nk-kopf-titel { font-size: 46px; font-weight: 600; line-height: 1.05; color: var(--blau); }
.nk-karte .nk-kopf-zeile { font-size: 19px; font-weight: 600; margin-top: 6px; }
.nk-kopf img { width: 150px; height: auto; flex: none; }

.nk-karte .nk-warnung { margin-top: 14px; padding: 10px 14px; background: #FDECEC; border-left: 6px solid var(--rot); font-size: 17px; font-weight: 600; }

.nk-schritt { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 0 18px; padding: var(--nk-luft) 0; border-bottom: 1px solid #CFCFCF; }
.nk-schritt.ohne-linie { border-bottom: 0; }
.nk-nr { width: 58px; height: 58px; background: var(--blau); color: #fff; font-size: 34px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.nk-karte .nk-schritt-titel { font-size: 25px; font-weight: 600; line-height: 1.15; }
.nk-karte .nk-schritt-text { font-size: 15.5px; margin-top: 4px; }
.nk-mit-foto { display: grid; grid-template-columns: minmax(0, 1fr) 196px; gap: 18px; }
.nk-foto { width: 196px; height: 147px; border: 2px dashed #9A9A9A; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; color: #6B6B6B; padding: 10px; }
.nk-foto.hat-bild { border: 0; padding: 0; }
.nk-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }

.nk-felder { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.nk-feld { margin-top: 10px; }
.nk-feld.breit { grid-column: 1 / -1; }
/* Nicht .kopf nennen: die Klasse gehoert der Kopfleiste der Website (main.css). */
.nk-feld.nk-kopffeld { width: 440px; }
.nk-feld-name { display: block; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #5A5A5A; }
.nk-feld-wert { display: block; min-height: var(--nk-feld); border-bottom: 1.5px solid #262626; font-size: 19px; line-height: calc(var(--nk-feld) - 2px); color: var(--dunkelblau); white-space: nowrap; overflow: hidden; }

.nk-notruf { margin-top: 16px; background: var(--rot); color: #fff; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 0 18px; align-items: center; padding: 14px 20px 14px 0; }
.nk-notruf .nk-nr { background: transparent; }
.nk-karte .nk-notruf-titel { font-size: 25px; font-weight: 600; line-height: 1.15; }
.nk-karte .nk-notruf-text { font-size: 15.5px; margin-top: 3px; }
.nk-notruf-nummer { font-size: 40px; font-weight: 600; white-space: nowrap; line-height: 1; text-align: right; }
.nk-notruf-nummer small { display: block; font-size: 14px; font-weight: 400; margin-top: 6px; }

.nk-zwei { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin-top: 16px; }
.nk-karte .nk-block-titel { font-size: 17px; font-weight: 600; color: var(--blau); }
.nk-zwei .nk-felder { grid-template-columns: minmax(0, 1fr); }

.nk-fuss { margin-top: auto; padding-top: 12px; border-top: 2px solid var(--blau); display: flex; justify-content: space-between; gap: 20px; font-size: 14.5px; }
.nk-fuss strong { font-weight: 600; }

/* Aushang im Treppenhaus: zweisprachig wie die Gaestekarte, mit mehr Luft, weil er weniger Felder hat. */
.nk-treppenhaus { --nk-feld: 34px; --nk-luft: 10px; }
.nk-treppenhaus .nk-schritt-titel { font-size: 20px; }
.nk-treppenhaus .nk-feld { margin-top: 8px; }
.nk-gaeste { --nk-feld: 34px; }
.nk-gaeste .nk-schritt-titel { font-size: 22px; }

/* Gaestekarte: Deutsch links, Englisch rechts */
.nk-sprachen { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; }
.nk-sprachen > div + div { border-left: 1px solid #CFCFCF; padding-left: 22px; }
.nk-karte .nk-kopf-titel.klein { font-size: 34px; }
.nk-kopf-titel.klein span { display: block; color: #262626; font-size: 24px; margin-top: 4px; }

@media (max-width: 700px) {
  .nk-wahl, .nk-eingabe { grid-template-columns: minmax(0, 1fr); }
  .nk-vorschau { padding: 0.5rem; }
  .nk-vorschau .nk-karte { zoom: 0.36; }
}

/* Das Kartenfeld zur Eingabe, in der gerade getippt wird. */
.nk-vorschau .nk-feld.nk-jetzt .nk-feld-wert { background: #FFF1B8; box-shadow: 0 0 0 4px #FFF1B8; }

/* Ab 1000 px stehen Formular und Karte nebeneinander. Die Karte bleibt beim Rollen stehen, das
   Skript verkleinert sie so, dass sie ganz ins Fenster passt (einpassen). */
@media (min-width: 1000px) {
  .nk-aktiv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 1.5rem; align-items: start; }
  .nk-aktiv > * { grid-column: 1 / -1; }
  .nk-aktiv > .nk-formular { grid-column: 1; }
  .nk-aktiv > .nk-vorschau { grid-column: 2; position: sticky; top: 5.75rem; padding: 0.75rem; }
  .nk-aktiv .nk-vorschau-titel { display: none; }
  /* Der Hinweis zur 112 steht links unter dem Formular neben der Karte, nicht erst unter ihr. Die
     Karte reicht ueber beide Zeilen, die letzte Zeile nimmt die uebrige Hoehe auf. */
  .nk-aktiv { grid-template-rows: auto auto auto 1fr; }
  .nk-aktiv > .nk-vorschau { grid-row: span 2; }
  .nk-aktiv > .werkzeug-fuss { grid-column: 1; }
}
/* Die beiden kleinen Zeilen unter den Knoepfen: klein und dicht untereinander. */
[data-werkzeug="notfallkarte"] .werkzeug-klein { font-size: 0.8125rem; line-height: 1.45; margin: 0.6rem 0 0 !important; }
[data-werkzeug="notfallkarte"] .werkzeug-fuss { margin-top: 0.2rem !important; }
@media (max-width: 999px) {
  [data-werkzeug="notfallkarte"] .werkzeug-fuss { margin-top: 0.75rem !important; }
}
/* Schmale Fenster: neben der Karte reicht der Platz nur fuer eine Spalte im Formular. */
@media (min-width: 1000px) and (max-width: 1199px) {
  .nk-aktiv .nk-wahl, .nk-aktiv .nk-eingabe { grid-template-columns: minmax(0, 1fr); }
}

/* Druck: das Skript legt die Karte in #nk-druck direkt unter body und setzt die Klasse nk-druckt.
   Ohne die Klasse druckt die Seite wie jede andere. */
#nk-druck { display: none; }
@media print {
  html.nk-druckt body > *:not(#nk-druck) { display: none !important; }
  html.nk-druckt body { margin: 0; padding: 0; background: #fff; }
  html.nk-druckt #nk-druck { display: block; }
  html.nk-druckt #nk-druck .nk-karte { zoom: 1; margin: 0; box-shadow: none; break-inside: avoid; }
}
@page nk { size: A4 portrait; margin: 0; }
#nk-druck { page: nk; }
