/* ============================================================
   minute.tools — Creador de CV (vista previa + formulario)
   ============================================================ */

.cv-layout {
  display: grid;
  grid-template-columns: minmax(0, 400px) 1fr;
  gap: 24px;
  align-items: start;
  max-width: none;
}

@media (max-width: 900px) {
  .cv-layout {
    grid-template-columns: 1fr;
  }

  .cv-preview-wrap {
    position: static;
  }
}

.tool-body {
  max-width: none;
}

.cv-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cv-form .panel {
  overflow: hidden;
}

.cv-form .field {
  margin-bottom: 0;
}

.cv-form .field + .field {
  margin-top: 14px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-width: 0;
}

.field-row .field {
  min-width: 0;
}

.field-row .field input,
.field-row .field select {
  width: 100%;
  min-width: 0;
}

.cv-form .field-row .field + .field {
  margin-top: 0;
}

.cv-entry {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--paper-sunken);
  position: relative;
}

.cv-entry + .cv-entry {
  margin-top: 12px;
}

.cv-entry-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 10px;
}

.cv-entry-actions .btn-ghost {
  padding: 4px 10px;
  font-size: var(--text-xs);
}

.cv-preview-wrap {
  position: sticky;
  top: 20px;
}

#cv-preview {
  aspect-ratio: 210 / 297;
  background: #fff;
  color: #141414;
  box-shadow: var(--shadow-card-hover);
  overflow: hidden;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.45;
  --cv-accent: #ff4d00;
}

#cv-preview,
#cv-preview * {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

#cv-preview h1,
#cv-preview h2,
#cv-preview h3 {
  font-family: var(--font-display);
}

.cv-doc {
  padding: 12mm;
  height: 100%;
  box-sizing: border-box;
  background: #fff;
}

.cv-header {
  margin-bottom: 14px;
}

.cv-header h1 {
  font-size: 1.8em;
  margin: 0;
  line-height: 1.1;
  color: #141414;
}

.cv-title {
  margin-top: 6px;
  color: #3d3d3d;
  font-size: 1em;
}

.cv-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 0.9em;
  color: #3d3d3d;
}

.cv-contacts > span:not(:last-child)::after {
  content: "·";
  margin-left: 14px;
  color: #9ca3af;
}

#cv-preview a {
  color: #141414;
  text-decoration: underline;
}

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

.cv-section h2 {
  font-size: 1.05em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #d4d4cf;
  padding-bottom: 4px;
  margin-bottom: 8px;
  color: #141414;
}

.cv-item {
  margin-bottom: 10px;
}

.cv-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.cv-item h3 {
  font-size: 1em;
  margin: 0;
  color: #141414;
}

.cv-company {
  font-size: 0.9em;
  color: #3d3d3d;
  margin-bottom: 4px;
}

.cv-dates {
  font-size: 0.85em;
  color: #71716c;
  white-space: nowrap;
  flex-shrink: 0;
}

.cv-description {
  margin: 0;
  color: #3d3d3d;
  font-size: 0.9em;
  white-space: pre-line;
}

.cv-summary {
  margin: 0;
  color: #3d3d3d;
}

.cv-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cv-skill {
  border: 1px solid #d4d4cf;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.85em;
  background: #f7f7f5;
  color: #141414;
}

.cv-languages {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9em;
}

.cv-languages li {
  color: #3d3d3d;
}

/* Plantilla clásica: una sola columna, solo enlaces de color */
.tpl-clasica {
  display: flex;
  flex-direction: column;
}

/* Plantilla moderna: regla lateral y chips con acento */
.tpl-moderna .cv-doc {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 18px;
  align-items: start;
}

.tpl-moderna .cv-header {
  grid-column: 1 / -1;
  margin-bottom: 10px;
}

.tpl-moderna .cv-header h1 {
  font-size: 2.1em;
}

.tpl-moderna .cv-main {
  grid-column: 1;
}

.tpl-moderna .cv-aside {
  grid-column: 2;
  border-left: 2px solid var(--cv-accent);
  padding-left: 14px;
}

.tpl-moderna .cv-section h2 {
  border-bottom: none;
  text-transform: none;
  letter-spacing: normal;
  color: var(--cv-accent);
  padding-bottom: 0;
  margin-bottom: 6px;
}

.tpl-moderna .cv-aside .cv-section h2 {
  font-size: 0.95em;
}

.tpl-moderna .cv-skill {
  background: var(--cv-accent);
  border-color: var(--cv-accent);
  color: #fff;
}

.tpl-moderna .cv-dates {
  color: var(--cv-accent);
  font-weight: 500;
}

@media (max-width: 640px) {
  .tpl-moderna .cv-doc {
    grid-template-columns: 1fr;
  }

  .tpl-moderna .cv-aside {
    border-left: none;
    border-top: 2px solid var(--cv-accent);
    padding-left: 0;
    padding-top: 10px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  .site-header,
  .site-footer,
  .breadcrumb,
  .tool-head,
  .cv-form,
  .tool-content,
  .faq {
    display: none !important;
  }

  .cv-layout {
    display: block;
  }

  .container {
    padding-inline: 0;
    max-width: none;
  }

  #cv-preview {
    width: 210mm;
    min-height: 297mm;
    box-shadow: none;
    aspect-ratio: auto;
    border-radius: 0;
  }

  .cv-doc {
    height: auto;
  }

  .tpl-moderna * {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
