/* ============================================================
   Lebenslauf & Anschreiben — gleiche Designsprache wie das
   Portfolio (schwarz, 20px-Radien, Karten), aber als A4-Seite.
   Umschaltbar auf ein helles Druck-Thema über den Button.
   ============================================================ */

:root {
  --bg:       #0a0a0a;
  --page:     #111111;
  --card:     #1a1a1a;
  --line:     rgba(255,255,255,0.11);
  --text:     #ffffff;
  --muted:    rgba(255,255,255,0.58);
  --muted-2:  rgba(255,255,255,0.40);
  --accent:   #e8512e;
  --radius:   14px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

html[data-theme="light"] {
  --bg:      #e9e9ec;
  --page:    #ffffff;
  --card:    #f4f4f6;
  --line:    rgba(0,0,0,0.12);
  --text:    #141416;
  --muted:   rgba(0,0,0,0.62);
  --muted-2: rgba(0,0,0,0.45);
  --accent:  #d4421d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 24px 16px 80px;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- A4-Seite ---------------------------------------- */

.page {
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto 24px;
  padding: 13mm 14mm 10mm;
  background: var(--page);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
  position: relative;
  overflow: hidden;
}

/* ---------- Kopf -------------------------------------------- */

.head { display: flex; align-items: center; gap: 14px; margin-bottom: 6mm; }
.head img { width: 62px; height: 62px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.head .role { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.head .right { margin-left: auto; text-align: right; font-size: 11px; color: var(--muted); line-height: 1.7; }
.head .right a { color: inherit; text-decoration: none; }

.rule { height: 1px; background: var(--line); margin: 0 0 7mm; }

/* ---------- Spalten ----------------------------------------- */

.cols { display: grid; grid-template-columns: 56mm 1fr; gap: 9mm; align-items: start; }

/* ---------- Blöcke ------------------------------------------ */

.block { margin-bottom: 4.8mm; break-inside: avoid; }
.block > h2 {
  font-size: 10px; font-weight: 700; letter-spacing: .10em;
  text-transform: uppercase; color: var(--accent);
  margin: 0 0 3.5mm;
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 4.5mm 5mm;
}

/* ---------- Zeitstrahl -------------------------------------- */

.item { position: relative; padding-left: 7mm; padding-bottom: 3.7mm; break-inside: avoid; }
.item:last-child { padding-bottom: 0; }
.item::before {
  content: ""; position: absolute; left: 0; top: 4px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.item::after {
  content: ""; position: absolute; left: 3px; top: 15px; bottom: 0;
  width: 1px; background: var(--line);
}
.item:last-child::after { display: none; }
.item h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -.01em; }
.item .meta { font-size: 11px; color: var(--muted-2); margin: 1px 0 3px; }
.item ul { margin: 4px 0 0; padding-left: 15px; }
.item li { font-size: 10.8px; color: var(--muted); margin-bottom: 0; line-height: 1.38; }
.item p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.45; }

/* ---------- Kleinteile -------------------------------------- */

.kv { font-size: 11px; line-height: 1.68; }
.kv div { display: flex; gap: 6px; }
.kv span:first-child { color: var(--muted-2); min-width: 20mm; flex: 0 0 auto; }
.kv a { color: inherit; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tags span {
  font-size: 10.5px; padding: 4px 9px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
}
html[data-theme="light"] .tags span { background: #fff; }

.bar { margin-bottom: 4.5px; }
.bar b { font-size: 11.5px; font-weight: 500; display: block; margin-bottom: 4px; }
.bar i { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar i em { display: block; height: 100%; background: var(--accent); }

.lead { font-size: 11.4px; line-height: 1.55; color: var(--muted); margin: 0; }
.lead strong { color: var(--text); font-weight: 600; }

/* ---------- Anschreiben ------------------------------------- */

.letter { font-size: 11.3px; line-height: 1.52; }
.letter .sender { font-size: 10.5px; color: var(--muted-2); margin-bottom: 12mm; }
.letter .to { margin-bottom: 5.5mm; line-height: 1.55; }
.letter .to b { font-weight: 600; }
.letter .date { text-align: right; font-size: 10.5px; color: var(--muted); margin-bottom: 5mm; }
.letter .subject { font-size: 13.5px; font-weight: 700; margin-bottom: 5.5mm; letter-spacing: -.01em; }
.letter .subject small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 3px; letter-spacing: 0; }
.letter p { margin: 0 0 3.3mm; color: var(--muted); }
.letter p.hi, .letter p.bye { color: var(--text); }
.letter strong { color: var(--text); font-weight: 600; }
.letter .sign { margin-top: 4.5mm; font-size: 12.5px; font-weight: 600; }
.letter a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.letter .ps {
  margin-top: 5mm; padding: 3.5mm 4.5mm; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}

/* ---------- Platzhalter ------------------------------------- */

[data-ph] { position: relative; }
body.show-ph [data-ph] {
  outline: 1px dashed var(--accent); outline-offset: 2px; border-radius: 3px;
}

/* ---------- Werkzeugleiste ---------------------------------- */

.tools {
  position: fixed; right: 18px; bottom: 18px; z-index: 99;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
}
.tools button, .tools a {
  font: inherit; font-size: 12px; font-weight: 500;
  padding: 9px 14px; border-radius: 999px; cursor: pointer;
  background: rgba(20,20,20,.86); color: #fff;
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(14px); text-decoration: none;
}
html[data-theme="light"] .tools button, html[data-theme="light"] .tools a {
  background: rgba(255,255,255,.92); color: #141416; border-color: rgba(0,0,0,.14);
}
.tools button:hover, .tools a:hover { filter: brightness(1.25); }

/* ---------- Druck ------------------------------------------- */

@page { size: A4; margin: 13mm 14mm; }

@media print {
  html, body { background: var(--page); }
  body { padding: 0; }
  .tools, .ph-toggle { display: none !important; }
  /* Die Seite wird im Druck zum normalen Fluss-Container:
     @page setzt die Ränder, lange Inhalte brechen sauber um. */
  .page {
    width: auto; min-height: 0; margin: 0; padding: 0;
    border-radius: 0; box-shadow: none; overflow: visible;
  }
  .head, .block, .item, .card, .letter .ps { break-inside: avoid; }
  .block > h2 { break-after: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 820px) {
  .page { width: 100%; min-height: 0; padding: 20px; }
  .cols { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- Schließen (zurück zum Portfolio) ---------------- */

.schliessen {
  position: fixed; top: 20px; right: 20px; z-index: 120;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); text-decoration: none;
  transition: background .2s, transform .2s;
}
.schliessen svg { width: 16px; height: 16px; }
.schliessen:hover { background: var(--fill, rgba(255,255,255,.14)); transform: rotate(90deg); }
html[data-theme="light"] .schliessen:hover { background: rgba(0,0,0,.08); }

@media print { .schliessen { display: none !important; } }

/* ---------- Druck: Anschreiben lesbar auf Papier ------------
   Am Bildschirm bleibt das Design wie entworfen. Im Druck wird
   der Fliesstext etwas groesser und deutlich dunkler, weil
   62 % Schwarz auf Papier grau und muede wirkt. */
@media print {
  /* Beim Drucken ist die Seitenbreite kleiner als 820px, deshalb
     greift sonst die Handy-Regel und wirft die zwei Spalten des
     Lebenslaufs untereinander. Hier wieder geradegerueckt. */
  .page { width: auto; min-height: 0; padding: 0; }
  .cols { grid-template-columns: 56mm 1fr; gap: 9mm; }

  /* Graustufen auf Papier etwas kraeftiger. */
  html[data-theme="light"] {
    --muted:   rgba(0,0,0,0.78);
    --muted-2: rgba(0,0,0,0.60);
  }

  .letter { font-size: 12px; line-height: 1.57; }
  .letter p { color: #141416; }
  .letter .date,
  .letter .subject small,
  .letter .ps { color: #3f3f44; }
}
