/*
   Estructura:
   1. Reset
   2. Variables CSS (colores, tipografía, layout)
   3. Estilos base
   4. Layout (Grid, estructura principal)
   5. Componentes (header, sidebar, cards, listas)
   6. Interacciones (hover, focus, animaciones)
   7. Responsive
   8. Print (versión PDF)

   Extras:
   - Uso de variables CSS
   - Grid layout responsive
   - Accesibilidad (focus visible, contrastes, legibilidad)
   - Diseño limpio y consistente
   - Estilos de impresión para entrega en PDF
*/


/* 1. Reset */


*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
  padding: 0;
  margin: 0;
}


/* 2. Variables CSS */


:root {
  --bg: #f3f5f7;
  --text: #1f2937;
  --accent: #3a5980;
  --sidebar: #d9dde2;
  --card: #ffffff;
  --border: rgba(0, 0, 0, 0.12);
  --muted: #6b7280;
}


/* 3. Estilos base */


body {
    margin: 0;
    line-height: 1.4;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  transition: color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}


/* 4. Layout */


.layout {
  width: min(1200px, 100% - 48px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.sidebar {
  background: var(--sidebar);
  padding: 24px 20px;
}

.content {
  padding: 28px 32px;
}


/* 5. Componentes */


/* 5.1 Header */


.cv-header {
    background-color: var(--accent);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.cv-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.cv-header h2 {
    margin-top: 6px;
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.9;
}


/* 5.2 Sidebar */


.sidebar-photo {
  width: 215px;
  height: 215px;
  margin: 0 auto 28px;
  background: #fff;
  padding: 8px;
  border-radius: 16px;
  overflow: hidden;
}

.sidebar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.sidebar-section{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}


/* 5.3 Contact List */


.contact-list {
    padding: 0;
    margin: 0;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.contact-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}


/* 5.4 Skills List */


.skills-list {
  margin: 0;
  padding-left: 2em;
  position: relative;
}

.skills-list-Soft {
  margin: 0;
  padding-left: 2em;
  position: relative;
}

.skill-item {
  position: relative;
  padding-left: 10px;
  margin-bottom: 18px;
  line-height: 1.6;
  font-size: 0.9rem;
}


/* 5.5 Projects and Languages Lists */


.projects-list,
.languages-list {
  margin-left: 18px;
  margin-top: 8px;
}

.projects-list li,
.languages-list li {
  margin-bottom: 8px;
}

.project + .project {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.project p {
  margin-bottom: 10px;
  line-height: 1.6;
}

.project a {
  font-weight: 600;
}

.project a:hover {
  text-decoration: underline;
}


/* 5.6 Card */


.card p {
  max-width: 620px;      
  line-height: 1.6;
  margin-bottom: 12px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 24px;
  break-inside: avoid;
  page-break-inside: avoid;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}


/* 5.7 Sections */


.section-title {
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.section-item {
  margin-top: 16px;
  margin-bottom: 6px;
}

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


/* 5.8 Footer */


.cv-footer {
  text-align: center;
  padding: 16px;
  margin-top: 0;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: transparent;
}

.cv-footer p {
  margin: 0;
  letter-spacing: 1px;
}


/* 6. Interacciones */


/* 6.1 Before */


.skills-list::before {
  content: "";
  position: absolute;
  left: 0.75em;
  top: 0.7em;
  bottom: 0.3em;
  width: 2px;
  background: rgba(0,0,0,0.18);
}

.skills-list-Soft::before {
  content: "";
  position: absolute;
  left: 0.75em;
  top: 0.7em;
  bottom: 2em;
  width: 2px;
  background: rgba(0,0,0,0.18);
}

.skill-item::before {
  content: "";
  position: absolute;
  left: -1.6em;
  top: 0.7em;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}


/* 6.2 Hover */


.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.sidebar-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.06);
}

a:hover {
  color: var(--accent);
  text-decoration: underline;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}


/* 6.3 Tab */


:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.sidebar a:focus-visible {
  background: rgba(35, 58, 87, 0.12);
  padding: 2px 4px;
}


/* 7. Responsive */


/* 7.1 Tablet / Desktop */


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


/* 7.2 Tablet en vertical */


@media (max-width: 899px) {
  .cv-header {
    align-items: flex-start;
    text-align: left;
  }

  .cv-header h1 {
    font-size: 2rem;
  }

  .cv-header h2 {
    letter-spacing: 2px;
  }

  .content {
    padding: 20px;
  }

  .sidebar {
    padding: 20px;
  }

  .card {
    padding: 16px;
  }
}


/* 7.3 Móvil */


@media (max-width: 520px) {
  .cv-header {
    padding: 16px;
  }

  .cv-header h1 {
    font-size: 1.7rem;
  }

  .cv-header h2 {
    font-size: 0.85rem;
    letter-spacing: 1.5px;
  }

  .sidebar-photo {
    width: 130px;
    height: 130px;
    margin: 0 auto 16px;
  }

  .content {
    padding: 16px;
  }

  .sidebar {
    padding: 16px;
  }

  .card {
    margin-bottom: 16px;
  }

  .contact-item {
    gap: 8px;
  }

  .contact-item a {
    word-break: break-word;
  }
}


/* 8. Print */


@media print {
  body {
    background: #fff;
  }

  .layout {
    max-width: none;
    margin: 0;
  }

  .cv-header {
    color: #000;
    background: #fff;
    border-bottom: 2px solid #000;
  }

  .sidebar {
    background: #fff;
  }

  a {
    text-decoration: none;
    color: #000;
  }

  .card, 
  .sidebar-section {
  background: #fff;
  border: 1px solid #000;
  }

  a::after {
  content: " (" attr(href) ")";
  font-size: 0.8em;
  }

}



