/* ===== Страница резюме (A4) и 8 макетов ===== */

.cv-page {
  --accent: #2563eb;
  --ink: #1f2430;
  --muted: #6b7280;
  --side-bg: var(--accent);
  width: 210mm;
  min-height: 297mm;
  background: #fff;
  color: var(--ink);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  padding: 14mm 14mm 12mm;
  line-height: 1.45;
  font-size: 10.5pt;
}
.cv-page * { box-sizing: border-box; }

.cv-page.font-inter   { font-family: 'Inter', 'Segoe UI', Arial, sans-serif; }
.cv-page.font-ptserif { font-family: 'PT Serif', Georgia, serif; }
.cv-page.font-jost    { font-family: 'Jost', 'Segoe UI', Arial, sans-serif; }
.cv-page.font-roboto  { font-family: 'Roboto', Arial, sans-serif; }

/* --- Шапка --- */
.cv-header { display: flex; align-items: center; gap: 8mm; flex-wrap: wrap; margin-bottom: 7mm; }
.head-center .cv-header { flex-direction: column; text-align: center; gap: 4mm; }
.cv-name { font-size: 2.1em; margin: 0 0 1mm; line-height: 1.15; letter-spacing: .01em; }
.cv-position { font-size: 1.15em; color: var(--accent); font-weight: 600; }
.cv-salary { color: var(--muted); font-size: .92em; margin-top: 1mm; }
.cv-name-block { flex: 1 1 60mm; min-width: 50mm; }

.cv-photo img {
  width: 32mm; height: 32mm; object-fit: cover; display: block;
}
.shape-circle .cv-photo img { border-radius: 50%; }
.shape-rounded .cv-photo img { border-radius: 3mm; }
.shape-square .cv-photo img { border-radius: 0; }

/* --- Контакты --- */
.cv-contacts { display: flex; flex-direction: column; gap: 1.2mm; font-size: .92em; }
.cv-header .cv-contacts { flex: 0 1 auto; min-width: 45mm; }
.head-center .cv-header .cv-contacts { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 2mm 6mm; }
.cv-contact { display: flex; align-items: baseline; gap: 1.8mm; }
.cv-ci { font-size: .9em; }
.cv-cl { color: var(--muted); }

/* --- Секции --- */
.cv-sec { margin-bottom: 5.5mm; }
.cv-h {
  font-size: 1.06em; text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent); margin: 0 0 2.5mm; font-weight: 700;
}
.deco-line .cv-h { border-bottom: 1.5px solid var(--accent); padding-bottom: 1.2mm; }
.deco-block .cv-h {
  background: var(--accent-soft, #e8eefc);
  padding: 1.2mm 2.5mm; border-radius: 1.5mm; border-bottom: none;
}
.head-center.deco-none .cv-h { text-align: left; }

.cv-item { margin-bottom: 3.5mm; }
.cv-item:last-child { margin-bottom: 0; }
.cv-item-head { display: flex; justify-content: space-between; gap: 4mm; align-items: baseline; }
.cv-item-head strong { font-size: 1.02em; }
.cv-period { color: var(--muted); font-size: .9em; white-space: nowrap; }
.cv-item-sub { color: var(--accent); font-size: .95em; margin: .5mm 0; font-weight: 500; }
.cv-item-sub-inline { color: var(--muted); font-size: .92em; margin-left: 2mm; }
.cv-item-slim { margin-bottom: 1.8mm; }
.cv-text { margin: 1mm 0 0; white-space: normal; }
.cv-link { color: var(--accent); word-break: break-all; }

/* --- Навыки --- */
.cv-skill { display: flex; align-items: center; justify-content: space-between; gap: 4mm; margin-bottom: 1.6mm; }
.cv-skill-name { flex: 1; }
.cv-bar { flex: 0 0 30mm; height: 1.8mm; background: #e5e7eb; border-radius: 1mm; overflow: hidden; }
.cv-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 1mm; }
.cv-dots { display: flex; gap: 1.2mm; }
.cv-dots i { width: 2.6mm; height: 2.6mm; border-radius: 50%; background: #e5e7eb; display: inline-block; }
.cv-dots i.on { background: var(--accent); }
.cv-lang-level { color: var(--muted); font-size: .92em; }

.cv-tags { display: flex; flex-wrap: wrap; gap: 1.8mm; }
.cv-tag {
  border: 1px solid var(--accent-border, #a9c0f3);
  background: var(--accent-soft, #eef3fd);
  color: var(--ink); padding: .8mm 2.6mm; border-radius: 10mm; font-size: .92em;
}

/* ===== Макеты ===== */

/* modern: цветная полоса-шапка */
.layout-modern { padding-top: 0; }
.layout-modern .cv-band {
  background: var(--accent); color: #fff;
  margin: 0 -14mm 7mm; padding: 8mm 14mm;
}
.layout-modern .cv-band .cv-position,
.layout-modern .cv-band .cv-salary { color: rgba(255,255,255,.9); }
.layout-modern .cv-band .cv-cl { color: rgba(255,255,255,.75); }

/* Двухколоночный низ (modern, compact, creative) */
.cv-cols { display: flex; gap: 8mm; }
.cv-col-l { flex: 1 1 62%; min-width: 0; }
.cv-col-r { flex: 1 1 38%; min-width: 0; }

/* sidebar: цветная боковая колонка */
.layout-sidebar, .layout-sidebar-right { padding: 0; }
.cv-wrap-side { display: flex; min-height: 297mm; }
.cv-side {
  flex: 0 0 66mm; background: var(--side-bg); color: #fff;
  padding: 12mm 7mm;
}
.cv-side .cv-h { color: #fff; border-color: rgba(255,255,255,.5); }
.cv-side .deco-block .cv-h, .layout-sidebar .cv-side .cv-h { background: none; }
.cv-side .cv-tag { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.12); color: #fff; }
.cv-side .cv-bar { background: rgba(255,255,255,.25); }
.cv-side .cv-bar-fill { background: #fff; }
.cv-side .cv-dots i { background: rgba(255,255,255,.25); }
.cv-side .cv-dots i.on { background: #fff; }
.cv-side .cv-lang-level, .cv-side .cv-period, .cv-side .cv-cl,
.cv-side .cv-item-sub-inline { color: rgba(255,255,255,.8); }
.cv-side .cv-photo { margin-bottom: 6mm; }
.cv-side .cv-photo img { width: 40mm; height: 40mm; margin: 0 auto; }
.cv-main { flex: 1; padding: 12mm 10mm 10mm; min-width: 0; }
.cv-main .cv-name-block { margin-bottom: 6mm; }
.d-mobile { display: none; }

/* minimal: тонко и много воздуха */
.layout-minimal { padding: 18mm 18mm 14mm; }
.layout-minimal .cv-h { color: var(--ink); letter-spacing: .14em; font-weight: 600; font-size: .95em; }
.layout-minimal.deco-line .cv-h { border-bottom-color: #d1d5db; }
.layout-minimal .cv-header { border-bottom: 1px solid #e5e7eb; padding-bottom: 6mm; }
.layout-minimal .cv-name { font-weight: 500; letter-spacing: .02em; }
.layout-minimal .cv-position { color: var(--muted); }
.layout-minimal .cv-sec { margin-bottom: 7mm; }

/* timeline: линия слева от опыта/образования */
.cv-tl .cv-exp .cv-item, .cv-tl .cv-sec .cv-item {
  position: relative; padding-left: 6mm;
}
.cv-tl .cv-item::before {
  content: ''; position: absolute; left: 0; top: 1.6mm;
  width: 2.4mm; height: 2.4mm; border-radius: 50%; background: var(--accent);
}
.cv-tl .cv-item::after {
  content: ''; position: absolute; left: 1.05mm; top: 5mm; bottom: -3mm;
  width: .5mm; background: var(--accent-line, #c3d3f7);
}
.cv-tl .cv-item:last-child::after { display: none; }
.cv-tl .cv-item-slim { padding-left: 6mm; }

/* compact: плотнее, мельче */
.layout-compact { font-size: 9.5pt; padding: 10mm 12mm; line-height: 1.35; }
.layout-compact .cv-sec { margin-bottom: 4mm; }
.layout-compact .cv-header { margin-bottom: 4mm; }
.layout-compact .cv-name { font-size: 1.8em; }
.layout-compact .cv-photo img { width: 26mm; height: 26mm; }

/* creative: крупная градиентная шапка */
.layout-creative { padding-top: 0; }
.layout-creative .cv-hero {
  margin: 0 -14mm 8mm; padding: 12mm 14mm 10mm;
  background: linear-gradient(120deg, var(--accent), var(--accent-dark, #16305e));
  color: #fff;
}
.layout-creative .cv-hero .cv-name { font-size: 2.5em; }
.layout-creative .cv-hero .cv-position { color: rgba(255,255,255,.92); }
.layout-creative .cv-hero .cv-salary { color: rgba(255,255,255,.75); }
.layout-creative .cv-hero .cv-photo img { border: 2px solid rgba(255,255,255,.6); }

/* --- Водяной знак (бесплатная версия) --- */
.cv-watermark {
  position: absolute; inset: 0; pointer-events: none;
  display: flex; align-items: flex-end; justify-content: center;
}
.cv-watermark span {
  margin-bottom: 4mm; padding: 1.5mm 5mm; border-radius: 10mm;
  background: rgba(30, 41, 59, .75); color: #fff; font-size: 9pt;
  font-family: 'Inter', Arial, sans-serif; letter-spacing: .03em;
}

/* --- Сопроводительное письмо --- */
.cv-letter .cv-header { border-bottom: 2px solid var(--accent); padding-bottom: 5mm; }
.cv-letter .cv-text { line-height: 1.65; }

/* --- Печать --- */
@media print {
  body { margin: 0; background: #fff !important; }
  .cv-page { width: auto; min-height: auto; box-shadow: none !important; margin: 0 !important; }
  .cv-sec, .cv-item { break-inside: avoid; }
}
