/* ── Layout ────────────────────────────────────── */
html { min-height: 100%; background: #e9e8ef; }
body { min-height: 100svh; background: #e9e8ef; overflow-x: hidden; }

/* ── Toolbar ───────────────────────────────────── */
.cv-toolbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(233, 232, 239, 0.85);
  border-bottom: 1px solid #dad8e3;
}
.cv-toolbar__inner {
  max-width: 820px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.cv-toolbar__back {
  font-family: var(--font-mono); font-size: 13px; font-weight: 600;
  color: var(--muted); display: flex; align-items: center; gap: 7px;
  transition: color 0.15s;
}
.cv-toolbar__back:hover { color: var(--accent); }
.cv-toolbar__actions { display: flex; align-items: center; gap: 10px; }

.btn-lang-cv {
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  color: #565470; background: #fff;
  border: 1px solid #dad8e3; border-radius: 8px;
  padding: 7px 11px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn-lang-cv:hover { border-color: var(--accent); color: var(--accent); }
.btn-lang-cv__dim { opacity: 0.45; }

.btn-print {
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 600;
  color: #fff; background: var(--accent); border: none;
  border-radius: 8px; padding: 8px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  transition: transform 0.15s;
}
.btn-print:hover { transform: translateY(-1px); }
.btn-print__icon { font-family: var(--font-mono); font-size: 12px; }

/* ── CV Sheet ──────────────────────────────────── */
.cv-sheet {
  width: min(100% - 32px, 820px); margin: 26px auto 60px;
  background: #fff;
  box-shadow: 0 30px 80px -40px rgba(23,21,31,0.5);
}

/* ── CV Header ─────────────────────────────────── */
.cv-header { padding: 46px 48px 38px; border-bottom: 1px solid var(--border); }
.cv-header__top {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 24px; flex-wrap: wrap;
}
.cv-header__identity { display: flex; align-items: center; gap: 22px; }
.cv-header__photo {
  width: 104px; height: 104px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border); flex-shrink: 0;
  box-shadow: 0 10px 24px -16px rgba(23,21,31,0.5);
}
.cv-header__photo img { width: 100%; height: 100%; object-fit: cover; }
.cv-header__name {
  font-family: var(--font-display); font-size: 40px;
  line-height: 1; letter-spacing: -0.03em; font-weight: 600; margin-bottom: 10px;
}
.cv-header__role {
  font-family: var(--font-mono); font-size: 14.5px;
  font-weight: 500; color: var(--accent); letter-spacing: -0.01em;
}
.cv-avail {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  color: var(--green-text); background: var(--green-bg);
  border: 1px solid var(--green-border); border-radius: 999px;
  padding: 5px 11px; white-space: nowrap; align-self: flex-start;
  margin-top: 24px;
}
.cv-avail__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.cv-header__contacts {
  display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.cv-contact { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.cv-contact__icon { color: var(--accent); }

/* ── CV Body ───────────────────────────────────── */
.cv-body { display: grid; grid-template-columns: 1fr 1.95fr; }

/* ── CV Sidebar ────────────────────────────────── */
.cv-sidebar {
  padding: 38px 30px 48px;
  background: #faf9fc; border-right: 1px solid var(--border);
}
.cv-section { margin-bottom: 36px; }
.cv-section:last-child { margin-bottom: 0; }
.cv-section__title {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.cv-skill-list { display: flex; flex-direction: column; gap: 18px; }
.cv-skill__label {
  font-family: var(--font-display); font-size: 13px; font-weight: 600; margin-bottom: 6px;
}
.cv-skill__line { font-size: 12.5px; line-height: 1.5; color: #6d6a80; }
.cv-edu-list { display: flex; flex-direction: column; gap: 16px; }
.cv-edu__degree { font-family: var(--font-display); font-size: 13px; font-weight: 600; line-height: 1.3; }
.cv-edu__school { font-size: 12px; color: var(--subtle); margin-top: 2px; }
.cv-edu__year { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); margin-top: 3px; }
.cv-lang-list { display: flex; flex-direction: column; gap: 10px; }
.cv-lang-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cv-lang__name { font-family: var(--font-display); font-size: 13px; font-weight: 600; }
.cv-lang__level { font-family: var(--font-mono); font-size: 11px; color: var(--subtle); }

/* ── CV Main ───────────────────────────────────── */
.cv-main { padding: 38px 36px 48px; }
.cv-main__label {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 11px;
}
.cv-main__label--exp { margin-bottom: 16px; }
.cv-profil { font-size: 13.5px; line-height: 1.8; color: #46435a; text-wrap: pretty; margin-bottom: 38px; }

.cv-exp-list { display: flex; flex-direction: column; gap: 46px; }
.cv-exp-item { position: relative; padding-left: 18px; break-inside: avoid; }
.cv-exp-item__dot {
  position: absolute; left: 0; top: 4px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.cv-exp-item__line {
  position: absolute; left: 3.5px; top: 16px; bottom: -46px;
  width: 1.5px; background: var(--timeline);
}
.cv-exp-item:last-child .cv-exp-item__line { display: none; }
.cv-exp-item__header {
  display: flex; justify-content: space-between;
  align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.cv-exp-item__role {
  font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
}
.cv-exp-item__dates { font-family: var(--font-mono); font-size: 11px; color: var(--subtle); white-space: nowrap; }
.cv-exp-item__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 3px 0 9px; }
.cv-exp-item__company { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.cv-exp-item__sep { font-size: 11px; color: var(--faint); }
.cv-exp-item__type { font-family: var(--font-mono); font-size: 11px; color: var(--subtle); }
.cv-exp-item__bullets { display: flex; flex-direction: column; gap: 5px; margin-bottom: 9px; }
.cv-exp-item__bullet { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.cv-exp-item__arrow { color: var(--accent); flex-shrink: 0; font-family: var(--font-mono); font-size: 11px; }
.cv-exp-item__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.cv-tag {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted);
  background: var(--accent-bg); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 7px;
}

/* ── Print ─────────────────────────────────────── */
@media (max-width: 760px) {
  .cv-toolbar__inner {
    padding: 10px 14px;
    gap: 10px;
  }

  .cv-toolbar__actions { gap: 8px; }
  .btn-lang-cv { padding: 7px 9px; }
  .btn-print { padding: 8px 10px; }

  .cv-sheet {
    width: 100%;
    min-height: calc(100svh - 54px);
    margin: 0;
    box-shadow: none;
  }

  .cv-header {
    padding: 28px 20px 24px;
  }

  .cv-header__top {
    gap: 16px;
  }

  .cv-header__identity {
    gap: 14px;
    min-width: 0;
  }

  .cv-header__photo {
    width: 72px;
    height: 72px;
    border-radius: 14px;
  }

  .cv-header__name {
    font-size: 31px;
    line-height: 1.04;
    letter-spacing: 0;
  }

  .cv-header__role {
    font-size: 12.5px;
    line-height: 1.35;
  }

  .cv-avail {
    margin-top: 0;
  }

  .cv-header__contacts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    font-size: 11.5px;
  }

  .cv-body {
    display: flex;
    flex-direction: column;
  }

  .cv-main {
    order: 1;
    padding: 26px 20px 30px;
  }

  .cv-sidebar {
    order: 2;
    padding: 24px 20px 30px;
    border-top: 1px solid var(--border);
    border-right: 0;
  }

  .cv-profil {
    font-size: 13px;
    line-height: 1.65;
    margin-bottom: 28px;
  }

  .cv-exp-list {
    gap: 32px;
  }

  .cv-exp-item__line {
    bottom: -32px;
  }

  .cv-exp-item__bullet {
    line-height: 1.6;
  }

  .cv-section {
    margin-bottom: 26px;
  }
}

@media (max-width: 380px) {
  .cv-toolbar__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .cv-toolbar__actions {
    width: 100%;
    justify-content: space-between;
  }

  .cv-header,
  .cv-main,
  .cv-sidebar {
    padding-left: 16px;
    padding-right: 16px;
  }

  .cv-header__identity {
    align-items: flex-start;
    flex-direction: column;
  }

  .cv-header__name {
    font-size: 28px;
  }
}

@media print {
  html, body { background: #fff; }
  body {
    font-size: 10pt;
    -webkit-print-color-adjust: exact;
  }
  .cv-toolbar { display: none !important; }
  .cv-sheet {
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    box-shadow: none !important;
  }
  /* Switch grid to table so PrinceXML paginates the two columns correctly */
  .cv-body { display: table; width: 100%; table-layout: fixed; }
  .cv-sidebar { display: table-cell; vertical-align: top; width: 34%; }
  .cv-main { display: table-cell; vertical-align: top; }
  .cv-header { padding: 8mm 9mm 6mm; }
  .cv-sidebar { padding: 6mm 6mm 8mm; }
  .cv-main { padding: 6mm 7mm 8mm; }
  .cv-header,
  .cv-section,
  .cv-profil,
  .cv-exp-item {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }
  .cv-main__label,
  .cv-section__title,
  .cv-exp-item__header {
    break-after: avoid-page;
    page-break-after: avoid;
  }
  .cv-contact { -prince-link: attr(href); }

  @page {
    size: A4 portrait;
    margin: 0;
  }

}

@prince-pdf {
  -prince-pdf-display-doc-title: true;
  -prince-pdf-print-scaling: none;
}
