html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

:root {
  --vino: #4a0e0e;
  --rojo-oscuro: #7f1d1d;
  --vino-light: #6b1e1e;
  --rojo-light: #991b1b;
  --text: #1a0f0f;
  --text-light: #4a2c2c;
  --bg: #fdfcfc;
  --card-bg: #ffffff;
  --shadow-sm: 0 6px 20px rgba(74,14,14,0.12);
  --shadow-lg: 0 20px 50px rgba(127,29,29,0.18);
  --transition: all 0.35s ease;
  --radius: 14px;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}

/* ── HEADER ── */
.header {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(74,14,14,0.55), rgba(127,29,29,0.65));
  z-index: 1;
}

.header-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  width: 100%;
  height: 100%;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.header h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  color: white;
  margin-bottom: 1.2rem;
  text-shadow: 0 5px 15px rgba(0,0,0,0.7), 0 0 30px rgba(74,14,14,0.6);
  letter-spacing: -1px;
}

.header p {
  font-size: 1.8rem;
  font-weight: 500;
  color: #ffebeb;
  text-shadow: 0 3px 10px rgba(0,0,0,0.5);
  max-width: 800px;
  margin: 0 auto;
}

/* ── MENÚ ── */
.menu {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  white-space: nowrap;
}

.menu ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.menu a {
  text-decoration: none;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
  transition: var(--transition);
}

.menu a:hover {
  color: #ffcdd2;
}

/* ── SECCIONES ── */
section {
  padding: 6rem 1.8rem;
  max-width: 1300px;
  margin: 0 auto;
}

h2 {
  font-size: 2.8rem;
  color: var(--vino);
  text-align: center;
  margin-bottom: 2.5rem;
  font-weight: 700;
  position: relative;
}

h2::after {
  content: '';
  width: 100px;
  height: 4px;
  background: var(--rojo-oscuro);
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
}

/* ── INTRO / BIO ── */
.intro-bio-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
}

@media (min-width: 992px) {
  .intro-bio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bio-container {
  background: var(--card-bg);
  padding: 2.8rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.bio-container:hover {
  transform: translateY(-12px);
  box-shadow: 0 25px 55px rgba(127,29,29,0.2);
}

.bio-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.bio-image img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}

.bio-image img:hover {
  transform: scale(1.04);
}

.bio-text p {
  font-size: 1.12rem;
  color: var(--text-light);
  text-align: center;
}

/* ── ESTUDIOS GRID ── */
.contenido-principal {
  text-align: center;
}

.estudios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  max-width: 1000px;
  margin: 0 auto;
}

.estudios-grid li {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem;
  text-align: center;
  transition: var(--transition);
  font-size: 0.92rem;
  color: var(--text-light);
}

.estudios-grid li:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.estudios-grid li img {
  width: 100%;
  height: 140px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  cursor: pointer;
  display: block;
}

.hobbies {
  max-width: 1300px;
  margin: 0 auto;
  padding: 6rem 1.8rem;
}

.slider {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0 4rem;
  overflow: hidden;
}

.slider-track {
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  transition: transform 0.4s ease;
}

.item {
  flex: 0 0 280px;
  text-align: center;
}

.item img,
.item video {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  display: block;
}

.item img:hover,
.item video:hover {
  transform: scale(1.06);
}

.item p {
  margin-top: 0.6rem;
  font-weight: 600;
  color: var(--vino);
  font-size: 0.95rem;
}

.btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--vino);
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10;
}

.btn:hover {
  background: var(--rojo-oscuro);
  transform: translateY(-50%) scale(1.12);
}

.btn.prev { left: 0.5rem; }
.btn.next { right: 0.5rem; }

/* ── CARGOS ── */
.cargos {
  background: white;
  padding: 3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 850px;
  margin: 0 auto;
}

.cargos ul {
  list-style: none;
  padding: 0;
}

.cargos li {
  font-size: 1.05rem;
  color: var(--text-light);
  padding: 0.5rem 0;
}

/* ── MODAL ── */
.modal-img {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(74,14,14,0.94);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

#imgGrande,
#videoGrande {
  max-width: 94%;
  max-height: 88vh;
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(0,0,0,0.7);
}

.cerrar {
  position: absolute;
  top: 25px;
  right: 35px;
  color: white;
  font-size: 3.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.cerrar:hover {
  color: var(--rojo-oscuro);
  transform: rotate(90deg);
}

/* ── FOOTER ── */
footer {
  background: var(--vino);
  color: white;
  text-align: center;
  padding: 4rem 1.5rem;
  margin-top: 5rem;
}

footer p {
  margin: 0.8rem 0;
  font-size: 1.2rem;
}

/* ── COMPETENCIAS ── */
.competencia {
  display: flex;
  align-items: flex-start;
  gap: 2.2rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 2.8rem 3rem;
  margin-bottom: 3rem;
  transition: var(--transition);
  text-align: left;
  border-left: 6px solid var(--vino);
}

.competencia:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-left-color: var(--rojo-oscuro);
}

.competencia-numero {
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--vino);
  line-height: 1;
  min-width: 80px;
  opacity: 0.18;
  user-select: none;
  transition: var(--transition);
}

.competencia:hover .competencia-numero {
  opacity: 0.4;
}

.competencia-body {
  flex: 1;
}

.competencia-body h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--vino);
  margin-bottom: 1.8rem;
  line-height: 1.4;
}

.competencia-columnas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.reflexion,
.materias {
  background: var(--bg);
  border-radius: 10px;
  padding: 1.6rem 1.8rem;
}

.reflexion h4,
.materias h4 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--rojo-oscuro);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--rojo-oscuro);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.reflexion p {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.8;
}

.materias ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.materias ul li {
  font-size: 1rem;
  color: var(--text-light);
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(74,14,14,0.08);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  box-shadow: none;
  border-radius: 0;
  max-width: unset;
  margin: 0;
  transition: none;
}

.materias ul li:last-child {
  border-bottom: none;
}

.materias ul li::before {
  content: '▸';
  color: var(--vino);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.materias ul li:hover {
  transform: none;
  box-shadow: none;
  color: var(--vino);
}

/* ── FIGURA ESTILO WIKIPEDIA ── */
.wiki-figura {
  margin: 2rem auto 0;
  width: 200px;
  border: 1px solid rgba(74,14,14,0.18);
  border-radius: 8px;
  background: #faf8f8;
  padding: 6px;
  display: block;
}

/* Cuando no hay imagen: muestra el placeholder visual */
.wiki-img-placeholder {
  position: relative;
  width: 100%;
  background: #f2eded;
  border-radius: 5px;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  cursor: pointer;
  border: 2px dashed rgba(74,14,14,0.2);
  transition: var(--transition);
}

.wiki-img-placeholder:hover {
  border-color: var(--vino);
  background: #ede8e8;
}

.wiki-img-icon {
  font-size: 2rem;
  line-height: 1;
}

.wiki-img-texto {
  font-size: 0.72rem;
  font-family: 'Poppins', sans-serif;
  color: var(--text-light);
  letter-spacing: 0.5px;
}

/* La imagen real: oculta si no tiene src */
.wiki-img {
  width: 100%;
  height: auto;
  display: none;          /* se muestra con JS cuando src tiene valor */
  border-radius: 5px;
  cursor: pointer;
  transition: var(--transition);
}

.wiki-img:hover {
  opacity: 0.88;
}

/* Cuando la imagen SÍ tiene src, la mostramos y ocultamos el placeholder */
.wiki-img-placeholder:has(.wiki-img[src]:not([src=""])) .wiki-img {
  display: block;
}

.wiki-img-placeholder:has(.wiki-img[src]:not([src=""])) .wiki-img-icon,
.wiki-img-placeholder:has(.wiki-img[src]:not([src=""])) .wiki-img-texto {
  display: none;
}

/* Caption estilo Wikipedia */
.wiki-caption {
  font-family: 'Poppins', sans-serif;
  font-size: 0.72rem;
  color: var(--text-light);
  line-height: 1.45;
  text-align: center;
  padding: 5px 4px 2px;
  display: block;
}

/* Asegura que el float no rompa el layout de la card */
.competencia-body::after {
  content: '';
  display: table;
  clear: both;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .header { height: 55vh; min-height: 450px; }
  h2 { font-size: 2.3rem; }
  section { padding: 4.5rem 1.2rem; }
  .item { flex: 0 0 230px; }
  .item img, .item video { height: 175px; }

  .competencia {
    flex-direction: column;
    gap: 1rem;
    padding: 2rem 1.6rem;
  }

  .competencia-numero {
    font-size: 3rem;
    min-width: unset;
  }

  .competencia-columnas {
    grid-template-columns: 1fr;
  }

  .wiki-figura {
    width: 160px;
  }
}

/* ── HABILIDADES GRID ── */
.habilidades-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.5rem;
}

.habilidades-grid li {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem;
  text-align: center;
  transition: var(--transition);
  font-size: 0.92rem;
  color: var(--text-light);
}

.habilidades-grid li:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.habilidades-grid li img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 0.6rem;
  cursor: pointer;
  display: block;
}

/* item con múltiples imágenes */
.habilidades-grid li .fotos-grupo {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.habilidades-grid li .fotos-grupo img {
  flex: 1;
  margin-top: 0;
}

.habilidades-grid li video {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 0.6rem;
  display: block;
  cursor: pointer;
}