/* === TOKENS DE DISEÑO === */
:root {
  --color-primary: #1B2A4A;
  --color-primary-light: #2D4A7A;
  --color-accent: #8B734A;
  --color-accent-light: #A8915E;
  --color-bg: #FAFAF8;
  --color-bg-alt: #F0EDEA;
  --color-surface: #FFFFFF;
  --color-text: #2D3748;
  --color-text-light: #6B7280;
  --color-border: #E2E0DC;
  --font-heading: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --max-width: 1100px;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(27, 42, 74, 0.08);
  --shadow-hover: 0 4px 16px rgba(27, 42, 74, 0.14);
  --transition: 0.25s ease;
}

/* === RESET Y BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus-visible { color: var(--color-primary-light); }
ul { list-style: none; }

/* === TIPOGRAFÍA === */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.25;
  font-weight: 700;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 1rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }

/* === LAYOUT === */
.contenedor {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
}

.seccion {
  padding: 4rem 0;
}

.seccion--alt {
  background: var(--color-bg-alt);
}

/* === CABECERA (HEADER) === */
.cabecera {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.cabecera__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
}

.cabecera__logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cabecera__logo:hover { color: var(--color-accent-light); }

.cabecera__logo span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--color-accent-light);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 2px;
}

/* Navegación */
.nav__lista {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav__enlace {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav__enlace:hover,
.nav__enlace:focus-visible {
  color: #fff;
  border-bottom-color: var(--color-accent-light);
}

.nav__enlace[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--color-accent);
}

/* Botón menú móvil */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: transform var(--transition), opacity var(--transition);
}

/* === HERO === */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  overflow: hidden;
}

.hero__imagen-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
}

.hero__contenido {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 4rem 0;
}

.hero__foto-wrapper {
  flex-shrink: 0;
}

.hero__foto {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 4px solid rgba(255,255,255,0.3);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.hero__texto {
  color: #fff;
}

.hero__subtitulo {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent-light);
  margin-bottom: 0.5rem;
}

.hero__titulo {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 0.75rem;
}

.hero__descripcion {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  max-width: 500px;
  line-height: 1.8;
}

.hero__acento {
  display: inline-block;
  width: 50px;
  height: 3px;
  background: var(--color-accent);
  margin: 1.2rem 0;
}

/* === TARJETAS DE INFORMACIÓN (INICIO) === */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.info-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--color-accent);
  transition: box-shadow var(--transition), transform var(--transition);
}

.info-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.info-card__icono {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.info-card__titulo {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.info-card p {
  color: var(--color-text-light);
  font-size: 0.92rem;
}

/* === CURRICULUM === */
.cv-bloque {
  margin-bottom: 2.5rem;
}

.cv-bloque__titulo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border);
}

.cv-bloque__titulo::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 28px;
  background: var(--color-accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.cv-lista {
  padding-left: 1.2rem;
}

.cv-lista li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1rem;
  font-size: 0.95rem;
  border-left: 2px solid var(--color-border);
}

.cv-lista li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 1rem;
  width: 8px;
  height: 8px;
  background: var(--color-accent);
  border-radius: 50%;
}

.cv-titulo-grado {
  font-weight: 600;
  color: var(--color-primary);
}

/* === PUBLICACIONES === */
.pub-intro {
  margin-bottom: 2rem;
  color: var(--color-text-light);
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.pub-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  color: var(--color-text);
}

.pub-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  color: var(--color-primary);
}

.pub-card__icono {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pub-card__icono svg {
  width: 22px;
  height: 22px;
  fill: var(--color-accent);
}

.pub-card__texto {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
}

/* === CONTACTO === */
.contacto-center {
  max-width: 600px;
  margin: 0 auto;
}

.contacto-datos {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow);
}

.contacto-dato {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contacto-dato:last-child { margin-bottom: 0; }

.contacto-dato__icono {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contacto-dato__icono svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.contacto-dato__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-light);
  margin-bottom: 0.15rem;
}

.contacto-dato__valor {
  font-weight: 500;
  color: var(--color-primary);
}

.contacto-dato__valor a {
  color: var(--color-primary);
}

.contacto-dato__valor a:hover {
  color: var(--color-accent);
}


/* Botón Correo */
.btn-correo {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: var(--color-primary);
  color: #fff !important;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
}

.btn-correo:hover {
  background: var(--color-primary-light);
  color: #fff !important;
  transform: translateY(-1px);
}

/* Botones WhatsApp */
.btn-whatsapp {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #25D366;
  color: #fff !important;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  transition: background var(--transition), transform var(--transition);
  margin-bottom: 0.5rem;
}

.btn-whatsapp:hover {
  background: #1ebe5d;
  color: #fff !important;
  transform: translateY(-1px);
}

.btn-whatsapp--alt {
  background: transparent;
  color: #25D366 !important;
  border: 1px solid #25D366;
}

.btn-whatsapp--alt:hover {
  background: #25D366;
  color: #fff !important;
}


/* === PIE DE PÁGINA (FOOTER) === */
.pie {
  background: var(--color-primary);
  color: rgba(255,255,255,0.7);
  padding: 2.5rem 0;
}

.pie__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.pie__copy {
  font-size: 0.85rem;
}

.pie__nav {
  display: flex;
  gap: 1.5rem;
}

.pie__nav a {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  transition: color var(--transition);
}

.pie__nav a:hover { color: var(--color-accent-light); }

/* === PAGE HEADER (para páginas interiores) === */
.page-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  padding: 3.5rem 0 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header__imagen-fondo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.12;
}

.page-header h1 {
  color: #fff;
  position: relative;
  z-index: 2;
}

.page-header__acento {
  display: block;
  width: 50px;
  height: 3px;
  background: var(--color-accent);
  margin: 1rem auto 0;
  position: relative;
  z-index: 2;
}

/* === PUBLICACIONES ACADÉMICAS (sección CV) === */
.pub-academica {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  font-size: 0.95rem;
  font-style: italic;
  border-left: 3px solid var(--color-accent);
}

.pub-academica strong {
  font-style: normal;
}

/* === RESPONSIVE === */

/* Tablet */
@media (max-width: 900px) {

  .hero__contenido {
    flex-direction: column;
    text-align: center;
  }

  .hero__descripcion {
    margin: 0 auto;
  }

  .hero__acento {
    margin: 1.2rem auto;
  }
}

/* Móvil */
@media (max-width: 640px) {
  .nav__toggle {
    display: block;
  }

  .nav__lista {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-primary);
    padding: 1rem 5%;
    gap: 0;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  }

  .nav__lista.is-open {
    display: flex;
  }

  .nav__enlace {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .hero {
    min-height: auto;
  }

  .hero__foto {
    width: 160px;
    height: 160px;
  }

  .hero__contenido {
    padding: 3rem 0;
  }

  .pub-grid {
    grid-template-columns: 1fr;
  }

  .info-cards {
    grid-template-columns: 1fr;
  }

  .seccion {
    padding: 2.5rem 0;
  }

  .contacto-datos {
    padding: 1.5rem;
  }

  .pie__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* Accesibilidad: respeta preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visible para teclado */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
