/* ============================================================
   python.css — estilos exclusivos del curso de Python
   ============================================================ */

.curso-cabecera {
  background: var(--tp);
  color: var(--paper);
  padding: 70px 0 62px;
}

.curso-cabecera h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-top: 16px;
  max-width: 18ch;
}

/* ============================================================
   PRESENTACIÓN DEL CURSO — TEXTO + IMAGEN
   ============================================================ */

.curso-presentacion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
}

.curso-texto {
  flex: 1;
  min-width: 0;
}

.imagen-curso {
  width: 220px;
  height: 220px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imagen-curso img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.curso-lenguaje {
  margin-top: 14px;
  color: #C7CFC9;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.niveles {
  padding: 70px 0;
}

.nivel {
  border: 1px solid var(--line);
  background: var(--paper-warm);
  margin-bottom: 26px;
  padding: 34px;
  border-left: 4px solid var(--brass);
}

.nivel:nth-child(2) {
  background: var(--paper);
}

.nivel:nth-child(3) {
  background: var(--tp);
  color: var(--paper);
}

.nivel-codigo {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--brass);
}

.nivel h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-top: 13px;
  color: var(--tp);
}

.nivel:nth-child(3) h2 {
  color: var(--paper);
}

.nivel h3 {
  font-size: 1.15rem;
  margin-top: 10px;
  color: var(--tp);
}

.nivel:nth-child(3) h3 {
  color: var(--paper);
}

.nivel p {
  margin-top: 13px;
  max-width: 70ch;
  color: var(--muted);
  line-height: 1.8;
}

.nivel:nth-child(3) p {
  color: #D5DBD6;
}

.nivel-contenido {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 30px;
  align-items: start;
  margin-top: 25px;
}

.nivel-numero {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  color: var(--brass);
  opacity: 0.85;
}

/* ============================================================
   VIDEOS DE LOS CURSOS
   ============================================================ */

.videos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  width: 100%;
}

.video-card {
  background: var(--paper-warm);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.video-contenedor {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}

.video-contenedor iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-card h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--tp);
  margin: 16px 16px 0;
}

.video-card p {
  margin: 7px 16px 18px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
}


/* ============================================================
   NIVEL CON VIDEOS
   ============================================================ */

.nivel-contenido {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 25px;
  align-items: start;
  margin-top: 25px;
}

.nivel-numero {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  color: var(--brass);
  opacity: 0.85;
}


/* El tercer nivel tiene fondo oscuro */

.nivel:nth-child(3) .video-card {
  background: #303131;
  border-color: #555;
}

.nivel:nth-child(3) .video-card h4 {
  color: var(--paper);
}

.nivel:nth-child(3) .video-card p {
  color: #C7CFC9;
}

/* ============================================================
   BOTÓN — PRACTICAR LO APRENDIDO
   ============================================================ */

.boton-ejercicio {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;

  margin-top: 18px !important;
  padding: 13px 22px !important;

  background: var(--tp) !important;
  color: var(--paper) !important;

  border: 1px solid var(--tp) !important;
  border-radius: 4px;

  font-family: 'IBM Plex Sans', sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;

  text-decoration: none !important;

  position: relative !important;
  overflow: hidden !important;

  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

/* Línea decorativa */
.boton-ejercicio::before {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  bottom: 0 !important;

  width: 0 !important;
  height: 3px !important;

  background: var(--brass) !important;

  transition: width 0.3s ease !important;
}

/* Efecto al pasar el mouse */
.boton-ejercicio:hover {
  background: var(--paper) !important;
  color: var(--tp) !important;

  transform: translateY(-3px) !important;

  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12) !important;
}

/* Aparece la línea inferior */
.boton-ejercicio:hover::before {
  width: 100% !important;
}

/* La flecha avanza */
.boton-ejercicio:hover::after {
  transform: translateX(5px) !important;
}

/* Efecto al hacer clic */
.boton-ejercicio:active {
  transform: translateY(-1px) !important;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.10) !important;
}

/* Accesibilidad con teclado */
.boton-ejercicio:focus-visible {
  outline: 2px solid var(--brass) !important;
  outline-offset: 4px !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 850px) {

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

}


@media (max-width: 700px) {

  .nivel-contenido {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .nivel-numero {
    font-size: 3rem;
  }

}


@media (max-width: 500px) {

  .nivel {
    padding: 22px 18px;
  }

  .video-card h4 {
    font-size: 1rem;
  }

}

.curso-regreso {
  padding: 0 0 70px;
}

.curso-regreso .boton {
  margin-top: 10px;
}

/* ---------- Navegación ---------- */

.encabezado .envolvente {
  justify-content: space-between;
}

.nav-ficheros a {
  opacity: 1;
}

/* ---------- Adaptación a pantallas pequeñas ---------- */

@media (max-width: 700px) {

  .curso-cabecera {
    padding: 52px 0 48px;
  }

  .niveles {
    padding: 50px 0;
  }

  .nivel {
    padding: 26px 22px;
  }

  .nivel-contenido {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .nivel-numero {
    font-size: 3rem;
  }

  .pie-inferior {
    flex-direction: column;
  }
}