/* ==========================================================================
   Lebenslauf – Layout & Farben
   Bildschirm: zwei A4-Bögen untereinander (skaliert auf die Fensterbreite)
   Smartphone: einspaltig, fließend
   Druck/PDF:  exakt zwei A4-Seiten, Kopf hell
   ========================================================================== */

/* --- Schriften (lokal eingebunden, keine Anfrage an Google) --------------- */
@font-face {
  font-family: "Geom";
  src: url("fonts/geom-latin-var.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens ---------------------------------------------------------------- */
:root {
  --cv-ink: #34190F;         /* Text & dunkler Kopf         (16,4:1 auf Weiß) */
  --cv-muted: #6B5446;       /* gedämpfter Text             (7,0:1 auf Weiß, 6,0:1 auf Fläche) */
  --cv-accent: #96441F;      /* Überschriften, Icons        (6,7:1 auf Weiß) */
  --cv-surface: #F3EDE8;     /* Tags, Zitate, Portfolio-Button */
  --cv-backdrop: #F4EEE9;    /* Fläche hinter den Bögen */
  --cv-paper: #FFFFFF;
  --cv-rule: #E6DCD4;        /* Trennlinien auf Weiß */
  --cv-btn: #7A4A22;         /* „Als PDF speichern“          (7,4:1 mit Weiß) */

  /* dunkler Kopf (Bildschirm) */
  --cv-hd-bg: var(--cv-ink);
  --cv-hd-name: #FFFFFF;
  --cv-hd-text: #DCCFC5;     /* Kurzprofil & Kennzahlen     (10,7:1 auf #34190F) */
  --cv-hd-strong: #FFFFFF;
  --cv-hd-role: #E39A55;     /* „Senior Product Designer“   (7,0:1 auf #34190F) */
  --cv-hd-rule: #5C4136;
  --cv-hd-btn-bg: var(--cv-surface);
  --cv-hd-btn-border: var(--cv-surface);
  --cv-hd-btn-text: var(--cv-ink);

  --cv-font-display: "Geom", "Outfit", "Century Gothic", sans-serif;
  --cv-font: "Outfit", "Century Gothic", "Avenir Next", sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cv-backdrop);
  color: var(--cv-ink);
  font-family: var(--cv-font);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

:focus-visible { outline: 2px solid var(--cv-accent); outline-offset: 2px; }

/* --- Leiste: Sprache & PDF ------------------------------------------------- */
.cv-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: calc(794px * var(--cv-zoom, 1));
  max-width: 100%;
  margin: 0 auto;
  padding: 26px 0 0;
}
.cv-lang { display: flex; align-items: center; gap: 2px; }
.cv-lang-sep { color: var(--cv-muted); font: 500 15px/1 var(--cv-font); padding: 0 4px; }
.cv-lang button {
  min-width: 40px;
  min-height: 40px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--cv-muted);
  font: 700 15px/1 var(--cv-font);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.cv-lang button span { display: inline-block; padding: 4px 0 3px; border-bottom: 2px solid transparent; }
.cv-lang button:hover { color: var(--cv-ink); }
.cv-lang button[aria-pressed="true"] { color: var(--cv-ink); }
.cv-lang button[aria-pressed="true"] span { border-bottom-color: currentColor; }
.cv-pdf {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 24px 0 22px;
  background: var(--cv-btn);
  border-radius: 999px;
  color: #FFFFFF;
  font: 700 15px/1 var(--cv-font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.cv-pdf:hover { background: var(--cv-ink); }
.cv-pdf svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cv-noscript { max-width: 560px; margin: 40px auto; padding: 0 16px; font-size: 16px; line-height: 1.5; }

/* --- Bögen ----------------------------------------------------------------- */
.cv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 22px 16px 56px;
}
/* Vier Textstufen: Abschnittstitel (.sec-title) · Rollentitel (.item-title,
   18 px; Weiterbildung 15 px) · Firma (.item-org, 13 px halbfett, Zusatz grau)
   · Fließtext (12,75 px, Zeilenhöhe 1,45). */
.sheet {
  width: 794px;
  height: 1123px;
  flex: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 22px;
  background: var(--cv-paper);
  box-shadow: 0 0 0 1px var(--cv-rule);
  font-size: 12.75px;
  line-height: 18.5px;
  font-weight: 400;
  zoom: var(--cv-zoom, 1);
}
/* Reset ohne Spezifität (:where), damit die Abstandsregeln unten immer gewinnen */
:where(.sheet) :where(h1, h2, h3, p, ul, dl, dd, blockquote) { margin: 0; }
:where(.sheet) :where(ul) { padding: 0; list-style: none; }
:where(.sheet) :where(a) { color: inherit; }

/* --- Kopf Seite 1 (dunkel, inkl. Kennzahlen; max. 300 px) ------------------ */
.hd {
  flex: none;
  padding: 32px;
  background: var(--cv-hd-bg);
  border-radius: 14px;
  color: var(--cv-hd-text);
}
.hd-top { display: flex; align-items: flex-start; gap: 24px; }   /* Foto oben bündig mit der Eyebrow */
.hd-photo { width: 102px; height: 126px; flex: none; object-fit: cover; border-radius: 8px; }   /* Hochformat wie der Zuschnitt, so hoch wie der Textblock */
.hd-main { flex: 1; min-width: 0; }
.hd-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.role { font-size: 12px; line-height: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cv-hd-role); }
.name { margin-top: 6px; font-family: var(--cv-font-display); font-size: 32px; line-height: 36px; font-weight: 800; letter-spacing: -0.005em; color: var(--cv-hd-name); }
.summary { max-width: 60ch; margin-top: 14px; }
.summary strong { display: block; font-weight: 700; color: var(--cv-hd-strong); }
.sheet a.btn-portfolio {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 13px 0 15px;
  background: var(--cv-hd-btn-bg);
  border: 1px solid var(--cv-hd-btn-border);
  border-radius: 999px;
  color: var(--cv-hd-btn-text);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.btn-portfolio svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.stats { display: grid; grid-template-columns: repeat(4, max-content); justify-content: space-between; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--cv-hd-rule); }
.stat { padding: 0 10px 0 14px; border-left: 1px solid var(--cv-hd-rule); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat-title { font-family: var(--cv-font-display); font-size: 16px; line-height: 21px; font-weight: 800; white-space: nowrap; color: var(--cv-hd-strong); }
.stat-text { margin-top: 1px; font-size: 11.5px; line-height: 15px; }
.stat-text .ln { display: block; }

/* --- Kopf Seite 2 (schmal) ------------------------------------------------- */
.hd2 { flex: none; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 2px 0 11px; border-bottom: 1px solid var(--cv-rule); }
.hd2-name { font-family: var(--cv-font-display); font-size: 20px; line-height: 26px; font-weight: 800; }
.hd2-role { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cv-accent); }

/* --- Spalten ----------------------------------------------------------------
   Die Spaltenzeile ist nur so hoch wie die längere Spalte: die senkrechte
   Linie (linker Rand der Hauptspalte) endet mit dem Inhalt. */
.cols { flex: none; display: flex; margin-top: 20px; }
.col-side { width: 250px; flex: none; padding-right: 16px; display: flex; flex-direction: column; gap: 28px; }
.col-main { flex: 1; min-width: 0; padding-left: 18px; border-left: 1px solid var(--cv-rule); display: flex; flex-direction: column; }
.sec { display: flex; flex-direction: column; }

.sec-title { margin-bottom: 14px; font-size: 11.5px; line-height: 15px; font-weight: 700; letter-spacing: 0.085em; text-transform: uppercase; color: var(--cv-accent); }
.col-side .sec-title { margin-bottom: 10px; }   /* linke Spalte etwas dichter; Hauptspalte 14 px */
.item-title { font-family: var(--cv-font-display); font-size: 18px; line-height: 23px; font-weight: 800; }
.job--minor .item-title { font-size: 15px; line-height: 20px; }
.item-org { margin-top: 4px; font-size: 13px; line-height: 18px; }
.org-name { font-weight: 600; }
.org-note { color: var(--cv-muted); }
.row-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.item-date { flex: none; color: var(--cv-muted); }

/* --- Seitenspalte ---------------------------------------------------------- */
.contact-list { display: flex; flex-direction: column; gap: 8px; line-height: 18.5px; }
.contact-list li { display: flex; align-items: flex-start; gap: 9px; }
.contact-list svg { width: 14px; height: 14px; flex: none; margin-top: 2px; fill: none; stroke: var(--cv-accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.contact-address span { white-space: pre-line; }   /* volle Anschrift (privat) darf zweizeilig sein */
.contact-list a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.contact-list a:hover { color: var(--cv-accent); }

.skill-groups { display: flex; flex-direction: column; gap: 14px; }
.skill-group { display: flex; flex-direction: column; }
.sub-title { margin-bottom: 4px; font-size: 13px; line-height: 18px; font-weight: 600; }
.terms { color: var(--cv-muted); }
.term { white-space: nowrap; }
.nobr { white-space: nowrap; }

.lang-list { display: flex; flex-direction: column; }
.lang-list div { display: flex; justify-content: space-between; gap: 12px; }
.lang-list dd { color: var(--cv-muted); }

/* --- Berufserfahrung ------------------------------------------------------- */
.job { display: flex; flex-direction: column; }
.job-desc { margin-top: 8px; color: var(--cv-muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 12px; line-height: 15px; font-weight: 600; }
.tags li { display: flex; align-items: center; height: 25px; padding: 0 11px; background: var(--cv-surface); border-radius: 999px; white-space: nowrap; }
.bullets { margin-top: 8px; padding-left: 16px; }
.bullets li { position: relative; }
.bullets li + li { margin-top: 7px; }
.tags + .bullets { margin-top: 14px; }
.bullets li::before { content: "•"; position: absolute; left: -15px; color: var(--cv-accent); }
.quote { margin-top: 12px; padding: 8px 12px 9px; background: var(--cv-surface); border-radius: 8px; }
.quote + .bullets { margin-top: 12px; }
.quote p { font-weight: 700; }
.vol .quote p { font-weight: 400; }   /* fett nur das Kundenzitat auf Seite 1 */
.quote footer { color: var(--cv-muted); }
.rule { flex: none; height: 1px; background: var(--cv-rule); }
.rule--job { margin: 16px 0; }   /* zwischen Stationen 32 px, Linie in der Mitte */
.col-main > .sec + .sec { margin-top: 32px; }   /* Abschnitte auf Seite 2: Luft statt Linie */

/* --- Seite 2 --------------------------------------------------------------- */
.edu-item + .edu-item { margin-top: 14px; }
.edu-title { margin-bottom: 4px; font-size: 13px; line-height: 18px; font-weight: 600; }
.edu-school, .edu-date { color: var(--cv-muted); }

.cert-group { margin-top: 14px; font-size: 13px; line-height: 18px; font-weight: 600; }
.sec-title + .cert-group { margin-top: 0; }
.rows { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.rows li { display: flex; justify-content: space-between; gap: 12px; }

/* --- Fußzeile der Bögen ---------------------------------------------------- */
.sheet-footer { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--cv-rule); font-size: 10.5px; line-height: 13px; font-weight: 600; color: var(--cv-muted); }
.sheet-footer span:nth-child(2) { text-align: center; }
.sheet-footer span:last-child { text-align: right; }

/* ==========================================================================
   Smartphone: eine Spalte, fließend (gilt nur am Bildschirm, nie im Druck)
   ========================================================================== */
@media screen and (max-width: 719px) {
  .cv-toolbar { width: auto; padding: 14px 16px 0; }
  .cv-pdf { padding: 0 18px 0 16px; font-size: 14px; }
  .cv { gap: 0; padding: 14px 0 40px; }
  .sheet { width: 100%; max-width: 560px; height: auto; overflow: visible; padding: 16px 16px 8px; box-shadow: none; zoom: 1.1; }
  .sheet-2 { padding-top: 8px; padding-bottom: 24px; }

  .hd { padding: 16px; }
  .hd-top { flex-direction: column; gap: 14px; }
  .hd-photo { width: 120px; height: 148px; }
  .hd-row { flex-direction: column; gap: 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 0; }
  .stat:nth-child(odd) { padding-left: 0; border-left: 0; }
  .stat-text .ln { display: inline; }

  .cols { flex-direction: column; gap: 24px; }
  .col-side { display: contents; }
  .col-main { padding-left: 0; border-left: 0; }
  .hd2, .sheet-footer { display: none; }
  .sheet-2 .cols { margin-top: 0; }

  /* Reihenfolge: Kontakt → Erfahrung → Skills; Seite 2: Weitere Erfahrung, Zertifikate → Ausbildung, Sprachen, Interessen */
  .sheet-1 .sec-contact { order: 0; }
  .sheet-1 .col-main { order: 1; }
  .sheet-1 .sec-skills { order: 2; }
  .sheet-2 .col-main { order: 0; }
  .sheet-2 .col-side > .sec { order: 1; }

  .row-title { flex-wrap: wrap; gap: 0 12px; }
  .tags li { white-space: normal; height: auto; min-height: 25px; padding-top: 3px; padding-bottom: 3px; }
}

/* ==========================================================================
   Druck / „Als PDF speichern“: exakt zwei A4-Seiten, Kopf hell
   ========================================================================== */
@page { size: A4; margin: 0; }

@media print {
  /* Heller Kopf – abschaltbar mit <html data-cv-head="dark"> (dunkle
     Bewerbungs-PDFs, siehe scripts/generate-cv-pdf.mjs --bewerbung). */
  :root:not([data-cv-head="dark"]) {
    --cv-hd-bg: #F3EDE8;
    --cv-hd-name: #4F290F;
    --cv-hd-text: #4F290F;     /* Kurzprofil                  (11,8:1 auf #F3EDE8) */
    --cv-hd-strong: #4F290F;
    --cv-hd-role: #96441F;     /*                             (5,8:1 auf #F3EDE8) */
    --cv-hd-rule: #D8C7BB;
    --cv-hd-btn-bg: #FFFFFF;
    --cv-hd-btn-border: #D8C7BB;
    --cv-hd-btn-text: #4F290F;
  }
  :root:not([data-cv-head="dark"]) .stat-text { color: var(--cv-muted); }   /* #6B5446: 6,0:1 auf #F3EDE8 */

  html, body { background: #FFFFFF; }
  .cv-toolbar, .cv-noscript { display: none !important; }
  .cv { display: block; padding: 0; }
  .sheet { zoom: 1; width: 210mm; height: 297mm; box-shadow: none; break-after: page; page-break-after: always; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
}
