/* =============================================================================
 * styles.css — CV de Carlos Pereyra · diseño v1.0.0
 * Minimalista y cálido, alineado a la identidad de pereyra.ar:
 *   - paleta "warm" (papel crema, tinta cálida, acento naranja)
 *   - IBM Plex Sans (cuerpo/títulos) + IBM Plex Mono (metadatos/etiquetas)
 *   - experiencia en timeline, skills como pills, badge de versión
 * Variables arriba para ajustar todo sin tocar el resto.
 * =========================================================================== */

:root {
  --accent:      #e2701a;
  --accent-dark: #bd5a0e;
  --accent-soft: #f8ebdd;   /* fondo de pills / realces */
  --ink:         #211f1c;   /* texto principal (negro cálido) */
  --ink-soft:    #6f655a;   /* texto secundario */
  --ink-faint:   #9a9085;   /* metadatos tenues */
  --rule:        #ece6dd;   /* líneas finas */
  --paper:       #ffffff;   /* hoja */
  --page-bg:     #e9e4db;   /* fondo alrededor de la hoja */

  --font-sans: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;
  --page-pad:  17mm 18mm 16mm;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.7px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- Hoja A4 --- */
.page {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  margin: 30px auto;
  padding: var(--page-pad);
  background: var(--paper);
  box-shadow: 0 10px 40px rgba(40, 30, 15, 0.16);
}

/* --- Badge de versión (esquina sup. der. de la hoja, solo pantalla) --- */
.cv-version {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 9px;
}

/* --- Controles flotantes (idioma + descarga) --- */
.controls {
  position: fixed;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 8px;
  z-index: 50;
}
.ctrl-btn {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 9px 15px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(40, 30, 15, 0.12);
  transition: background .15s, color .15s, transform .05s;
}
.ctrl-btn:hover { background: var(--accent-soft); }
.ctrl-btn:active { transform: translateY(1px); }
.ctrl-btn--primary { background: var(--accent); color: #fff; }
.ctrl-btn--primary:hover { background: var(--accent-dark); }

/* =============================================================================
 * Header
 * =========================================================================== */
.cv-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 16px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--ink);
}
.cv-photo {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: #ddd;
  box-shadow: 0 0 0 1px var(--rule);
}
.cv-headinfo { min-width: 0; }
.cv-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 38px;
  line-height: 1.02;
  letter-spacing: -0.015em;
  margin: 0;
}
.cv-name__last { color: var(--accent); }
.cv-role {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin: 7px 0 11px;
}
.cv-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 0;
  font-family: var(--font-mono);
  font-size: 11.6px;
}
.cv-contact {
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.cv-contact:not(:last-child)::after {
  content: '·';
  color: var(--accent);
  margin: 0 9px;
}
.cv-contact:hover { color: var(--accent-dark); }

/* =============================================================================
 * Secciones
 * =========================================================================== */
.cv-section { margin-top: 19px; }
.cv-section__title {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 11px;
  padding-left: 14px;
  position: relative;
}
.cv-section__title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* --- Summary --- */
.cv-summary { margin: 0 0 9px; color: var(--ink); }
.cv-summary--lead { font-size: 14.6px; color: var(--ink); }
.cv-summary:last-child { margin-bottom: 0; }

/* --- Skills como pills --- */
.cv-skills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.cv-pill {
  font-family: var(--font-mono);
  font-size: 11.8px;
  font-weight: 500;
  color: var(--ink);
  background: var(--accent-soft);
  border: 1px solid #f0ddc8;
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}

/* =============================================================================
 * Experiencia — timeline
 * =========================================================================== */
.cv-timeline {
  position: relative;
  padding-left: 20px;
}
.cv-timeline::before {
  content: '';
  position: absolute;
  left: 4px; top: 6px; bottom: 6px;
  width: 1.5px;
  background: var(--rule);
}
.cv-job {
  position: relative;
  margin-bottom: 15px;
  break-inside: avoid;
}
.cv-job:last-child { margin-bottom: 0; }
.cv-job::before {                 /* punto del timeline */
  content: '';
  position: absolute;
  left: -19.5px; top: 5px;
  width: 9px; height: 9px;
  background: var(--paper);
  border: 2px solid var(--accent);
  border-radius: 50%;
}
.cv-job__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}
.cv-job__title {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
}
.cv-job__company {
  font-weight: 500;
  color: var(--accent-dark);
  margin-left: 2px;
}
.cv-job__company::before { content: '· '; color: var(--ink-faint); }
.cv-job__period {
  font-family: var(--font-mono);
  font-size: 11.4px;
  color: var(--ink-soft);
  white-space: nowrap;
  flex: 0 0 auto;
}
.cv-job__loc {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  margin: 2px 0 6px;
}
.cv-bullets {
  margin: 0;
  padding: 0;
  list-style: none;
}
.cv-bullets li {
  position: relative;
  padding-left: 15px;
  margin: 3px 0;
}
.cv-bullets li::before {
  content: '';
  position: absolute;
  left: 2px; top: 0.62em;
  width: 4px; height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.cv-bullets a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }

/* =============================================================================
 * Certificaciones
 * =========================================================================== */
.cv-certs {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cv-cert {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  border-bottom: 1px solid var(--rule);
}
.cv-cert:last-child { border-bottom: 0; }
.cv-cert__title { flex: 1 1 auto; }
.cv-cert__title::before { content: '▹'; color: var(--accent); margin-right: 8px; }
.cv-cert__year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-faint);
  white-space: nowrap;
  flex: 0 0 auto;
}

/* =============================================================================
 * Formación
 * =========================================================================== */
.cv-edu { margin-bottom: 9px; }
.cv-edu:last-child { margin-bottom: 0; }
.cv-edu__title { font-weight: 600; }
.cv-edu__detail {
  font-family: var(--font-mono);
  font-size: 11.4px;
  color: var(--ink-soft);
}

/* --- Pie de impresión (oculto en pantalla) --- */
.cv-printfoot { display: none; }

/* =============================================================================
 * Impresión / Guardar como PDF
 * =========================================================================== */
@page { size: A4; margin: 13mm; }

@media print {
  html, body { background: #fff; font-size: 10.6pt; }
  .controls { display: none !important; }
  .cv-version { display: none !important; }     /* el chip de pantalla no se imprime */
  .page {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }
  a { color: var(--ink); text-decoration: none; }
  .cv-bullets a { color: var(--ink); text-decoration: none; }
  .cv-section, .cv-job, .cv-edu, .cv-cert { break-inside: avoid; }
  .cv-section__title { break-after: avoid; }

  /* Versión abajo a la derecha en CADA página impresa */
  .cv-printfoot {
    display: block;
    position: fixed;
    bottom: 4mm;
    right: 0;
    font-family: var(--font-mono);
    font-size: 7.6pt;
    color: var(--ink-faint);
  }

  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
