/* ===================================================================
   CV Layout — structural + typographic styles for CV rendering
   All colors/fonts use CSS custom properties defined in cv-themes.css
   =================================================================== */

/* ===== CV CONTAINER ===== */
#cv-container {
  width: 210mm;
  min-height: 297mm;
  margin: 30px auto;
  background: #fff;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
}

/* ===== HEADER ===== */
.cv-header {
  background: linear-gradient(135deg, var(--cv-gradient-start) 0%, var(--cv-gradient-end) 100%);
  color: #fff;
  padding: 10mm 12mm 7mm 12mm;
  display: flex;
  align-items: center;
  gap: 14px;
}

.cv-photo {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  flex-shrink: 0;
}

.cv-header-text {
  flex: 1;
}

.cv-name {
  font-family: var(--cv-font-heading);
  font-size: 20pt;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 1px;
}

.cv-headline {
  font-family: var(--cv-font-body);
  font-size: 11.5pt;
  font-weight: 400;
  opacity: 0.92;
  margin-bottom: 5px;
}

.cv-contacts {
  font-family: var(--cv-font-body);
  font-size: 9pt;
  opacity: 0.88;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.cv-contacts span {
  white-space: nowrap;
}

/* ===== BODY ===== */
.cv-body {
  padding: 5mm 12mm 5mm 12mm;
  font-family: var(--cv-font-body);
}

/* ===== SECTIONS ===== */
.cv-section {
  margin-bottom: 3mm;
}

.cv-section-title {
  font-family: var(--cv-font-heading);
  font-size: 11pt;
  font-weight: 700;
  color: var(--cv-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1.5px solid var(--cv-primary);
  padding-bottom: 1px;
  margin-bottom: 2mm;
}

/* ===== SUMMARY ===== */
.cv-summary {
  font-size: 9.5pt;
  line-height: 1.35;
  text-align: justify;
}

/* ===== COMPETENCIES / BADGES ===== */
.cv-competencies {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.cv-badge {
  background: var(--cv-badge-bg);
  color: var(--cv-badge-text);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9pt;
  font-weight: 600;
}

/* ===== EXPERIENCE ===== */
.cv-exp-item {
  margin-bottom: 2mm;
  break-inside: avoid;
}

.cv-exp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
}

.cv-exp-role {
  font-family: var(--cv-font-heading);
  font-size: 10.5pt;
  font-weight: 700;
  color: #2d3748;
}

.cv-exp-period {
  font-size: 9pt;
  color: #718096;
  white-space: nowrap;
}

.cv-exp-company {
  font-size: 9.5pt;
  color: #4a5568;
  margin-bottom: 1.5mm;
}

.cv-exp-bullets {
  list-style: disc;
  padding-left: 5mm;
  font-size: 9.5pt;
  line-height: 1.35;
}

.cv-exp-bullets li {
  margin-bottom: 0.5mm;
}

/* ===== EDUCATION ===== */
.cv-edu-item {
  margin-bottom: 2mm;
  break-inside: avoid;
}

.cv-edu-degree {
  font-family: var(--cv-font-heading);
  font-size: 10pt;
  font-weight: 700;
}

.cv-edu-school {
  font-size: 9.5pt;
  color: #4a5568;
}

.cv-edu-detail {
  font-size: 9pt;
  color: #718096;
}

/* ===== LANGUAGES & INLINE LISTS ===== */
.cv-inline-list {
  font-size: 9.5pt;
  line-height: 1.35;
}

/* ===== EDITING MODE ===== */
.editing [data-field] {
  outline: 2px dashed rgba(var(--cv-primary-rgb, 13, 115, 119), 0.4);
  outline-offset: 2px;
  border-radius: 3px;
  cursor: text;
  transition: outline-color 0.2s, background 0.2s;
}

.editing [data-field]:hover {
  outline-color: var(--cv-primary);
  background: rgba(var(--cv-primary-rgb, 13, 115, 119), 0.04);
}

.editing [data-field]:focus {
  outline: 2px solid var(--cv-primary);
  background: rgba(var(--cv-primary-rgb, 13, 115, 119), 0.06);
}

.editing [contenteditable="true"] {
  outline: 2px dashed rgba(var(--cv-primary-rgb, 13, 115, 119), 0.4);
  outline-offset: 2px;
  border-radius: 3px;
  cursor: text;
  transition: outline-color 0.2s, background 0.2s;
}

.editing [contenteditable="true"]:hover {
  outline-color: var(--cv-primary);
  background: rgba(var(--cv-primary-rgb, 13, 115, 119), 0.04);
}

.editing [contenteditable="true"]:focus {
  outline: 2px solid var(--cv-primary);
  background: rgba(var(--cv-primary-rgb, 13, 115, 119), 0.06);
}

.editing .cv-badge[contenteditable="true"] {
  outline-offset: 0px;
}

.edit-mode-banner {
  display: none;
  background: linear-gradient(90deg, var(--cv-gradient-start), var(--cv-gradient-end));
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 9.5pt;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.edit-mode-banner.visible {
  display: block;
}

/* ===== PRINT ===== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body {
    background: #fff;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  #cv-container {
    box-shadow: none;
    margin: 0;
    padding: 0;
    width: 210mm;
    min-height: auto;
    overflow: visible;
  }

  .cv-body {
    break-before: avoid;
  }

  .cv-header {
    background: linear-gradient(135deg, var(--cv-gradient-start) 0%, var(--cv-gradient-end) 100%) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cv-badge {
    background: var(--cv-badge-bg) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .cv-exp-item {
    break-inside: avoid;
  }

  .edit-mode-banner {
    display: none !important;
  }
}
