/* ================================
   Reset + Variables de diseño
================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root{
  --bg: #f9fafb;
  --card: #ffffff;
  --fg: #111827;
  --muted: #4b5563;
  --primary: #2563eb;      /* azul */
  --primary-600: #1d4ed8;
  --primary-700: #1e40af;
  --accent: #10b981;       /* emerald */
  --ring: #93c5fd;
  --border: #e5e7eb;
  --shadow: 0 6px 18px rgba(0,0,0,.06);
}

/* ================================
   Base tipográfica
================================== */
html { scroll-behavior: smooth; }
body{
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  font-size: 16px;
  padding: 24px;
}

/* ================================
   Header
================================== */
header .header-container{
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 960px;
  margin: 0 auto 24px auto;
  padding-bottom: 8px;
}

.photo{
  flex-shrink: 0;
  width: 150px; height: 150px;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: var(--shadow);
  outline: 3px solid #e0f2fe; /* sutil */
}
.photo img{ width: 100%; height: 100%; object-fit: cover; }

/* Acciones (banderas + PDF) */
.actions{
  display: flex; gap: 10px; align-items: center; margin-bottom: 8px;
}
.icon-btn{
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; font-size: 20px;
  border-radius: 9999px; border: 1px solid var(--border); background: var(--card);
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.icon-btn:hover{ background:#f8fafc; box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.icon-btn:active{ transform: translateY(1px) scale(.98); }
.icon-btn:focus{ outline: 3px solid var(--ring); outline-offset: 2px; }
.icon-btn.active{ border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.25); }

.info h1{
  font-weight: 800; letter-spacing: .2px;
  font-size: 2.25rem; line-height: 1.1;
  color: var(--primary-700);
  margin: 4px 0 8px 0;
}

/* Contacto */
.contact-list{ list-style: none; font-size: .97rem; color: var(--muted); display: grid; gap: 6px; }
.contact-list a{
  color: var(--primary); text-decoration: none; font-weight: 600;
  border-bottom: 1px dashed transparent; transition: color .2s ease, border-color .2s ease;
}
.contact-list a:hover, .contact-list a:focus{
  color: var(--primary-700); border-color: var(--primary-700); outline: none;
}

/* Separador */
hr{
  border: 0; height: 1px; background: #d1d5db;
  max-width: 960px; margin: 22px auto;
}

/* ================================
   Layout principal
================================== */
main{ max-width: 960px; margin: 0 auto 40px auto; padding: 0 12px; }

section{ margin-bottom: 28px; break-inside: avoid; }

h2{
  font-size: 1.65rem; font-weight: 700; color: var(--primary-700);
  margin-bottom: 14px; position: relative; padding-bottom: 6px;
}
h2::after{
  content:""; position:absolute; left:0; bottom:0; width: 62px; height: 3px; background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
}

/* ================================
   Experiencia
================================== */
.experience{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.experience h3{
  font-weight: 700; font-size: 1.18rem; color: var(--primary);
  margin-bottom: 6px;
}
.experience p, .experience ul{
  font-size: .98rem; color: #374151; margin-left: 2px; margin-bottom: 8px;
}
.experience ul{ list-style: disc; padding-left: 18px; }

/* ================================
   Perfil
================================== */
#perfil-profesional p{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  color: #1f2937;
  box-shadow: var(--shadow);
  max-width: 100%;
}

/* ================================
   Habilidades (grid de chips)
================================== */
.skills-list{
  list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.skills-list li{
  background: #eef2ff; /* indigo-100 */
  border: 1px solid #e0e7ff;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--primary-700);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(30,64,175,.08);
}

/* ================================
   Formación
================================== */
dl{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  color: #374151;
  margin-bottom: 22px;
}
dt{ font-weight: 800; color: var(--primary); margin-bottom: 4px; }
dd{ margin-left: 12px; margin-bottom: 12px; }

/* ================================
   Idiomas
================================== */
.languages{
  list-style: none; padding-left: 0; max-width: 520px; display: grid; gap: 6px;
  color: #374151;
}
.languages li{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

/* ================================
   Proyectos
================================== */
.projects ul{ list-style: none; padding-left: 0; display: grid; gap: 12px; }
.projects li{
  background: #f0f9ff; /* azul muy suave */
  border: 1px solid #e0f2fe;
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 4px 12px rgba(59,130,246,.12);
  color: #0f172a;
}
.projects a{
  color: var(--primary); font-weight: 700; text-decoration: none;
  border-bottom: 1px dashed transparent; transition: color .2s ease, border-color .2s ease;
}
.projects a:hover, .projects a:focus{
  color: var(--primary-700); border-color: var(--primary-700); outline: none;
}

/* ================================
   Footer
================================== */
footer{
  max-width: 960px; margin: 0 auto; padding: 16px 12px;
  font-size: .92rem; text-align: center; color: #6b7280;
  border-top: 1px solid #e5e7eb;
}
footer a{ color: var(--primary); text-decoration: none; font-weight: 700; }
footer a:hover, footer a:focus{ text-decoration: underline; outline: none; }

/* ================================
   Botón genérico (si usas más)
================================== */
button{
  background: var(--primary);
  color: #fff; font-weight: 700;
  padding: 10px 16px; margin: 0 8px 18px 0;
  border: none; border-radius: 10px; cursor: pointer;
  box-shadow: 0 8px 18px rgba(37,99,235,.35);
  transition: background .2s ease, box-shadow .2s ease, transform .08s ease;
  font-family: inherit; font-size: 1rem;
}
button:hover, button:focus{ background: var(--primary-600); box-shadow: 0 10px 22px rgba(29,78,216,.45); outline: none; }
button:active{ transform: translateY(1px) scale(.99); }

/* ================================
   Responsive
================================== */
@media (max-width: 720px){
  header .header-container{ flex-direction: column; align-items: center; text-align: center; gap: 18px; }
  .info h1{ font-size: 1.9rem; }
  .contact-list{ gap: 4px; }
  main{ padding: 0 8px; }
  .skills-list{ grid-template-columns: 1fr; }
}

/* ================================
   Print (A4, limpio, sin adornos)
================================== */
@page{ size: A4; margin: 12mm; }

@media print{
  /* Fondo blanco y texto negro para máxima legibilidad y menor tinta */
  body{ background: #fff; color: #000; padding: 0; }
  header .header-container, main, footer{ max-width: 100%; margin: 0; }
  /* Ocultar elementos interactivos/acciones */
  .actions, .icon-btn{ display: none !important; }
  /* Quitar sombras y bordes de color */
  .experience, #perfil-profesional p, dl, .languages li, .projects li{
    box-shadow: none !important; border: 1px solid #ddd !important; background: #fff !important;
  }
  h2::after{ background: #000 !important; opacity: .4; }
  a{ color: #000 !important; text-decoration: underline; }

  /* Evitar cortes feos entre bloques */
  section, .experience, #perfil-profesional p, dl, .languages li, .projects li{
    break-inside: avoid;
  }

  /* Reducir levemente los paddings para encajar mejor en A4 */
  .experience, #perfil-profesional p, dl, .languages li, .projects li{
    padding: 10px 12px;
  }
}
/* ================================
   Selector de idioma
================================== */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 8px;
  user-select: none;
}

.lang-switcher .active + .lang-label {
  color: var(--accent);
}
/* ================================
   Selector de idioma
================================== */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 8px;
  user-select: none;
}

.lang-switcher .active + .lang-label {
  color: var(--accent);
}
/* ================================
   Selector de idioma
================================== */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-right: 8px;
  user-select: none;
}

.lang-switcher .active + .lang-label {
  color: var(--accent);
}
/* Foto de perfil */
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* o contain */
  object-position: center top; /* modifica para ajustar qué parte se muestra */
}

.photo img{
  width: 100%;
  height: 100%;
  object-fit: contain;            /* <-- antes: cover */
}

/* Icon buttons (para SVG) */
.icon-btn{
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 9999px; border: 1px solid var(--border); background: var(--card);
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.icon-btn svg{ width: 22px; height: 22px; display: block; } /* asegura tamaño del SVG */
/* Banderas más grandes y cómodas al tacto */
.flag-btn{
  width: 52px;
  height: 52px;
}

.flag-btn svg{
  width: 32px;
  height: 32px;
  display: block;
}

/* Ajuste del label junto a la bandera */
.lang-label{
  font-size: 0.9rem;
  margin: 0 10px 0 6px;
}

/* En móviles, un poco más compacto */
@media (max-width: 720px){
  .flag-btn{ width: 46px; height: 46px; }
  .flag-btn svg{ width: 28px; height: 28px; }
}
