.top-bar {
  width: 100%;
  text-align: center;
  margin: 20px 0;
}

.btn-print {
  background: black;
  color: white;
  padding: 10px 20px;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.btn-print:hover {
  opacity: 0.8;
}

/* ================= LIBRO ================= */
.row {
  display: flex;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0;
  position: relative;
}

.book-fold {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  border-radius: 6px;
  background: linear-gradient(to right,
      rgba(0, 0, 0, 0.15) 0%,
      rgba(255, 255, 255, 0.5) 50%,
      rgba(0, 0, 0, 0.15) 100%);
  box-shadow:
    0 0 14px rgba(0, 0, 0, 0.25),
    inset 0 0 8px rgba(0, 0, 0, 0.25);
}

/* ================= HOJAS ================= */
.a4-wrapper {
  width: 210mm;
  min-height: 297mm;
  height: 297mm;
  overflow: hidden;
  /* ← evita desbordes */
  background: white;
  padding: 12mm 14mm;
  box-sizing: border-box;
  font-family: "Raleway", sans-serif;
  font-size: 16px;
  line-height: 1.28;
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.25);
  margin-bottom: 0;
}

/* ================= CABECERA ================= */
.header-box {
  background: #fffdf9;
  padding: 12mm 14mm 8mm 14mm;
  margin: -12mm -14mm 12px -14mm;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dot-img {
  width: 149px;
  height: 147px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgb(190, 190, 190);
}


.contact p {
  margin: 0;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  line-height: 26px;
}

.contact {
  margin-bottom: 10px;
}

.exp-heading {
  margin-bottom: 6px;
}

.exp-subtasks {
  margin-bottom: 10px;
}

.name {
  font-size: 22px;
  font-weight: 800;
}

.role {
  font-size: 16px;
  font-style: italic;
}

.line {
  width: 100%;
  height: 2px;
  background: #000;
  margin: 8px 0 10px 0;
}

/* ================= LISTAS ================= */
.study-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.item-formacion span {
  font-size: 16px;
}

.titulo-formacion {
  font-weight: 700;
}

.extra-list {
  list-style: none;
  padding: 0;
}

.extra-list li {
  font-size: 16px;
}

.skills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-badge {
  padding: 4px 10px;
  border: 2px solid #000;
}

.cert-list li,
.idiomas-list li {
  margin-bottom: 3px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
}

.exp-title {
  font-size: 17px;
}

.udemy-title {
  font-weight: 600;
}

p.exp-company {
  font-size: 14px;
}

ul.exp-tasks {
  line-height: 24px;
  font-size: 14px;
}

ul.otros-datos-list {
  font-size: 14px;
}

.no-print-link {
  text-decoration: none;
  color: #000;
  transition: 0.3s;
}

.no-print-link:hover {
  color: #146311;
}


a.btn.btn-outline-dark.btn-volver {
  margin-left: 69px;
}



/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .row {
    flex-direction: column;
    align-items: center;
  }

  .book-fold {
    display: none;
  }

  .a4-wrapper {
    width: 100%;
    height: auto;
    /* ← en móvil sí debe ser automático */
    min-height: auto;
    margin-bottom: 20px;
    box-shadow: none;
  }

  .no-print-link {
    text-decoration: none;
    color: #000;
  }
}

@media (max-width: 600px) {

  .a4-wrapper {
    width: 100%;
    padding: 8px 12px !important;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.22;
  }

  .header-box {
    margin: -8px -12px 10px -12px !important;
    padding: 14px 12px !important;
  }

  .dot {
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
  }

  .header {
    flex-direction: column;
    text-align: center;
  }

  .contact p {
    justify-content: center;
    font-size: 17px;
    line-height: 1.2;
  }

  .name {
    font-size: 18px;
  }

  .role {
    font-size: 14px;
  }

  .line {
    margin: 6px 0 8px 0;
  }

  .study-list.grid-2 {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 15px;
  }

  .item-formacion span {
    font-size: 14px;
    line-height: 1.25;
  }

  .skills-row {
    gap: 5px;
  }

  .skill-badge {
    padding: 3px 8px;
    font-size: 13px;
  }

  .exp-title {
    font-size: 16px;
  }

  p.exp-company {
    font-size: 13px;
  }

  ul.exp-tasks li {
    font-size: 14px;
    line-height: 1.25;
  }

  .no-print-link {
    text-decoration: none;
    color: #000;
  }

}

/* ================= IMPRESIÓN ================= */
@media print {

  .top-bar,
  .btn-print,
  .book-fold {
    display: none !important;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
  }

  /* HOJA A4 CENTRADA */
  .a4-wrapper {
    width: 210mm !important;
    min-height: 260mm !important;
    height: auto !important;
    margin: auto !important;
    padding: 12mm 14mm !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    page-break-after: always !important;
    box-sizing: border-box !important;
  }


  /* CABECERA — altura más baja y proporcionada */
  .header-box {
    width: 100% !important;
    margin: 0 0 10px 0 !important;

    /* Ajustamos aquí: reducimos padding vertical */
    padding-top: 2mm !important;
    padding-bottom: 5mm !important;

    padding-left: 14mm !important;
    padding-right: 14mm !important;

    background: #fffdf9 !important;

    box-sizing: border-box !important;
  }

  /* Contenido */
  .a4-wrapper>*:not(.header-box) {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Separación entre cabecera y contenido */
  .a4-wrapper>*:not(.header-box):first-of-type {
    margin-top: 5mm !important;
  }

  /* Líneas alineadas */
  .line,
  hr,
  .exp-separator {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }

  .no-print-link {
    text-decoration: none;
    color: #000;
  }

  .no-print {
    display: none !important;
  }
}
